runeblog 0.2.82 → 0.2.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf0392a5b2be6bcfaf114bedc0840674a9c7d2908015409ea79eef9908b0d624
4
- data.tar.gz: 494acd91ce701943026f595ac91f8db9559b918a6831935d14e1fa3439bbe19c
3
+ metadata.gz: bc20c73da7ee238b37adbc948c5e883f1e5f0b9b8c7f7add232c31dfbc2e3bd3
4
+ data.tar.gz: 294b35d978b4ff2859f1073d460a3f61947284b659a041037f43f319cb38c4c8
5
5
  SHA512:
6
- metadata.gz: f69efa439801300a96ffe32b9d0f78abd36ea641e22b39f78102f3fc123bc2150cd600fc8818708f3ca3228907c0d618483a7822cd16acfb98f5fb999d67a4ac
7
- data.tar.gz: da42919ea67d3393036663a3178f2223d7ad9aec800a78c13fc536d7f871d6e5a834233e94bd001ed9519d61302dd900e3847689530e322c05df00d54ebfd3a5
6
+ metadata.gz: 2b8b9925f49e63203942d6c325960c7774c0ad96671e065e279b880cee8d80ff60c215488e9e403c3657ec9b4e2d89efc8f4e5052d0bffe9ff887dcd67556bd3
7
+ data.tar.gz: 5b44950c664496a2032010c1e50da51a6091cf1d689ed1f49536ecb54c1586f4046de94bc9a5d1ae12fca675c3ba0969208f6c42cc93cd0dc0750c5687bdc205
data/bin/blog CHANGED
@@ -9,32 +9,31 @@ require 'repl'
9
9
 
10
10
  include RuneBlog::REPL
11
11
 
12
- def yesno(question)
12
+ def yesno(question, noskip=false)
13
13
  puts fx("\n #{question}", :bold)
14
+ puts unless noskip
14
15
  r, c = STDSCR.rc
15
- num, str = STDSCR.menu(r: r+1, c: c+6, items: ["yes", "no"])
16
+ num, str = STDSCR.menu(r: r, c: c+6, items: ["yes", "no"])
16
17
  num == 0
17
18
  end
18
19
 
19
20
  def pick_editor
20
21
  choices = %w[vim emacs vi nano]
21
22
  r, c = STDSCR.rc
22
- num, name = STDSCR.menu(r: r+1, c: c+6, title: "Default editor", items: choices)
23
+ num, name = STDSCR.menu(r: r, c: c+6, title: "Default editor", items: choices)
23
24
  file = `which #{name}`.chomp
24
25
  end
25
26
 
26
27
  def get_started
27
- puts
28
- puts fx("\n Blog repo successfully created.", :bold)
29
-
30
28
  if yesno("Do you want to qo a quick setup?")
31
- puts "\n First choose your editor."
29
+ puts "\n First choose your editor."
32
30
  @blog.editor = pick_editor
33
31
  File.write("#{@blog.root}/data/EDITOR", @blog.editor)
34
32
 
35
33
  if yesno("Edit settings now?")
36
34
  fname = "#{@blog.root}/data/universal.lt3"
37
- edit_file(fname)
35
+ vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(AUTHOR.*\|SITE.*\)"'
36
+ edit_file(fname, vim: vim_params)
38
37
  end
39
38
  # Now create a custom global.lt3
40
39
  @blog._generate_global
@@ -142,19 +141,21 @@ home = ENV['HOME']
142
141
 
143
142
  RubyText.start(:_echo, :keypad, scroll: true, log: "binblog.txt", fg: @fg, bg: @bg)
144
143
 
145
- if RuneBlog.exist?
146
- @blog = RuneBlog.new
147
- else
148
- if yesno("No blog repo found. Create new one?")
149
- RuneBlog.create_new_blog_repo
150
- @blog = RuneBlog.new
151
- @blog.root = ".blogs" # So far, always using default... hmm
152
- get_started
153
- else
154
- exit
155
- end
144
+
145
+ new_repo = false
146
+ if ! RuneBlog.exist?
147
+ exit unless yesno("No blog repo found. Create new one?")
148
+ RuneBlog.create_new_blog_repo
149
+ puts fx(" Blog repo successfully created.", :bold)
150
+ new_repo = true
156
151
  end
157
152
 
153
+ @blog = RuneBlog.new
154
+ get_started if new_repo
155
+
156
+ print fx(" For help", :bold)
157
+ puts " type h or help.\n "
158
+
158
159
  puts fx("\n RuneBlog", :bold), fx(" v #{RuneBlog::VERSION}\n", Red)
