runeblog 0.2.39 → 0.2.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/bin/mkwidget +209 -0
  3. data/empty_view/themes/standard/blog/index.lt3 +0 -1
  4. data/empty_view/themes/standard/etc/blog.css.lt3 +6 -1
  5. data/empty_view/themes/standard/navbar/faq.lt3 +1 -0
  6. data/empty_view/themes/standard/navbar/navbar.lt3 +1 -0
  7. data/empty_view/themes/standard/post/generate.lt3 +9 -4
  8. data/empty_view/themes/standard/widgets/ad/ad.lt3 +8 -1
  9. data/empty_view/themes/standard/widgets/ad/ad1.png +0 -0
  10. data/empty_view/themes/standard/widgets/ad/ad2.png +0 -0
  11. data/empty_view/themes/standard/widgets/ad/ad3.png +0 -0
  12. data/empty_view/themes/standard/widgets/ad/ad4.png +0 -0
  13. data/empty_view/themes/standard/widgets/bydates/README +2 -0
  14. data/empty_view/themes/standard/widgets/bydates/bydates.lt3 +2 -0
  15. data/empty_view/themes/standard/widgets/bydates/bydates.rb +14 -0
  16. data/empty_view/themes/standard/widgets/bydates/card.css +1 -0
  17. data/empty_view/themes/standard/widgets/bydates/custom.rb +1 -0
  18. data/empty_view/themes/standard/widgets/bydates/local-vars.lt3 +12 -0
  19. data/empty_view/themes/standard/widgets/bydates/main.css +2 -0
  20. data/empty_view/themes/standard/widgets/bydates/pieces/card-head.lt3 +8 -0
  21. data/empty_view/themes/standard/widgets/bydates/pieces/card-tail.lt3 +4 -0
  22. data/empty_view/themes/standard/widgets/bydates/pieces/main-head.lt3 +10 -0
  23. data/empty_view/themes/standard/widgets/bydates/pieces/main-tail.lt3 +4 -0
  24. data/empty_view/themes/standard/widgets/links/README +2 -0
  25. data/empty_view/themes/standard/widgets/links/card.css +1 -0
  26. data/empty_view/themes/standard/widgets/links/custom.rb +1 -0
  27. data/empty_view/themes/standard/widgets/links/links.lt3 +1 -1
  28. data/empty_view/themes/standard/widgets/links/links.rb +14 -0
  29. data/empty_view/themes/standard/widgets/links/local-vars.lt3 +12 -0
  30. data/empty_view/themes/standard/widgets/links/main.css +2 -0
  31. data/empty_view/themes/standard/widgets/links/pieces/card-head.lt3 +8 -0
  32. data/empty_view/themes/standard/widgets/links/pieces/card-tail.lt3 +4 -0
  33. data/empty_view/themes/standard/widgets/links/pieces/main-head.lt3 +10 -0
  34. data/empty_view/themes/standard/widgets/links/pieces/main-tail.lt3 +4 -0
  35. data/empty_view/themes/standard/widgets/news/README +2 -0
  36. data/empty_view/themes/standard/widgets/news/card.css +1 -0
  37. data/empty_view/themes/standard/widgets/news/custom.rb +1 -0
  38. data/empty_view/themes/standard/widgets/news/local-vars.lt3 +12 -0
  39. data/empty_view/themes/standard/widgets/news/main.css +2 -0
  40. data/empty_view/themes/standard/widgets/news/news.rb +14 -0
  41. data/empty_view/themes/standard/widgets/news/pieces/card-head.lt3 +8 -0
  42. data/empty_view/themes/standard/widgets/news/pieces/card-tail.lt3 +4 -0
  43. data/empty_view/themes/standard/widgets/news/pieces/main-head.lt3 +10 -0
  44. data/empty_view/themes/standard/widgets/news/pieces/main-tail.lt3 +4 -0
  45. data/empty_view/themes/standard/widgets/pages/{pieces/card.css → card.css} +0 -0
  46. data/empty_view/themes/standard/widgets/pages/custom.rb +1 -0
  47. data/empty_view/themes/standard/widgets/pages/local-vars.lt3 +12 -0
  48. data/empty_view/themes/standard/widgets/pages/main.css +2 -0
  49. data/empty_view/themes/standard/widgets/pages/pages.rb +4 -1
  50. data/empty_view/themes/standard/widgets/pages/pieces/main-head.lt3 +3 -1
  51. data/empty_view/themes/standard/widgets/pinned/README +2 -0
  52. data/empty_view/themes/standard/widgets/pinned/card.css +1 -0
  53. data/empty_view/themes/standard/widgets/pinned/custom.rb +1 -0
  54. data/empty_view/themes/standard/widgets/pinned/local-vars.lt3 +12 -0
  55. data/empty_view/themes/standard/widgets/pinned/main.css +2 -0
  56. data/empty_view/themes/standard/widgets/pinned/pieces/card-head.lt3 +8 -0
  57. data/empty_view/themes/standard/widgets/pinned/pieces/card-tail.lt3 +4 -0
  58. data/empty_view/themes/standard/widgets/pinned/pieces/main-head.lt3 +10 -0
  59. data/empty_view/themes/standard/widgets/pinned/pieces/main-tail.lt3 +4 -0
  60. data/empty_view/themes/standard/widgets/pinned/pinned.lt3 +2 -0
  61. data/empty_view/themes/standard/widgets/pinned/pinned.rb +14 -0
  62. data/empty_view/themes/standard/widgets/search/README +2 -0
  63. data/empty_view/themes/standard/widgets/search/card.css +1 -0
  64. data/empty_view/themes/standard/widgets/search/custom.rb +1 -0
  65. data/empty_view/themes/standard/widgets/search/local-vars.lt3 +12 -0
  66. data/empty_view/themes/standard/widgets/search/main.css +2 -0
  67. data/empty_view/themes/standard/widgets/search/pieces/card-head.lt3 +8 -0
  68. data/empty_view/themes/standard/widgets/search/pieces/card-tail.lt3 +4 -0
  69. data/empty_view/themes/standard/widgets/search/pieces/main-head.lt3 +10 -0
  70. data/empty_view/themes/standard/widgets/search/pieces/main-tail.lt3 +4 -0
  71. data/empty_view/themes/standard/widgets/search/search.lt3 +2 -0
  72. data/empty_view/themes/standard/widgets/search/search.rb +14 -0
  73. data/empty_view/themes/standard/widgets/sitemap/README +2 -0
  74. data/empty_view/themes/standard/widgets/sitemap/card.css +1 -0
  75. data/empty_view/themes/standard/widgets/sitemap/custom.rb +1 -0
  76. data/empty_view/themes/standard/widgets/sitemap/local-vars.lt3 +12 -0
  77. data/empty_view/themes/standard/widgets/sitemap/main.css +2 -0
  78. data/empty_view/themes/standard/widgets/sitemap/pieces/card-head.lt3 +8 -0
  79. data/empty_view/themes/standard/widgets/sitemap/pieces/card-tail.lt3 +4 -0
  80. data/empty_view/themes/standard/widgets/sitemap/pieces/main-head.lt3 +10 -0
  81. data/empty_view/themes/standard/widgets/sitemap/pieces/main-tail.lt3 +4 -0
  82. data/empty_view/themes/standard/widgets/sitemap/sitemap.lt3 +2 -0
  83. data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +14 -0
  84. data/empty_view/themes/standard/widgets/tag-cloud/OLD-example.lt3 +12 -0
  85. data/empty_view/themes/standard/widgets/tag-cloud/README +2 -0
  86. data/empty_view/themes/standard/widgets/tag-cloud/card.css +1 -0
  87. data/empty_view/themes/standard/widgets/tag-cloud/custom.rb +1 -0
  88. data/empty_view/themes/standard/widgets/tag-cloud/local-vars.lt3 +12 -0
  89. data/empty_view/themes/standard/widgets/tag-cloud/main.css +2 -0
  90. data/empty_view/themes/standard/widgets/tag-cloud/pieces/card-head.lt3 +8 -0
  91. data/empty_view/themes/standard/widgets/tag-cloud/pieces/card-tail.lt3 +4 -0
  92. data/empty_view/themes/standard/widgets/tag-cloud/pieces/main-head.lt3 +10 -0
  93. data/empty_view/themes/standard/widgets/tag-cloud/pieces/main-tail.lt3 +4 -0
  94. data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.lt3 +1 -10
  95. data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +14 -0
  96. data/lib/default.rb +1 -4
  97. data/lib/global.rb +8 -7
  98. data/lib/helpers-blog.rb +15 -15
  99. data/lib/liveblog.rb +62 -28
  100. data/lib/logging.rb +17 -8
  101. data/lib/post.rb +6 -6
  102. data/lib/publish.rb +4 -4
  103. data/lib/runeblog.rb +79 -47
  104. data/lib/runeblog_version.rb +1 -1
  105. data/lib/view.rb +2 -8
  106. data/lib/xlate.rb +2 -2
  107. data/test/austin.rb +150 -0
  108. data/test/make_blog.rb +23 -2
  109. metadata +88 -8
  110. data/empty_view/remote/widgets/links/list.data +0 -3
  111. data/empty_view/remote/widgets/news/list.data +0 -4
  112. data/empty_view/remote/widgets/pages/list.data +0 -4
  113. data/empty_view/themes/standard/widgets/calendar/calendar.lt3 +0 -6
  114. data/empty_view/themes/standard/widgets/pages/pieces/main.css +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caacbdabded61281f3fd6cab3f627a5b014e896381f2b73e070f0aa64630b4d7
