runeblog 0.2.35 → 0.2.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/bin/mkwidget +209 -0
  3. data/empty_view/remote/assets/GIT_IS_DUMB +1 -0
  4. data/empty_view/remote/etc/GIT_IS_DUMB +1 -0
  5. data/empty_view/remote/navbar/GIT_IS_DUMB +1 -0
  6. data/empty_view/remote/permalink/GIT_IS_DUMB +1 -0
  7. data/empty_view/themes/standard/blog/generate.lt3 +12 -12
  8. data/empty_view/themes/standard/blog/index.lt3 +0 -1
  9. data/empty_view/themes/standard/widgets/bydates/README +2 -0
  10. data/empty_view/themes/standard/widgets/bydates/bydates.lt3 +2 -0
  11. data/empty_view/themes/standard/widgets/bydates/bydates.rb +14 -0
  12. data/empty_view/themes/standard/widgets/bydates/card.css +1 -0
  13. data/empty_view/themes/standard/widgets/bydates/custom.rb +1 -0
  14. data/empty_view/themes/standard/widgets/bydates/local-vars.lt3 +12 -0
  15. data/empty_view/themes/standard/widgets/bydates/main.css +2 -0
  16. data/empty_view/themes/standard/widgets/bydates/pieces/card-head.lt3 +8 -0
  17. data/empty_view/themes/standard/widgets/bydates/pieces/card-tail.lt3 +4 -0
  18. data/empty_view/themes/standard/widgets/bydates/pieces/main-head.lt3 +10 -0
  19. data/empty_view/themes/standard/widgets/bydates/pieces/main-tail.lt3 +4 -0
  20. data/empty_view/themes/standard/widgets/links/README +2 -0
  21. data/empty_view/themes/standard/widgets/links/card.css +1 -0
  22. data/empty_view/themes/standard/widgets/links/custom.rb +1 -0
  23. data/empty_view/themes/standard/widgets/links/links.lt3 +1 -1
  24. data/empty_view/themes/standard/widgets/links/links.rb +14 -0
  25. data/empty_view/themes/standard/widgets/links/local-vars.lt3 +12 -0
  26. data/empty_view/themes/standard/widgets/links/main.css +2 -0
  27. data/empty_view/themes/standard/widgets/links/pieces/card-head.lt3 +8 -0
  28. data/empty_view/themes/standard/widgets/links/pieces/card-tail.lt3 +4 -0
  29. data/empty_view/themes/standard/widgets/links/pieces/main-head.lt3 +10 -0
  30. data/empty_view/themes/standard/widgets/links/pieces/main-tail.lt3 +4 -0
  31. data/empty_view/themes/standard/widgets/news/README +2 -0
  32. data/empty_view/themes/standard/widgets/news/card.css +1 -0
  33. data/empty_view/themes/standard/widgets/news/custom.rb +1 -0
  34. data/empty_view/themes/standard/widgets/news/local-vars.lt3 +12 -0
  35. data/empty_view/themes/standard/widgets/news/main.css +2 -0
  36. data/empty_view/themes/standard/widgets/news/news.rb +14 -0
  37. data/empty_view/themes/standard/widgets/news/pieces/card-head.lt3 +8 -0
  38. data/empty_view/themes/standard/widgets/news/pieces/card-tail.lt3 +4 -0
  39. data/empty_view/themes/standard/widgets/news/pieces/main-head.lt3 +10 -0
  40. data/empty_view/themes/standard/widgets/news/pieces/main-tail.lt3 +4 -0
  41. data/empty_view/themes/standard/widgets/pages/card.css +1 -0
  42. data/empty_view/themes/standard/widgets/pages/custom.rb +1 -0
  43. data/empty_view/themes/standard/widgets/pages/local-vars.lt3 +12 -0
  44. data/empty_view/themes/standard/widgets/pages/local.rb +0 -0
  45. data/empty_view/themes/standard/widgets/pages/main.css +2 -0
  46. data/empty_view/themes/standard/widgets/pages/pages.rb +21 -0
  47. data/empty_view/themes/standard/widgets/pages/pieces/card-head.lt3 +1 -0
  48. data/empty_view/themes/standard/widgets/pages/pieces/card-tail.lt3 +1 -0
  49. data/empty_view/themes/standard/widgets/pages/pieces/main-head.lt3 +10 -0
  50. data/empty_view/themes/standard/widgets/pages/pieces/main-tail.lt3 +2 -0
  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/helpers-repl.rb +4 -2
  97. data/lib/liveblog.rb +75 -12
  98. data/lib/publish.rb +0 -10
  99. data/lib/repl.rb +34 -21
  100. data/lib/runeblog.rb +9 -7
  101. data/lib/runeblog_version.rb +1 -1
  102. data/lib/view.rb +1 -1
  103. data/lib/xlate.rb +5 -0
  104. data/test/make_blog.rb +23 -2
  105. metadata +92 -6
  106. data/empty_view/remote/widgets/pages/SUBFILES +0 -1
  107. data/empty_view/themes/standard/widgets/calendar/calendar.lt3 +0 -6
  108. data/empty_view/themes/standard/widgets/pages/SUBFILES +0 -1
  109. data/empty_view/themes/standard/widgets/pages/generated.lt3 +0 -4
