runeblog 0.2.36 → 0.2.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/bin/mkwidget +209 -0
  3. data/empty_view/themes/standard/blog/generate.lt3 +12 -12
  4. data/empty_view/themes/standard/blog/index.lt3 +0 -1
  5. data/empty_view/themes/standard/widgets/bydates/README +2 -0
  6. data/empty_view/themes/standard/widgets/bydates/bydates.lt3 +2 -0
  7. data/empty_view/themes/standard/widgets/bydates/bydates.rb +14 -0
  8. data/empty_view/themes/standard/widgets/bydates/card.css +1 -0
  9. data/empty_view/themes/standard/widgets/bydates/custom.rb +1 -0
  10. data/empty_view/themes/standard/widgets/bydates/local-vars.lt3 +12 -0
  11. data/empty_view/themes/standard/widgets/bydates/main.css +2 -0
  12. data/empty_view/themes/standard/widgets/bydates/pieces/card-head.lt3 +8 -0
  13. data/empty_view/themes/standard/widgets/bydates/pieces/card-tail.lt3 +4 -0
  14. data/empty_view/themes/standard/widgets/bydates/pieces/main-head.lt3 +10 -0
  15. data/empty_view/themes/standard/widgets/bydates/pieces/main-tail.lt3 +4 -0
  16. data/empty_view/themes/standard/widgets/links/README +2 -0
  17. data/empty_view/themes/standard/widgets/links/card.css +1 -0
  18. data/empty_view/themes/standard/widgets/links/custom.rb +1 -0
  19. data/empty_view/themes/standard/widgets/links/links.lt3 +1 -1
  20. data/empty_view/themes/standard/widgets/links/links.rb +14 -0
  21. data/empty_view/themes/standard/widgets/links/local-vars.lt3 +12 -0
  22. data/empty_view/themes/standard/widgets/links/main.css +2 -0
  23. data/empty_view/themes/standard/widgets/links/pieces/card-head.lt3 +8 -0
  24. data/empty_view/themes/standard/widgets/links/pieces/card-tail.lt3 +4 -0
  25. data/empty_view/themes/standard/widgets/links/pieces/main-head.lt3 +10 -0
  26. data/empty_view/themes/standard/widgets/links/pieces/main-tail.lt3 +4 -0
  27. data/empty_view/themes/standard/widgets/news/README +2 -0
  28. data/empty_view/themes/standard/widgets/news/card.css +1 -0
  29. data/empty_view/themes/standard/widgets/news/custom.rb +1 -0
  30. data/empty_view/themes/standard/widgets/news/local-vars.lt3 +12 -0
  31. data/empty_view/themes/standard/widgets/news/main.css +2 -0
  32. data/empty_view/themes/standard/widgets/news/news.rb +14 -0
  33. data/empty_view/themes/standard/widgets/news/pieces/card-head.lt3 +8 -0
  34. data/empty_view/themes/standard/widgets/news/pieces/card-tail.lt3 +4 -0
  35. data/empty_view/themes/standard/widgets/news/pieces/main-head.lt3 +10 -0
  36. data/empty_view/themes/standard/widgets/news/pieces/main-tail.lt3 +4 -0
  37. data/empty_view/themes/standard/widgets/pages/card.css +1 -0
  38. data/empty_view/themes/standard/widgets/pages/custom.rb +1 -0
  39. data/empty_view/themes/standard/widgets/pages/local-vars.lt3 +12 -0
  40. data/empty_view/themes/standard/widgets/pages/local.rb +0 -0
  41. data/empty_view/themes/standard/widgets/pages/main.css +2 -0
  42. data/empty_view/themes/standard/widgets/pages/pages.rb +21 -0
  43. data/empty_view/themes/standard/widgets/pages/pieces/card-head.lt3 +1 -0
  44. data/empty_view/themes/standard/widgets/pages/pieces/card-tail.lt3 +1 -0
  45. data/empty_view/themes/standard/widgets/pages/pieces/main-head.lt3 +10 -0
  46. data/empty_view/themes/standard/widgets/pages/pieces/main-tail.lt3 +2 -0
  47. data/empty_view/themes/standard/widgets/pinned/README +2 -0
  48. data/empty_view/themes/standard/widgets/pinned/card.css +1 -0
  49. data/empty_view/themes/standard/widgets/pinned/custom.rb +1 -0
  50. data/empty_view/themes/standard/widgets/pinned/local-vars.lt3 +12 -0
  51. data/empty_view/themes/standard/widgets/pinned/main.css +2 -0
  52. data/empty_view/themes/standard/widgets/pinned/pieces/card-head.lt3 +8 -0
  53. data/empty_view/themes/standard/widgets/pinned/pieces/card-tail.lt3 +4 -0
  54. data/empty_view/themes/standard/widgets/pinned/pieces/main-head.lt3 +10 -0
  55. data/empty_view/themes/standard/widgets/pinned/pieces/main-tail.lt3 +4 -0
  56. data/empty_view/themes/standard/widgets/pinned/pinned.lt3 +2 -0
  57. data/empty_view/themes/standard/widgets/pinned/pinned.rb +14 -0
  58. data/empty_view/themes/standard/widgets/search/README +2 -0
  59. data/empty_view/themes/standard/widgets/search/card.css +1 -0
  60. data/empty_view/themes/standard/widgets/search/custom.rb +1 -0
  61. data/empty_view/themes/standard/widgets/search/local-vars.lt3 +12 -0
  62. data/empty_view/themes/standard/widgets/search/main.css +2 -0
  63. data/empty_view/themes/standard/widgets/search/pieces/card-head.lt3 +8 -0
  64. data/empty_view/themes/standard/widgets/search/pieces/card-tail.lt3 +4 -0
  65. data/empty_view/themes/standard/widgets/search/pieces/main-head.lt3 +10 -0
  66. data/empty_view/themes/standard/widgets/search/pieces/main-tail.lt3 +4 -0
  67. data/empty_view/themes/standard/widgets/search/search.lt3 +2 -0
  68. data/empty_view/themes/standard/widgets/search/search.rb +14 -0
  69. data/empty_view/themes/standard/widgets/sitemap/README +2 -0
  70. data/empty_view/themes/standard/widgets/sitemap/card.css +1 -0
  71. data/empty_view/themes/standard/widgets/sitemap/custom.rb +1 -0
  72. data/empty_view/themes/standard/widgets/sitemap/local-vars.lt3 +12 -0
  73. data/empty_view/themes/standard/widgets/sitemap/main.css +2 -0
  74. data/empty_view/themes/standard/widgets/sitemap/pieces/card-head.lt3 +8 -0
  75. data/empty_view/themes/standard/widgets/sitemap/pieces/card-tail.lt3 +4 -0
  76. data/empty_view/themes/standard/widgets/sitemap/pieces/main-head.lt3 +10 -0
  77. data/empty_view/themes/standard/widgets/sitemap/pieces/main-tail.lt3 +4 -0
  78. data/empty_view/themes/standard/widgets/sitemap/sitemap.lt3 +2 -0
  79. data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +14 -0
  80. data/empty_view/themes/standard/widgets/tag-cloud/OLD-example.lt3 +12 -0
  81. data/empty_view/themes/standard/widgets/tag-cloud/README +2 -0
  82. data/empty_view/themes/standard/widgets/tag-cloud/card.css +1 -0
  83. data/empty_view/themes/standard/widgets/tag-cloud/custom.rb +1 -0
  84. data/empty_view/themes/standard/widgets/tag-cloud/local-vars.lt3 +12 -0
  85. data/empty_view/themes/standard/widgets/tag-cloud/main.css +2 -0
  86. data/empty_view/themes/standard/widgets/tag-cloud/pieces/card-head.lt3 +8 -0
  87. data/empty_view/themes/standard/widgets/tag-cloud/pieces/card-tail.lt3 +4 -0
  88. data/empty_view/themes/standard/widgets/tag-cloud/pieces/main-head.lt3 +10 -0
  89. data/empty_view/themes/standard/widgets/tag-cloud/pieces/main-tail.lt3 +4 -0
  90. data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.lt3 +1 -10
  91. data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +14 -0
  92. data/lib/helpers-repl.rb +4 -2
  93. data/lib/liveblog.rb +75 -12
  94. data/lib/repl.rb +34 -21
  95. data/lib/runeblog.rb +7 -4
  96. data/lib/runeblog_version.rb +1 -1
  97. data/lib/xlate.rb +5 -0
  98. data/test/make_blog.rb +23 -2
  99. metadata +88 -6
  100. data/empty_view/remote/widgets/pages/SUBFILES +0 -1
  101. data/empty_view/themes/standard/widgets/calendar/calendar.lt3 +0 -6
  102. data/empty_view/themes/standard/widgets/pages/SUBFILES +0 -1
  103. data/empty_view/themes/standard/widgets/pages/generated.lt3 +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcfdb93b7e151b307a4776601a4c171e5dba3a88a63b859d3c319bb796215981