4
- data.tar.gz: e1d37b1f874ef57568d710ab90a93977491327b40d140987f9a120ad87fb4642
3
+ metadata.gz: b0b81363110b0cb0392e016c289ee76b841d05a2d4ed2167ce26b9f08bb2e1ae
4
+ data.tar.gz: c57eedabc749e9bee009dd3dc68c9f5ad8f430ae858ff6e307b027cd90fbf147
5
5
  SHA512:
6
- metadata.gz: ed10a449202c4ca21d228d11eea08aa6c65693c3dd9e81498a368b0a362f341726a141fc878e31c7cf07573c1858d6aa70cdbb08fcb29043d62cd734153dffe3
7
- data.tar.gz: a95f146d7bb55ae8a115f495423c0287453e8cdb0335c3615c5cfae4d77c842cb417bc1f763d972f2b241d6ac7f463e3b823be1789bb5b026f49745680b261d2
6
+ metadata.gz: 20a947a5d88018aa3a9942b559cba915f15c733120ffbdd46433e50ea018bd9997184a194220a530882c9bcfab818a364c141b3ba62a4d36411b4241617521b4
7
+ data.tar.gz: '019e9d9fbff78f670ea225014e3ec9208aa9fb0fd31fbc4241262d9f4ed39c365f5be14c6d3439e9bb996a9cea568ef81ddd1b1a41ad369b14279339160f91a8'
@@ -0,0 +1,209 @@
1
+ #!/usr/bin/env ruby
2
+ =begin
3
+ std-widget/
4
+ std-widget/local-vars.lt3
5
+ std-widget//list.data
6
+ std-widget//pieces
7
+ std-widget//pieces/card-head.lt3
8
+ std-widget//pieces/card-tail.lt3
9
+ std-widget//pieces/card.css
10
+ std-widget//pieces/main-head.lt3
11
+ std-widget//pieces/main-tail.lt3
12
+ std-widget//pieces/main.css
13
+ std-widget//README
14
+ std-widget//WIDGET.lt3
15
+ std-widget//WIDGET.rb
16
+ =end
17
+
18
+ # FIXME Also fix the
19
+
20
+ def write_local_vars
21
+ File.open("std_widget/local-vars.lt3", "w") do |f|
22
+ f.puts <<~LIVE
23
+ # #@app: #@title
24
+ .set widget.name = "#@title"
25
+
26
+ . heredocs (in case of embedded commas)
27
+
28
+ .heredoc card.title
29
+ $widget.name
30
+ .end
31
+
32
+ .heredoc main.title
33
+ $widget.name
34
+ .end
35
+ LIVE
36
+ end
37
+ end
38
+
39
+ def write_card_head
40
+ File.open("std_widget/pieces/card-head.lt3", "w") do |f|
41
+ f.puts <<~LIVE
42
+ .include ../local_vars.lt3
43
+ . Material (if any) to go before card data
44
+ <html>
45
+ <head>
46
+ <style src="card.css"></style>
47
+ </head>
48
+ <body>
49
+ <h1>#@title</h1>
50
+ LIVE
51
+ # </html> damned syntax highlighting
52
+ end
53
+ end
54
+
55
+ def write_card_tail
56
+ File.open("std_widget/pieces/card-tail.lt3", "w") do |f|
57
+ f.puts <<~LIVE
58
+ .include ../local_vars.lt3
59
+ . Material (if any) to go after main data
60
+ </body>
61
+ </html>
62
+ LIVE
63
+ # </html> damned syntax highlighting
64
+ end
65
+ end
66
+
67
+ def write_main_head
68
+ File.open("std_widget/pieces/main-head.lt3", "w") do |f|
69
+ f.puts <<~LIVE
70
+ .include ../local_vars.lt3
71
+ . Material (if any) to go before main data
72
+ <html>
73
+ <head>
74
+ <style src="main.css"></style>
75
+ </head>
76
+ <body>
77
+ <h1>$card.title</h1>
78
+ LIVE
79
+ # </html> damned syntax highlighting
80
+ end
81
+ end
82
+
83
+ def write_main_tail
84
+ File.open("std_widget/pieces/main-tail.lt3", "w") do |f|
85
+ f.puts <<~LIVE
86
+ .include ../local_vars.lt3
87
+ . Material (if any) to go after main data
88
+ </body>
89
+ </html>
90
+ LIVE
91
+ # </html> damned syntax highlighting
92
+ end
93
+ end
94
+
95
+ def write_css
96
+ # Need .lt3 file?
97
+ File.open("std_widget/card.css", "w") do |f|
98
+ f.puts <<~LIVE
99
+ # CSS for sidebar card
100
+ LIVE
101
+ end
102
+ File.open("std_widget/main.css", "w") do |f|
103
+ f.puts <<~LIVE
104
+ # CSS for main area page
105
+ LIVE
106
+ end
107
+ end
108
+
109
+ def _make_class_name(app)
110
+ if app =~ /[-_]/
111
+ words = app.split(/[-_]/)
112
+ name = words.map(&:capitalize).join
113
+ else
114
+ name = app.capitalize
115
+ end
116
+ return name
117
+ end
118
+
119
+ def write_widget_ruby
120
+ File.open("std_widget/#@app.rb", "w") do |f|
121
+ f.puts <<~LIVE
122
+ # Custom code for '#@app' widget
123
+
124
+ class ::RuneBlog::Widget
125
+ class #{_make_class_name(@app)}
126
+ def self.build
127
+ end
128
+
129
+ def self.edit_menu
130
+ end
131
+
132
+ def self.refresh
133
+ end
134
+ end
135
+ end
136
+ LIVE
137
+ end
138
+ end
139
+
140
+ def write_widget_livetext
141
+ File.open("std_widget/#@app.lt3", "w") do |f|
142
+ f.puts <<~LIVE
143
+ .mixin liveblog
144
+ .make_main_links #@app #@title
145
+ LIVE
146
+ end
147
+ end
148
+
149
+ def write_custom_ruby
150
+ File.open("std_widget/custom.rb", "w") do |f|
151
+ f.puts <<~LIVE
152
+ # This is for specialized livetext add-ons (Ruby methods)
153
+ LIVE
154
+ end
155
+ end
156
+
157
+ def write_README
158
+ File.open("std_widget/README", "w") do |f|
159
+ f.puts <<~LIVE
160
+ This is for a "standard" Runeblog widget
161
+ Code and docs are a work in progress
162
+ LIVE
163
+ end
164
+ end
165
+
166
+ def safe_copy(src)
167
+ dst = src.sub(/std_widget/, "empty_view/themes/standard/widgets/#@app")
168
+ if File.exist?(dst)
169
+ puts "Skip: #{src}"
170
+ return
171
+ else
172
+ puts "Copying: #{src}"
173
+ system("cp #{src} #{dst}")
174
+ end
175
+ end
176
+
177
+ def copy_over
178
+ here, there = "std_widget", "empty_view/themes/standard/widgets/#@app"
179
+ slist = Dir["#{here}/*"].reject {|x| File.directory?(x) }
180
+ slist.each {|src| safe_copy(src) }
181
+
182
+ here, there = "std_widget/pieces", "empty_view/themes/standard/widgets/#@app/pieces"
183
+ system("mkdir #{there}") unless Dir.exist?(there)
184
+ slist = Dir["#{here}/*"]
185
+ slist.each {|src| safe_copy(src) }
186
+ end
187
+
188
+
189
+ ### "Main"
190
+
191
+ abort 'Need app, "title..."' if ARGV.empty?
192
+ @app, @title = *ARGV
193
+
194
+ system("rm -rf std_widget")
195
+ system("mkdir -p std_widget/pieces")
196
+
197
+ write_local_vars
198
+ write_main_head
199
+ write_main_tail
200
+ write_card_head
201
+ write_card_tail
202
+ write_css
203
+
204
+ write_widget_ruby
205
+ write_widget_livetext
206
+ write_custom_ruby
207
+ write_README
208
+
209
+ copy_over
@@ -12,6 +12,5 @@
12
12
  links
13
13
  news
14
14
  pages
15
- tag-cloud
16
15
  .end
17
16
 
@@ -24,7 +24,6 @@
24
24
  \.post-title-text a {
25
25
  color: $post.text.color;
26
26
  font-size: $post.text.size;
27
- # float: right;
28
27
  display: block;
29
28
  text-decoration: none;
30
29
  }
@@ -41,3 +40,9 @@
41
40
  text-align: top;
42
41
  }
43
42
 
43
+ . not used?
44
+ \.thumbnail img {
45
+ max-height: 100%;
46
+ max-width: 100%;
47
+ }
48
+
@@ -0,0 +1 @@
1
+ .include ../widgets/pages/faq.lt3
@@ -12,5 +12,6 @@
12
12
  index Home
13
13
  about About
14
14
  contact Contact
15
+ faq FAQ
15
16
  .end
16
17
 
@@ -5,10 +5,8 @@
5
5
  . --------------------------------------------------
6
6
 
7
7
  .mixin liveblog
8
-
9
8
  <html>
10
- <!-- Editing this file is not recommended. -->
11
- <!-- It was generated from $File on $$date. -->
9
+ <!-- Generated from $File on $$date; editing not recommended. -->
12
10
 
13
11
  .seek global.lt3
14
12
  .include vars.lt3
@@ -18,13 +16,20 @@ og:title $title
18
16
  description $teaser
19
17
  .end
20
18
 
19
+ <body>
20
+
21
21
  <section class="post">
22
22
  <div class="entry-content">
23
+ <table border=0 width=100%><tr>
24
+ <td align=left valign=bottom><h2 class="post-title">$title</h2></td>
25
+ <td align=right valign=top><font size=-5><br></font>$longdate</td>
26
+ </tr></table><hr>
23
27
  $.copy guts.html
24
28
  </div>
25
29
  </section>
26
30
 
27
31
  <br>
28
- <a href="javascript:history.go(-1)">[Back]</a>
32
+ <hr>
33
+ .post_trailer
29
34
  </body>
30
35
  </html>
@@ -1,15 +1,22 @@
1
1
  . In real life, ads won't work this way...
2
2
 
3
+ .include vars.lt3
4
+
3
5
  .set classname="btn btn-light float-right"
4
6
  .set card.title="Advertisement"
5
7
  .set card.text="Build your amazing website with blabla.com."
6
- .set extra="bg-dark text-white"
8
+ . set extra="bg-dark text-white"
9
+
10
+ <!-- "$ad.image" -->
7
11
 
8
12
  <div class="card $extra mb-3">
9
13
  <div class="card-body">
14
+ <!--
10
15
  <h5 class="card-title">$card.title</h5>
11
16
  <p class="card-text">$card.text</p>
12
17
  <a href="javascript: void(0)" onclick="javascript:open_main('widgets/ad/ad.html')" class="$classname">Visit page</a>
18
+ -->
19
+ <img style="max-height: 100%; max-width: 100%" src="$ad.image"></img>
13
20
  </div>
14
21
  </div>
15
22
 
@@ -0,0 +1,2 @@
1
+ This is for a "standard" Runeblog widget
2
+ Code and docs are a work in progress
@@ -0,0 +1,2 @@
1
+ .mixin liveblog
2
+ .make_main_links bydates Posts by Date
@@ -0,0 +1,14 @@
1
+ # Custom code for 'bydates' widget
2
+
3
+ class ::RuneBlog::Widget
4
+ class Bydates
5
+ def self.build
6
+ end
7
+
8
+ def self.edit_menu
9
+ end
10
+
11
+ def self.refresh
12
+ end
13
+ end
14
+ end
@@ -0,0 +1 @@
1
+ # CSS for sidebar card
@@ -0,0 +1 @@
1
+ # This is for specialized livetext add-ons (Ruby methods)
@@ -0,0 +1,12 @@
1
+ # bydates: Posts by Date
2
+ .set widget.name = "Posts by Date"
3
+
4
+ . heredocs (in case of embedded commas)
5
+
6
+ .heredoc card.title
7
+ $widget.name
8
+ .end
9
+
10
+ .heredoc main.title
11
+ $widget.name
12
+ .end
@@ -0,0 +1,2 @@
1
+ # CSS for main area page
2
+ * { font-family: verdana }
@@ -0,0 +1,8 @@
1
+ .include ../local_vars.lt3
2
+ . Material (if any) to go before card data
3
+ <html>
4
+ <head>
5
+ <style src="card.css"></style>
6
+ </head>
7
+ <body>
8
+ <h1>Posts by Date</h1>
@@ -0,0 +1,4 @@
1
+ .include ../local_vars.lt3
2
+ . Material (if any) to go after main data
3
+ </body>
4
+ </html>
@@ -0,0 +1,10 @@
1
+ .include ../local_vars.lt3
2
+ . Material (if any) to go before main data
3
+ <html>
4
+ <head>
5
+ <style src="main.css"></style>
6
+ <!-- ^ Why doesn't this work? -->
7
+ <style>* { font-family: verdana }</style>
8
+ </head>
9
+ <body>
10
+ <h1>$card.title</h1><hr>
@@ -0,0 +1,4 @@
1
+ .include ../local_vars.lt3
2
+ . Material (if any) to go after main data
3
+ </body>
4
+ </html>
@@ -0,0 +1,2 @@
1
+ This is for a "standard" Runeblog widget
2
+ Code and docs are a work in progress
@@ -0,0 +1 @@
1
+ # CSS for sidebar card
@@ -0,0 +1 @@
1
+ # This is for specialized livetext add-ons (Ruby methods)
@@ -1,2 +1,2 @@
1
1
  .mixin liveblog
2
- .make_main_links links Links (to Elsewhere)
2
+ .make_main_links links External Links
@@ -0,0 +1,14 @@
1
+ # Custom code for 'links' widget
2
+
3
+ class ::RuneBlog::Widget
4
+ class Links
5
+ def self.build
6
+ end
7
+
8
+ def self.edit_menu
9
+ end
10
+
11
+ def self.refresh
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # links: External Links
2
+ .set widget.name = "External Links"
3
+
4
+ . heredocs (in case of embedded commas)
5
+
6
+ .heredoc card.title
7
+ $widget.name
8
+ .end
9
+
10
+ .heredoc main.title
11
+ $widget.name
12
+ .end