runeblog 0.2.48 → 0.2.49

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4bd7b67f736b85651eb0650c5af974cbcf74fce48be345920e9bac4c9dba9dd
4
- data.tar.gz: 5fda0c05a32e16103e7f7f31b7ffe104c307b63c2e14e96216644dfbc6fdefff
3
+ metadata.gz: 148dacf82516a20ba94f7ddf83e3160d717aacf156a88b23187bc5e891a80542
4
+ data.tar.gz: 296c90e497e7efb780fb73c91caff732626bfbeb8f3400c866bdf156688ed059
5
5
  SHA512:
6
- metadata.gz: 55b9141f9b2d0d7a06cb5134d1e1da871cd78c2dffa7502310d0ae0caedec7c27eabfa28dc7957754f611122283abc2bc833512e58f9414a541b87d8cf4e146f
7
- data.tar.gz: 60b1546750066d75a623a3ca7866b5f5307b31e14a806a85f726fe87507ab1c3d24c5ce7737742ffdb3e41fb7cbcb0eac244089c9f96efddc6534299e9ab9ef1
6
+ metadata.gz: 58fca96171e5fd86d3c6fd207a481c6e957dcd6b777dbec7f7b9f588bed9a6a71c5ceee01ba78bffec3b4acb722df8f597dc397f1153f0517f7d5f9b205e154d
7
+ data.tar.gz: 3d46a5f3720342d13e8b9d4665a40f92fb4f70418449dccbd71efdc3e2f96dc64785a6ae1b6d82adbe4022492eb23678c5aea15a4d88de900ef18cce0a9da737
@@ -0,0 +1,18 @@
1
+ . --------------------------------------------------
2
+ . This is a sample file typical of page referenced
3
+ . directly from the navigation bar.
4
+ . It is like a special case of a page in the "pages"
5
+ . widget.
6
+ . --------------------------------------------------
7
+
8
+ .set this.title="About me"
9
+ . make this better later
10
+ <html><body>
11
+ <div class="content container-fluid mt-4">
12
+ <div class="row">
13
+ <h1>$this.title</h1>
14
+ . content starts here...
15
+ Blah blah blah...
16
+ </div>
17
+ </div>
18
+ </body></html>
@@ -0,0 +1,18 @@
1
+ . --------------------------------------------------
2
+ . This is a sample file typical of page referenced
3
+ . directly from the navigation bar.
4
+ . It is like a special case of a page in the "pages"
5
+ . widget.
6
+ . --------------------------------------------------
7
+
8
+ .set this.title="Contact"
9
+ . make this better later
10
+ <html><body>
11
+ <div class="content container-fluid mt-4">
12
+ <div class="row">
13
+ <h1>$this.title</h1>
14
+ . content starts here...
15
+ How to contact me by email, smoke signals, ICBM, seance, ...
16
+ </div>
17
+ </div>
18
+ </body></html>
@@ -0,0 +1 @@
1
+ .include ../widgets/pages/faq.lt3
@@ -0,0 +1,17 @@
1
+ . --------------------------------------------------
2
+ . This defines the content of the navigation bar.
3
+ . The first one is a special case.
4
+ . The others are understood to refer to .lt3 files
5
+ . such as navbar/about.lt3 (which is processed into
6
+ . HTML).
7
+ . The title may be more than one word. Quotes are
8
+ . not needed.
9
+ . --------------------------------------------------
10
+
11
+ .navbar2
12
+ index Home
13
+ about About
14
+ contact Contact
15
+ faq FAQ
16
+ .end
17
+
@@ -30,6 +30,7 @@ module RuneBlog::REPL
30
30
  "cv" => :cmd_change_view, # 0-arity must come second
31
31
 
32
32
  "config" => :cmd_config,
33
+ "manage" => :cmd_manage,
33
34
 
34
35
  "list posts" => :cmd_list_posts,
35
36
  "lsp" => :cmd_list_posts,
@@ -64,10 +64,52 @@ def post_trailer
64
64
  # damned syntax highlighting
65
65
  end
66
66
 