@@ -0,0 +1,4 @@
1
+ .include ../local_vars.lt3
2
+ . Material (if any) to go after main data
3
+ </body>
4
+ </html>
@@ -1,12 +1,3 @@
1
1
  .mixin liveblog
2
2
 
3
- .tag_cloud
4
- https://google.com/,btn btn-dark m-1,Programming
5
- https://google.com/,btn btn-danger m-1,Science Fiction
6
- https://google.com/,btn btn-light m-1,Art
7
- https://google.com/,btn btn-dark m-1,Robotics
8
- https://google.com/,btn btn-warning m-1,Food and Travel
9
- https://google.com/,btn btn-light m-1,DIY Hacks
10
- https://google.com/,btn btn-info m-1,Surfing
11
- .end
12
-
3
+ <h3>Currently nothing here -- not implemented</h3)
@@ -0,0 +1,14 @@
1
+ # Custom code for 'tag-cloud' widget
2
+
3
+ class ::RuneBlog::Widget
4
+ class TagCloud
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
@@ -40,7 +40,9 @@ module RuneBlog::REPL
40
40
  "list assets" => :cmd_list_assets,
41
41
  "lsa" => :cmd_list_assets,
42
42
 
43
- "delete >postid" => :cmd_remove_post,
43
+ "pages" => :cmd_pages,
44
+
45
+ "delete >postid" => :cmd_remove_post,
44
46
  "undel $postid" => :cmd_undelete_post,
45
47
 
46
48
  "edit $postid" => :cmd_edit_post,
@@ -103,7 +105,7 @@ module RuneBlog::REPL
103
105
  end
104
106
  meth = found || :cmd_INVALID
105
107
  params = cmd if meth == :cmd_INVALID
106
- puts "choose: #{[meth, params].inspect}"
108
+ # puts "choose: #{[meth, params].inspect}"
107
109
  [meth, params]
108
110
  end
109
111
 
@@ -45,7 +45,7 @@ def dropcap
45
45
  p:first-child:first-letter {
46
46
  color: #0000ff;
47
47
  float: left;
48
- font-family: Georgia;
48
+ font-family: Verdana;
49
49
  font-size: 75px;
50
50
  line-height: 60px;
51
51
  padding-top: 4px;
@@ -142,7 +142,7 @@ def inset
142
142
  end
143
143
  lr = _args.first
144
144
  wide = _args[1] || "25"
145
- _passthru "<div style='float:#{lr}; width: #{wide}%; padding:8px; padding-right:12px; font-family:verdana'>"
145
+ _passthru "<div style='float:#{lr}; width: #{wide}%; padding:8px; padding-right:12px'>" # ; font-family:verdana'>"
146
146
  _passthru '<b><i>'
147
147
  _passthru box
148
148
  _passthru_noline '</i></b></div>'
@@ -319,6 +319,29 @@ def recent_posts # side-effect
319
319
  HTML
320
320
  end
321
321
 
322
+ def _make_class_name(app)
323
+ if app =~ /[-_]/
324
+ words = app.split(/[-_]/)
325
+ name = words.map(&:capitalize).join
326
+ else
327
+ name = app.capitalize
328
+ end
329
+ return name
330
+ end
331
+
332
+ def _load_local(widget)
333
+ Dir.chdir("widgets/#{widget}") do
334
+ rclass = _make_class_name(widget)
335
+ found = (require("./#{widget}") if File.exist?("#{widget}.rb"))
336
+ code = found ? ::RuneBlog::Widget.class_eval(rclass) : nil
337
+ code
338
+ end
339
+ rescue => err
340
+ STDOUT.puts err
341
+ STDOUT.puts err.backtrace.join("\n")
342
+ exit
343
+ end
344
+
322
345
  def sidebar
323
346
  if _args.include? "off"
324
347
  _body { } # iterate, do nothing
@@ -331,17 +354,25 @@ def sidebar
331
354
  wtag = :widgets/tag
332
355
  raise "Can't find #{wtag}" unless Dir.exist?(wtag)
333
356
  tcard = "#{tag}-card.html"
334
- if File.exist?(wtag/"SUBFILES")
335
- children = Dir[wtag/"*.lt3"] - [wtag/tag+".lt3"]
336
- children.each do |child|
337
- dest = child.sub(/.lt3$/, ".html")
338
- xlate src: child, dst: dest # , debug: true
339
- end
340
- end
357
+
358
+ code = _load_local(tag)
359
+ code && Dir.chdir(wtag) { code.build }
360
+
361
+ # if File.exist?(wtag/"SUBFILES")
362
+ # children = Dir[wtag/"*.lt3"] - [wtag/tag+".lt3"]
363
+ # children.each do |child|
364
+ # dest = child.sub(/.lt3$/, ".html")
365
+ # xlate src: child, dst: dest # , debug: true
366
+ # end
367
+ # end
341
368
  xlate cwd: wtag, src: tag, dst: tcard # , debug: true
342
369
  _include_file wtag/tcard
343
370
  end
344
371
  _out %[</div>]
372
+ rescue => err
373
+ puts "err = #{err}"
374
+ puts err.backtrace.join("\n")
375
+ exit
345
376
  end
346
377
 
347
378
  def stylesheet
@@ -606,12 +637,44 @@ def page_type(tag, title)
606
637
  end
607
638
  end
608
639
 
640
+ def _write_main_pages(mainfile, pairs, card_title, tag)
641
+ local = _local_tag?(tag)
642
+ pieces = @blog.view.dir/"themes/standard/widgets"/tag/:pieces
643
+ main_head = xlate! cwd: pieces, src: "main-head.lt3"
644
+ main_tail = xlate! cwd: pieces, src: "main-tail.lt3"
645
+ # ^ make into methods in pages.rb or whatever?
646
+
647
+ File.open("#{mainfile}.html", "w") do |f|
648
+ f.puts main_head
649
+ pairs.each do |file, title|
650
+ type, title = page_type(tag, title)
651
+ title = title.gsub(/\\/, "") # kludge
652
+ case type
653
+ when :local; url_ref = _widget_main(file, tag) # local always frameable
654
+ when :frame; url_ref = "href = '#{file}'" # local always frameable
655
+ when :noframe; url_ref = _blank(file) # local always frameable
656
+ end
657
+ css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
658
+ f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
659
+ end
660
+ f.puts main_tail
661
+ end
662
+ end
663
+
609
664
  def _write_main(mainfile, pairs, card_title, tag)
610
665
  log!(str: "Creating #{mainfile}.html", pwd: true)
666
+
667
+ if tag == "pages" # temporary experiment
668
+ _write_main_pages(mainfile, pairs, card_title, tag)
669
+ return
670
+ end
671
+
611
672
  local = _local_tag?(tag)
673
+ setvar "card.title", card_title
674
+ css = "* { font-family: verdana }"
612
675
  File.open("#{mainfile}.html", "w") do |f|
613
- _html_body(f) do
614
- f.puts "<h1>#{card_title}</h1>"
676
+ _html_body(f, css) do
677
+ f.puts "<h1>#{card_title}</h1><br><hr>"
615
678
  pairs.each do |file, title|
616
679
  type, title = page_type(tag, title)
617
680
  title = title.gsub(/\\/, "") # kludge
@@ -620,7 +683,7 @@ def _write_main(mainfile, pairs, card_title, tag)
620
683
  when :frame; url_ref = "href = '#{file}'" # local always frameable
621
684
  when :noframe; url_ref = _blank(file) # local always frameable
622
685
  end
623
- css = "color: #8888FF; text-decoration: none; font-size: 24px; font-family: verdana"
686
+ css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
624
687
  f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
625
688
  end
626
689
  end
@@ -10,16 +10,6 @@ class RuneBlog::Publishing
10
10
  def initialize(view)
11
11
  log!(enter: __method__, args: [view.to_s])
12
12
  @blog = RuneBlog.blog
13
- # # Clunky...
14
- # if params.size == 1 && params[0].is_a?(OpenStruct)
15
- # obj = params[0]
16
- # array = obj.to_h.values_at(:user, :server, :docroot,
17
- # :path, :proto)
18
- # @user, @server, @docroot, @path, @proto = *array
19
- # else
20
- # @user, @server, @docroot, @path, @proto = *params
21
- # end
22
- # find a better way?
23
13
  gfile = @blog.root/:views/view/"themes/standard/global.lt3"
24
14
  data = File.readlines(gfile)
25
15
  grab = ->(var) { data.grep(/^#{var} /).first.chomp.split(" ", 2)[1] }
@@ -36,28 +36,40 @@ module RuneBlog::REPL
36
36
  @out
37
37
  end
38
38
 
39
- def cmd_config(arg, testing = false)
39
+ def cmd_pages(arg, testing = false)
40
40
  check_empty(arg)
41
- dir = @blog.view.dir
42
- items = ["themes/standard/blogview.lt3", "themes/standard/post-index.lt3"]
43
- num, fname = STDSCR.menu(title: "Edit file:", items: items)
44
- edit_file("#{dir}/#{fname}")
45
- end
46
-
47
- # Currently not used
48
- def cmd_customize(arg, testing = false)
49
- # add extra views? add tags?
50
- puts "\n This is still buggy.\n "
51
- return
52
-
53
- avail_tags = all_tags
54
- tags = STDSCR.multimenu(items: avail_tags)
55
- @blog.post_tags = tags
56
- end
57
-
58
- def cmd_tags(arg, testing = false)
59
- Dir.chdir(@blog.root + "/views/" + @blog.view.name)
60
- edit_file("tagpool")
41
+ dir = @blog.view.dir/"themes/standard/widgets/pages"
42
+ # Assume child files already generated (and list.data??)
43
+ data = dir/"list.data"
44
+ lines = File.readlines(data)
45
+ hash = {}
46
+ lines.each do |line|
47
+ url, name = line.chomp.split(",")
48
+ source = url.sub(/.html$/, ".lt3")
49
+ hash[name] = source
50
+ end
51
+ new_item = "[New page]"
52
+ num, fname = STDSCR.menu(title: "Edit page:", items: hash.keys + [new_item])
53
+ return if fname.nil?
54
+ if fname == new_item
55
+ print "Page title: "
56
+ title = RubyText.gets
57
+ title.chomp!
58
+ print "File name (.lt3): "
59
+ fname = RubyText.gets
60
+ fname << ".lt3" unless fname.end_with?(".lt3")
61
+ fhtml = fname.sub(/.lt3$/, ".html")
62
+ File.open(data, "a") {|f| f.puts "#{fhtml},#{title}" }
63
+ new_file = dir/fname
64
+ File.open(new_file, "w") do |f|
65
+ f.puts "<h1>#{title}</h1>\n\n\n "
66
+ f.puts ".backlink"
67
+ end
68
+ edit_file(new_file)
69
+ else
70
+ target = hash[fname]
71
+ edit_file(dir/target)
72
+ end
61
73
  end
62
74
 
63
75
  def cmd_import(arg, testing = false)
@@ -143,6 +155,7 @@ module RuneBlog::REPL
143
155
  n = viewnames.find_index(@blog.view.name)
144
156
  name = @blog.view.name
145
157
  k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n) unless testing
158
+ return if name.nil?
146
159
  @blog.view = name
147
160
  output name + "\n"
148
161
  puts "\n ", fx(name, :bold), "\n" unless testing
@@ -60,7 +60,6 @@ class RuneBlog
60
60
  raise BlogRepoAlreadyExists if Dir.exist?(root)
61
61
  create_dirs(root)
62
62
  Dir.chdir(root) do
63
- system!("cp #{RuneBlog::Path}/../empty_view.tgz .")
64
63
  create_dirs(:drafts, :views, :posts)
65
64
  new_sequence
66
65
  end
@@ -218,7 +217,7 @@ class RuneBlog
218
217
 
219
218
  def mark_last_published(str)
220
219
  log!(enter: __method__, args: [str])
221
- dump(str, "last_published")
220
+ dump(str, "#{self.view.dir}/last_published")
222
221
  end
223
222
 
224
223
  def add_view(view_name)
@@ -253,8 +252,8 @@ class RuneBlog
253
252
  log!(enter: __method__, args: [view_name])
254
253
  check_valid_new_view(view_name)
255
254
  make_empty_view_tree(view_name)
256
- mark_last_published("Initial creation")
257
255
  add_view(view_name)
256
+ mark_last_published("Initial creation")
258
257
  end
259
258
 
260
259
  def delete_view(name, force = false)
@@ -394,13 +393,15 @@ class RuneBlog
394
393
 
395
394
  def generate_view(view) # huh?
396
395
  log!(enter: __method__, args: [view])
397
- generate_index(view) # recent posts (recent.html)
396
+ # generate_index(view) # recent posts (recent.html)
398
397
  vdir = @root/:views/view
399
398
  @theme = @root/:views/view/:themes/:standard
400
399
  xlate cwd: vdir/"themes/standard/etc",
401
400
  src: "blog.css.lt3", copy: vdir/"remote/etc/blog.css" # , debug: true
402
401
  xlate cwd: vdir/"themes/standard",
403
402
  src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
403
+ generate_index(view) # recent posts (recent.html)
404
+ # ^ HERE
404
405
  copy("#{vdir}/assets/*", "#{vdir}/remote/assets/")
405
406
  rescue => err
406
407
  puts err
@@ -455,8 +456,8 @@ class RuneBlog
455
456
  rem = w.sub(/themes.standard/, "remote")
456
457
  create_dirs(rem)
457
458
  files = Dir[w/"*"]
458
- next unless files.any? {|x| x =~ /html$/ }
459
- system!("cp #{w}/*html #{rem}")
459
+ files = files.select {|x| x =~ /(html|css)$/ }
460
+ files.each {|file| system!("cp #{file} #{rem}") }
460
461
  end
461
462
  end
462
463
 
@@ -494,7 +495,8 @@ class RuneBlog
494
495
  views = _get_views(draft)
495
496
  views.each do |view|
496
497
  _handle_post(draft, view)
497
- generate_view(view) # FIXME leads to inefficiency?
498
+ # generate_view(view) # FIXME leads to inefficiency?
499
+ # ^ HERE
498
500
  end
499
501
  end
500
502
 
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.2.35"
5
+ VERSION = "0.2.40"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -61,7 +61,7 @@ class RuneBlog::View
61
61
 
62
62
  def recent?(file)
63
63
  log!(enter: __method__, args: [file])
64
- File.mtime(file) > File.mtime("#{dir()}/last_published")
64
+ File.mtime(file) > File.mtime("#{self.dir()}/last_published")
65
65
  rescue
66
66
  true
67
67
  end
@@ -35,3 +35,8 @@ LEXT = ".lt3"
35
35
  end
36
36
  end
37
37
 
38
+ def xlate!(cwd: Dir.pwd, src:, copy: nil, debug: false, force: false)
39
+ output = "/tmp/xlate-#{File.basename(src).sub(/.lt3$/, "")}"
40
+ xlate cwd: cwd, src: src, dst: output, debug: debug, force: force
41
+ File.read(output + ".html") # return all content as string
42
+ end
@@ -22,9 +22,9 @@ def debug(str = "")
22
22
  t = Time.now
23
23
  time = t.to_f.to_s
24
24
  n = time.index(".")
25
- msec = time[n..-1]
25
+ msec = time[n..(n+2)]
26
26
  time = t.strftime("%H:%M:%S") + msec
27
- STDERR.puts "#{'%-16s' % time} #{str}"
27
+ STDERR.puts "#{'%-11s' % time} #{str}"
28
28
  end
29
29
 
30
30
  def make_post(x, title, teaser, body, views=[])
@@ -46,6 +46,8 @@ end
46
46
 
47
47
  # "Main"...
48
48
 
49
+ t0 = Time.now
50
+
49
51
  puts bold("\nGenerating test blog...")
50
52
 
51
53
  system("rm -rf .blogs")
@@ -55,6 +57,19 @@ x = RuneBlog.new(".blogs")
55
57
  debug("create_view: #{bold('around_austin')}")
56
58
  x.create_view("around_austin") # FIXME remember view title!
57
59
 
60
+ #### FIXME later!!
61
+ vars = <<-VARS
62
+
63
+ .variables
64
+ blog Around Austin
65
+ blog.desc The view from downtown...
66
+ .end
67
+ VARS
68
+ File.open(".blogs/views/around_austin/themes/standard/global.lt3", "a") do |f|
69
+ f.puts vars
70
+ end
71
+ ####
72
+
58
73
  debug("create_view: #{bold('computing')}")
59
74
  x.create_view("computing")
60
75
 
@@ -170,6 +185,12 @@ debug
170
185
  debug("** generate_view: #{bold('around_austin')}")
171
186
  x.generate_view("around_austin")
172
187
  x.change_view("around_austin")
188
+ debug
173
189
 
174
190
  puts bold("...finished.\n")
175
191
 
192
+ t1 = Time.now
193
+
194
+ elapsed = t1 - t0
195
+ puts "\nElapsed: #{'%3.2f' % elapsed} secs\n "
196
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.35
4
+ version: 0.2.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-13 00:00:00.000000000 Z
11
+ date: 2019-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -61,10 +61,14 @@ files:
61
61
  - "./README.md"
62
62
  - "./runeblog.gemspec"
63
63
  - bin/blog
64
+ - bin/mkwidget
64
65
  - empty_view/assets/sky2.jpg
66
+ - empty_view/remote/assets/GIT_IS_DUMB
67
+ - empty_view/remote/etc/GIT_IS_DUMB
68
+ - empty_view/remote/navbar/GIT_IS_DUMB
69
+ - empty_view/remote/permalink/GIT_IS_DUMB
65
70
  - empty_view/remote/widgets/links/list.data
66
71
  - empty_view/remote/widgets/news/list.data
67
- - empty_view/remote/widgets/pages/SUBFILES
68
72
  - empty_view/remote/widgets/pages/list.data
69
73
  - empty_view/themes/standard/README
70
74
  - empty_view/themes/standard/blog/generate.lt3
@@ -85,21 +89,103 @@ files:
85
89
  - empty_view/themes/standard/post/permalink.lt3
86
90
  - empty_view/themes/standard/widgets/README
87
91
  - empty_view/themes/standard/widgets/ad/ad.lt3
88
- - empty_view/themes/standard/widgets/calendar/calendar.lt3
92
+ - empty_view/themes/standard/widgets/bydates/README
93
+ - empty_view/themes/standard/widgets/bydates/bydates.lt3
94
+ - empty_view/themes/standard/widgets/bydates/bydates.rb
95
+ - empty_view/themes/standard/widgets/bydates/card.css
96
+ - empty_view/themes/standard/widgets/bydates/custom.rb
97
+ - empty_view/themes/standard/widgets/bydates/local-vars.lt3
98
+ - empty_view/themes/standard/widgets/bydates/main.css
99
+ - empty_view/themes/standard/widgets/bydates/pieces/card-head.lt3
100
+ - empty_view/themes/standard/widgets/bydates/pieces/card-tail.lt3
101
+ - empty_view/themes/standard/widgets/bydates/pieces/main-head.lt3
102
+ - empty_view/themes/standard/widgets/bydates/pieces/main-tail.lt3
103
+ - empty_view/themes/standard/widgets/links/README
104
+ - empty_view/themes/standard/widgets/links/card.css
105
+ - empty_view/themes/standard/widgets/links/custom.rb
89
106
  - empty_view/themes/standard/widgets/links/links.lt3
107
+ - empty_view/themes/standard/widgets/links/links.rb
90
108
  - empty_view/themes/standard/widgets/links/list.data
109
+ - empty_view/themes/standard/widgets/links/local-vars.lt3
110
+ - empty_view/themes/standard/widgets/links/main.css
111
+ - empty_view/themes/standard/widgets/links/pieces/card-head.lt3
112
+ - empty_view/themes/standard/widgets/links/pieces/card-tail.lt3
113
+ - empty_view/themes/standard/widgets/links/pieces/main-head.lt3
114
+ - empty_view/themes/standard/widgets/links/pieces/main-tail.lt3
115
+ - empty_view/themes/standard/widgets/news/README
116
+ - empty_view/themes/standard/widgets/news/card.css
117
+ - empty_view/themes/standard/widgets/news/custom.rb
91
118
  - empty_view/themes/standard/widgets/news/list.data
119
+ - empty_view/themes/standard/widgets/news/local-vars.lt3
120
+ - empty_view/themes/standard/widgets/news/main.css
92
121
  - empty_view/themes/standard/widgets/news/news.lt3
122
+ - empty_view/themes/standard/widgets/news/news.rb
123
+ - empty_view/themes/standard/widgets/news/pieces/card-head.lt3
124
+ - empty_view/themes/standard/widgets/news/pieces/card-tail.lt3
125
+ - empty_view/themes/standard/widgets/news/pieces/main-head.lt3
126
+ - empty_view/themes/standard/widgets/news/pieces/main-tail.lt3
93
127
  - empty_view/themes/standard/widgets/pages/README
94
- - empty_view/themes/standard/widgets/pages/SUBFILES
128
+ - empty_view/themes/standard/widgets/pages/card.css
129
+ - empty_view/themes/standard/widgets/pages/custom.rb
95
130
  - empty_view/themes/standard/widgets/pages/disclaim.lt3
96
131
  - empty_view/themes/standard/widgets/pages/faq.lt3
97
- - empty_view/themes/standard/widgets/pages/generated.lt3
98
132
  - empty_view/themes/standard/widgets/pages/like-dislike.lt3
99
133
  - empty_view/themes/standard/widgets/pages/list.data
134
+ - empty_view/themes/standard/widgets/pages/local-vars.lt3
135
+ - empty_view/themes/standard/widgets/pages/local.rb
136
+ - empty_view/themes/standard/widgets/pages/main.css
100
137
  - empty_view/themes/standard/widgets/pages/other-stuff.lt3
101
138
  - empty_view/themes/standard/widgets/pages/pages.lt3
139
+ - empty_view/themes/standard/widgets/pages/pages.rb
140
+ - empty_view/themes/standard/widgets/pages/pieces/card-head.lt3
141
+ - empty_view/themes/standard/widgets/pages/pieces/card-tail.lt3
142
+ - empty_view/themes/standard/widgets/pages/pieces/main-head.lt3
143
+ - empty_view/themes/standard/widgets/pages/pieces/main-tail.lt3
144
+ - empty_view/themes/standard/widgets/pinned/README
145
+ - empty_view/themes/standard/widgets/pinned/card.css
146
+ - empty_view/themes/standard/widgets/pinned/custom.rb
147
+ - empty_view/themes/standard/widgets/pinned/local-vars.lt3
148
+ - empty_view/themes/standard/widgets/pinned/main.css
149
+ - empty_view/themes/standard/widgets/pinned/pieces/card-head.lt3
150
+ - empty_view/themes/standard/widgets/pinned/pieces/card-tail.lt3
151
+ - empty_view/themes/standard/widgets/pinned/pieces/main-head.lt3
152
+ - empty_view/themes/standard/widgets/pinned/pieces/main-tail.lt3
153
+ - empty_view/themes/standard/widgets/pinned/pinned.lt3
154
+ - empty_view/themes/standard/widgets/pinned/pinned.rb
155
+ - empty_view/themes/standard/widgets/search/README
156
+ - empty_view/themes/standard/widgets/search/card.css
157
+ - empty_view/themes/standard/widgets/search/custom.rb
158
+ - empty_view/themes/standard/widgets/search/local-vars.lt3
159
+ - empty_view/themes/standard/widgets/search/main.css
160
+ - empty_view/themes/standard/widgets/search/pieces/card-head.lt3
161
+ - empty_view/themes/standard/widgets/search/pieces/card-tail.lt3
162
+ - empty_view/themes/standard/widgets/search/pieces/main-head.lt3
163
+ - empty_view/themes/standard/widgets/search/pieces/main-tail.lt3
164
+ - empty_view/themes/standard/widgets/search/search.lt3
165
+ - empty_view/themes/standard/widgets/search/search.rb
166
+ - empty_view/themes/standard/widgets/sitemap/README
167
+ - empty_view/themes/standard/widgets/sitemap/card.css
168
+ - empty_view/themes/standard/widgets/sitemap/custom.rb
169
+ - empty_view/themes/standard/widgets/sitemap/local-vars.lt3
170
+ - empty_view/themes/standard/widgets/sitemap/main.css
171
+ - empty_view/themes/standard/widgets/sitemap/pieces/card-head.lt3
172
+ - empty_view/themes/standard/widgets/sitemap/pieces/card-tail.lt3
173
+ - empty_view/themes/standard/widgets/sitemap/pieces/main-head.lt3
174
+ - empty_view/themes/standard/widgets/sitemap/pieces/main-tail.lt3
175
+ - empty_view/themes/standard/widgets/sitemap/sitemap.lt3
176
+ - empty_view/themes/standard/widgets/sitemap/sitemap.rb
177
+ - empty_view/themes/standard/widgets/tag-cloud/OLD-example.lt3
178
+ - empty_view/themes/standard/widgets/tag-cloud/README
179
+ - empty_view/themes/standard/widgets/tag-cloud/card.css
180
+ - empty_view/themes/standard/widgets/tag-cloud/custom.rb
181
+ - empty_view/themes/standard/widgets/tag-cloud/local-vars.lt3
182
+ - empty_view/themes/standard/widgets/tag-cloud/main.css
183
+ - empty_view/themes/standard/widgets/tag-cloud/pieces/card-head.lt3
184
+ - empty_view/themes/standard/widgets/tag-cloud/pieces/card-tail.lt3
185
+ - empty_view/themes/standard/widgets/tag-cloud/pieces/main-head.lt3
186
+ - empty_view/themes/standard/widgets/tag-cloud/pieces/main-tail.lt3
102
187
  - empty_view/themes/standard/widgets/tag-cloud/tag-cloud.lt3
188
+ - empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb
103
189
  - lib/Javascript.stuff
104
190
  - lib/default.rb
105
191
  - lib/global.rb