4
- data.tar.gz: fa8e91e0f9be6fd7e0111a3b584fec90ff397b0079eb48969d3c2de40467b73e
3
+ metadata.gz: 01171d08263fe5ee887ce0823abd7195ce9f9240c1f45cf3de94335b0112a98b
4
+ data.tar.gz: aa6f0ed12b6554c0b5d93ed0f6d29be4f9a071dc27654b1cebd4d5c6b952591b
5
5
  SHA512:
6
- metadata.gz: 4c40488f1169eef37e142b9550ec589737a345fcca6ceb669baebea94a2d651583cda37ee7d89f11ee83abac9f2ed29584ac3b41b0a6e87c50fff18bc54e13da
7
- data.tar.gz: 0b389d93a294814f62de4dba5065ba5ac15805e7ac068408d867e83b05901fc6e3848d57e539fc445781d34e564bdb6bd367f8bf59cd39fcc7ff8ee175f54f4a
6
+ metadata.gz: fba5b0128b75456357871b559f4c033de9c9b4d54215358cf8f371a9125a6145d560b71f764042f9db3deca9a00e64e0a6f9f71356cfcdcc8592e5b7e0b25c8e
7
+ data.tar.gz: 7b51735446277efdc8da39e0835434b24ca0de5035cdfbbbeaaad35f09da980a87869687d93fe51e8ef68ee7d7be431c413a06ff7cf4fb46e4e3d8dc735b7226
@@ -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
@@ -2,7 +2,7 @@
2
2
  . This file will usually not be edited by the user.
3
3
  . It is used to generate the top-level index.html
4
4
  . The user will more often edit blog/index.lt3 in
5
- . the process of blog setup.
5
+ . the process of blog setup.
6
6
  . --------------------------------------------------
7
7
 
8
8
  .mixin liveblog
@@ -15,17 +15,17 @@
15
15
  <body>
16
16
 
17
17
  . FIXME
18
- <table width=100%>
19
- <tr>
20
- <td width=30% bgcolor=black>
21
- <div style="text-align: center; color: white">
22
- <h1>Around Austin</h1><br>
23
- The view from downtown...
24
- </div>
25
- </td>
26
- <td><img src=assets/sky2.jpg width=100%></img>
27
- </tr>
28
- </table>
18
+ <table width=100%>
19
+ <tr>
20
+ <td width=30% bgcolor=black>
21
+ <div style="text-align: center; color: white">
22
+ <h1>Around Austin</h1><br>
23
+ The view from downtown...
24
+ </div>
25
+ </td>
26
+ <td><img src=assets/sky2.jpg width=100%></img>
27
+ </tr>
28
+ </table>
29
29
 
30
30
  $.include navbar/navbar.lt3
31
31
  <div class="content container-fluid mt-4">
@@ -12,6 +12,5 @@
12
12
  links
13
13
  news
14
14
  pages
15
- tag-cloud
16
15
  .end
17
16
 
@@ -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
@@ -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>External Links</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)
@@ -0,0 +1,12 @@
1
+ # news: Recent News
2
+ .set widget.name = "Recent News"
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