67
+ def faq
68
+ @faq_count ||= 0
69
+ @faq_count += 1
70
+ ques = _data.chomp
71
+ ans = _body_text
72
+ id = "faq#@faq_count"
73
+ _out %[&nbsp;<a class="btn btn-default btn-xs" data-toggle="collapse" href="##{id}" role="button" aria-expanded="false" aria-controls="collapseExample">+</a>]
74
+ _out %[&nbsp;<b>#{ques}</b>]
75
+ _out %[<div class="collapse" id="#{id}"><br><font size=+1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#{ans}</font></div><br><br>\n]
76
+ _optional_blank_line
77
+ end
78
+
67
79
  def backlink
68
80
  _out %[<br><a href="javascript:history.go(-1)">[Back]</a>]
69
81
  end
70
82
 
83
+ def banner # still experimental
84
+ _out "<table>"
85
+ _body do |line|
86
+ pieces = line.split
87
+ cols = pieces.size
88
+ span = cols == 2 ? 1 : 2 # whaaat?
89
+ _out " <tr>"
90
+ pieces.each do |piece|
91
+ _out " <td colspan=#{span}>"
92
+ case
93
+ when piece.start_with?("hnav")
94
+ _out "<center>hnav1 hnav2 hnav3 hnav4</center>"
95
+ when piece.start_with?("vnav")
96
+ _out "vnav1<br>vnav2<br>vnav3<br>vnav4<br>"
97
+ when piece.start_with?("text")
98
+ file = piece.split(":")[1]
99
+ _out File.read(file)
100
+ when piece.start_with?("image")
101
+ file = piece.split(":")[1]
102
+ _out " <img src=#{file} height=100></img>"
103
+ else
104
+ _out " '#{piece}' isn't known"
105
+ end
106
+ _out " </td>"
107
+ end
108
+ _out " </tr>"
109
+ end
110
+ _out "</table>"
111
+ end
112
+
71
113
  def quote
72
114
  _passthru "<blockquote>"
73
115
  _passthru _body.join(" ")
@@ -556,6 +598,42 @@ def tag_cloud
556
598
  _out close
557
599
  end
558
600
 
601
+ def vnavbar
602
+ end
603
+
604
+ def navbar2
605
+ vdir = @blog.view.dir
606
+ title = _var(:blog)
607
+
608
+ open = <<-HTML
609
+ <nav class="navbar navbar-light bg-light">
610
+ <a class="navbar-brand" href="index.html">#{title}</a>
611
+ <ul class="navbar-nav mr-auto">
612
+ HTML
613
+ close = <<-HTML
614
+ </ul>
615
+ </div>
616
+ </nav>
617
+ HTML
618
+
619
+ first = true
620
+ _out open
621
+ lines = _body
622
+ lines.each do |line|
623
+ basename, cdata = line.chomp.strip.split(" ", 2)
624
+ full = :navbar/basename+".html"
625
+ href_main = _main(full)
626
+ if first
627
+ first = false # hardcode this part??
628
+ _out %[<li class="nav-item active"> <a class="nav-link" href="index.html">#{cdata}<span class="sr-only">(current)</span></a> </li>]
629
+ else
630
+ xlate cwd: "navbar", src: basename, dst: vdir/"remote/navbar"/basename+".html" # , debug: true
631
+ _out %[<li class="nav-item"> <a class="nav-link" #{href_main}>#{cdata}</a> </li>]
632
+ end
633
+ end
634
+ _out close
635
+ end
636
+
559
637
  def navbar
560
638
  vdir = @blog.view.dir
561
639
  title = _var(:blog)
@@ -37,7 +37,78 @@ module RuneBlog::REPL
37
37
  @out
38
38
  end
39
39
 
40
- def cmd_pages(arg, testing = false)
40
+ def cmd_config(arg, testing = false)
41
+ list = ["global.lt3", "blog/generate.lt3", " head.lt3", " index.lt3",
42
+ " post_entry.lt3", "etc/blog.css.lt3", " externals.lt3",
43
+ "post/generate.lt3", " head.lt3", " index.lt3",
44
+ " permalink.lt3"]
45
+ name = ["global.lt3", "blog/generate.lt3", "blog/head.lt3", "blog/index.lt3",
46
+ "blog/post_entry.lt3", "etc/blog.css.lt3", "blog/externals.lt3",
47
+ "post/generate.lt3", "post/head.lt3", "post/index.lt3",
48
+ "post/permalink.lt3"]
49
+ dir = @blog.view.dir/"themes/standard/"
50
+ num, str = STDSCR.menu(title: "Edit file:", items: list)
51
+ target = name[num]
52
+ edit_file(dir/target)
53
+ end
54
+
55
+ def cmd_manage(arg, testing = false)
56
+ puts "Arg = #{arg.inspect}"
57
+ case arg
58
+ when "pages"; _manage_pages(arg, testing = false)
59
+ when "links"; _manage_links(arg, testing = false)
60
+ when "navbar"; _manage_navbar(arg, testing = false)
61
+ # when "pinned"; _manage_pinned(arg, testing = false) # ditch this??
62
+ else
63
+ puts "#{arg} is unknown"
64
+ end
65
+ end
66
+
67
+ def _manage_pinned(arg, testing = false) # cloned from manage_links
68
+ check_empty(arg)
69
+ dir = @blog.view.dir/"themes/standard/widgets/pinned"
70
+ data = dir/"list.data"
71
+ edit_file(data)
72
+ end
73
+
74
+ def _manage_navbar(arg, testing = false) # cloned from manage_pages
75
+ puts "Got to #{__method__}"
76
+ check_empty(arg)
77
+ dir = @blog.view.dir/"themes/standard/navbar"
78
+ files = Dir.entries(dir) - %w[. .. navbar.lt3]
79
+ new_item = " [New item] "
80
+ main_file = "[ navbar.lt3 ]"
81
+ files = [main_file] + files + [new_item]
82
+ num, fname = STDSCR.menu(title: "Edit navbar:", items: files)
83
+ return if fname.nil?
84
+ case fname
85
+ when new_item
86
+ print "Page title: "
87
+ title = RubyText.gets
88
+ title.chomp!
89
+ print "File name (.lt3): "
90
+ fname = RubyText.gets
91
+ fname << ".lt3" unless fname.end_with?(".lt3")
92
+ new_file = dir/fname
93
+ File.open(new_file, "w") do |f|
94
+ f.puts "<h1>#{title}</h1>\n\n\n "
95
+ f.puts ".backlink"
96
+ end
97
+ edit_file(new_file)
98
+ when main_file
99
+ edit_file(main_file[2..-3])
100
+ else
101
+ edit_file(dir/fname)
102
+ end
103
+ end
104
+
105
+ def _manage_links(arg, testing = false)
106
+ dir = @blog.view.dir/"themes/standard/widgets/links"
107
+ data = dir/"list.data"
108
+ edit_file(data)
109
+ end
110
+
111
+ def _manage_pages(arg, testing = false)
41
112
  check_empty(arg)
42
113
  dir = @blog.view.dir/"themes/standard/widgets/pages"
43
114
  # Assume child files already generated (and list.data??)
@@ -393,7 +464,7 @@ module RuneBlog::REPL
393
464
  list views List all views available
394
465
  lsv Same as: list views
395
466
 
396
- * config Edit the publish file or the templates
467
+ config Edit various system files
397
468
  * customize (BUGGY) Change set of tags, extra views
398
469
 
399
470
  p, post Create a new post
@@ -438,7 +438,7 @@ class RuneBlog
438
438
  @theme = @root/:views/view/:themes/:standard
439
439
  xlate cwd: vdir/"themes/standard/etc",
440
440
  src: "blog.css.lt3", copy: vdir/"remote/etc/blog.css" # , debug: true
441
- xlate cwd: vdir/"themes/standard",
441
+ xlate cwd: vdir/"themes/standard", force: true,
442
442
  src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
443
443
  copy("#{vdir}/assets/*", "#{vdir}/remote/assets/")
444
444
  rescue => err
@@ -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.48"
5
+ VERSION = "0.2.49"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
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.48
4
+ version: 0.2.49
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-20 00:00:00.000000000 Z
11
+ date: 2019-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -69,6 +69,11 @@ files:
69
69
  - empty_view/remote/navbar/GIT_IS_DUMB
70
70
  - empty_view/remote/permalink/GIT_IS_DUMB
71
71
  - empty_view/themes/standard/README
72
+ - empty_view/themes/standard/banner/about.lt3
73
+ - empty_view/themes/standard/banner/blog-banner.jpg
74
+ - empty_view/themes/standard/banner/contact.lt3
75
+ - empty_view/themes/standard/banner/faq.lt3
76
+ - empty_view/themes/standard/banner/navbar.lt3
72
77
  - empty_view/themes/standard/blog/generate.lt3
73
78
  - empty_view/themes/standard/blog/head.lt3
74
79
  - empty_view/themes/standard/blog/index.lt3