159
160
 
160
161
  @cmdhist = []
@@ -10,11 +10,11 @@ blog.desc VIEW_SUBTITLE
10
10
  site SITE
11
11
 
12
12
  host http://SITE
13
- charset CHARSET
13
+ charset utf-8
14
14
  url http://SITE
15
- locale LOCALE
15
+ locale en_US
16
16
 
17
- font.family FONT
17
+ font.family verdana
18
18
 
19
19
  post.title.color #010101
20
20
  post.title.size 28px
@@ -9,14 +9,13 @@
9
9
 
10
10
  .variables
11
11
  . Identity
12
- author Your name here
13
- site rubyhacker.com
12
+ author AUTHOR
13
+ site SITE_DOMAIN
14
14
 
15
15
  . Style
16
- font.family verdana
16
+ font.family verdana
17
17
 
18
18
  . Details
19
- charset utf-8
20
- locale en_US
21
-
19
+ charset utf-8
20
+ locale en_US
22
21
  .end
@@ -1,4 +1,18 @@
1
- <div style="text-align: center; color: white; background: #101035">
2
- <h1>Around Austin</h1><br>
3
- The view from downtown...
4
- </div>
1
+ <svg width="95%" height="55"
2
+ viewBox="0 0 95% 55">
3
+ <defs>
4
+ <linearGradient id="grad1" x1="100%" y1="100%" x2="0%" y2="100%">
5
+ <stop offset="0%" style="stop-color:rgb(198,198,228);stop-opacity:1" />
6
+ <stop offset="100%" style="stop-color:rgb(30,30,50);stop-opacity:1" />
7
+ </linearGradient>
8
+ </defs>
9
+ <style>
10
+ .small { font: 13px sans-serif; fill: #98baff }
11
+ .heavy { font: bold 35px sans-serif; fill: #76a9ff }
12
+ </style>
13
+
14
+ <rect x="0" y="0" rx="3" ry="3" width="95%" height="55" fill="url(#grad1)"/>
15
+
16
+ <text x="5" y="33" class=heavy>$blog</text>
17
+ <text x="5" y="48" class=small>$blog.desc</text>
18
+ </svg>
@@ -1,8 +1,7 @@
1
1
  .banner
2
2
  height 100
3
- bgcolor 101035
4
- svg_title bgcolor: #b08080 size: 29px xy: 75,50 align: center size2: 15px xy2: 75,70 align2: center
5
- image austin-pano.jpg
3
+ bgcolor 101035
4
+ text top.html
6
5
  break
7
6
  navbar
8
7
  .end
@@ -7,13 +7,13 @@
7
7
  <div class="post">
8
8
  <table width=100% cellpadding=7>
9
9
  <tr>
10
- <td width=14% valign=top align=right style="margin-top: -1px;">
10
+ <td width=16% valign=top align=right style="margin-top: -1px;">
11
11
  <font size=-1>#{date}</font>
12
12
  </td>
13
13
  <td>
14
14
  <span class="post-title-text"><a href="#{url}" style="margin-top: -5px">#{title}</a></span>
15
15
  <b>#{teaser_text}</b>&nbsp;&nbsp;
16
- <a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a>
16
+ <a style="text-decoration: none" href="#{url}"><small>Keep&nbsp;reading</small></a>
17
17
  </td>
18
18
  </tr>
19
19
  </table>
@@ -6,10 +6,11 @@
6
6
 
7
7
  .seek themes/standard/global.lt3
8
8
 
9
- * { font-family: $font.family }
9
+ body { font-family: $font.family }
10
10
 
11
11
  \.post-title a {
12
12
  color: $post.title.color;
13
+ font-family: $font.family;
13
14
  font-size: $post.title.size;
14
15
  float: right;
15
16
  display: inline-block;
@@ -23,6 +24,7 @@
23
24
 
24
25
  \.post-title-text a {
25
26
  color: $post.text.color;
27
+ font-family: $font.family;
26
28
  font-size: $post.text.size;
27
29
  display: block;
28
30
  text-decoration: none;
@@ -34,6 +36,7 @@
34
36
 
35
37
  \.post-date {
36
38
  color: $post.date.color;
39
+ font-family: $font.family;
37
40
  font-size: $post.date.size;
38
41
  display: block;
39
42
  float: left;
@@ -104,7 +104,7 @@ module RuneBlog::Helpers
104
104
  dirs.map {|name| RuneBlog::View.new(name) }
105
105
  end
106
106
 
107
- def write_repo_config(root: "#{Dir.pwd}/.blogs", view: "#{root}/data/VIEW", editor: "#{root}/data/EDITOR")
107
+ def write_repo_config(root: "#{Dir.pwd}/.blogs", view: "#{root}/data/VIEW", editor: "/usr/local/bin/vim")
108
108
  File.write(root + "/data/ROOT", root + "\n")
109
109
  File.write(root + "/data/VIEW", view.to_s + "\n")
110
110
  File.write(root + "/data/EDITOR", editor + "\n")
@@ -753,14 +753,16 @@ def _make_navbar(orient = :horiz)
753
753
  list1, list2 = '<l class="navbar-nav mr-auto">', "</ul>"
754
754
  end
755
755
 
756
+ # <!-- FIXME weird bug here!!! -->
756
757
  start = <<-HTML
757
- <!-- FIXME weird bug here!!! -->
758
+ <table><tr><td>
758
759
  <nav class="navbar #{extra} navbar-light bg-light">
759
760
  #{list1}
760
761
  HTML
761
762
  finish = <<-HTML
762
763
  #{list2}
763
764
  </nav>
765
+ </td></tr></table>
764
766
  HTML
765
767
 
766
768
  html_file = @blog.root/:views/@blog.view/"themes/standard/banner"/name
@@ -7,16 +7,21 @@ make_exception(:PublishError, "Error during publishing")
7
7
  make_exception(:EditorProblem, "Could not edit $1")
8
8
 
9
9
  module RuneBlog::REPL
10
- def edit_file(file)
11
- result = system!("#{@blog.editor} #{file}")
10
+ def edit_file(file, vim: "")
11
+ STDSCR.saveback
12
+ ed = @blog.editor
13
+ params = vim if ed =~ /vim$/
14
+ result = system!("#{@blog.editor} #{file} #{params}")
12
15
  raise EditorProblem(file) unless result
13
- cmd_clear(nil)
16
+ STDSCR.restback
17
+ # cmd_clear(nil)
14
18
  end
15
19
 
16
20
  def cmd_quit(arg, testing = false)
21
+ cmd_clear(nil)
17
22
  RubyText.stop
18
23
  sleep 0.1
19
- cmd_clear(nil)
24
+
20
25
  sleep 0.1
21
26
  exit
22
27
  end
@@ -271,7 +276,8 @@ module RuneBlog::REPL
271
276
  puts
272
277
  end
273
278
  @blog.create_view(arg)
274
- edit_file(@blog.view.dir/"themes/standard/global.lt3")
279
+ vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(VIEW_.*\|SITE.*\)"'
280
+ edit_file(@blog.view.dir/"themes/standard/global.lt3", vim: vim_params)
275
281
  @blog.change_view(arg)
276
282
  @out
277
283
  rescue ViewAlreadyExists
@@ -346,6 +352,7 @@ module RuneBlog::REPL
346
352
 
347
353
  file = files.first
348
354
  draft = @blog.root/:drafts/file
355
+ vim_params = '-c G'
349
356
  result = edit_file(draft)
350
357
  @blog.generate_post(draft)
351
358
  rescue => err
@@ -114,7 +114,6 @@ class RuneBlog
114
114
  global.gsub!(/CHARSET/, vars["charset"])
115
115
  global.gsub!(/LOCALE/, vars["locale"])
116
116
  File.write("#@root/data/global.lt3", global)
117
- STDERR.puts "Remember: fix global.lt3"
118
117
  end
119
118
 
120
119
  def _deploy_local(dir)
@@ -290,6 +289,7 @@ STDERR.puts "Remember: fix global.lt3"
290
289
  make_empty_view_tree(view_name)
291
290
  add_view(view_name)
292
291
  mark_last_published("Initial creation")
292
+ system("cp #@root/data/global.lt3 #@root/views/#{view_name}/themes/standard/global.lt3")
293
293
  rescue => err
294
294
  _tmp_error(err)
295
295
  end
@@ -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.82"
5
+ VERSION = "0.2.83"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -64,8 +64,10 @@ x.create_view("around_austin") # FIXME remember view title!
64
64
  vars = <<-VARS
65
65
 
66
66
  .variables
67
- blog Around Austin
68
- blog.desc The view from downtown...
67
+ blog Around Austin
68
+ blog.desc The view from downtown...
69
+
70
+ font.family verdana
69
71
  .end
70
72
  VARS
71
73
  File.open(".blogs/views/around_austin/themes/standard/global.lt3", "a") do |f|
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.82
4
+ version: 0.2.83
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-12-14 00:00:00.000000000 Z
11
+ date: 2019-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext