runeblog 0.2.84 → 0.2.89
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +38 -12
- data/empty_view/posts/GIT_IS_DUMB +1 -0
- data/empty_view/themes/standard/banner/top.lt3 +7 -6
- data/empty_view/themes/standard/blog/generate.lt3 +0 -2
- data/empty_view/themes/standard/blog/post_entry.lt3 +0 -1
- data/empty_view/themes/standard/etc/blog.css.lt3 +0 -1
- data/lib/default.rb +4 -3
- data/lib/liveblog.rb +12 -34
- data/lib/post.rb +0 -8
- data/lib/processing.rb +4 -3
- data/lib/publish.rb +1 -1
- data/lib/repl.rb +16 -21
- data/lib/runeblog.rb +23 -17
- data/lib/runeblog_version.rb +56 -2
- data/lib/view.rb +5 -2
- data/runeblog.gemspec +2 -2
- metadata +7 -7
- data/lib/global.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a5bfa546e814106599e4bd829ddf169bc07053b592db267bce813675f57119
|
4
|
+
data.tar.gz: 05dfce46838cf7002e57dc1f279e8da776463a06734f3a445ca2d710d82b4e2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 170e5b90aff508ad77410a0b774bf30b79282e0928f863147d6da681879448e78a8e0d8053bf3c50a97a465b22a88d36409aaca16efe1c1fb20b59f1a365260b
|
7
|
+
data.tar.gz: 37135518327009fd0300cc082914b29992934ecead7a62fe3c3f3bcbb72c6f290f0e7911a6ee94ed26f2b554d77cfd4da84f56cbfa6f95f5b15cac576639aa2a
|
data/bin/blog
CHANGED
@@ -12,9 +12,7 @@ include RuneBlog::REPL
|
|
12
12
|
def yesno(question, noskip=false)
|
13
13
|
puts fx("\n #{question}", :bold)
|
14
14
|
puts unless noskip
|
15
|
-
|
16
|
-
num, str = STDSCR.menu(r: r, c: c+6, items: ["yes", "no"])
|
17
|
-
num == 0
|
15
|
+
STDSCR.yesno
|
18
16
|
end
|
19
17
|
|
20
18
|
def pick_editor
|
@@ -24,29 +22,57 @@ def pick_editor
|
|
24
22
|
file = `which #{name}`.chomp
|
25
23
|
end
|
26
24
|
|
25
|
+
def get_universal
|
26
|
+
univ = "#{@blog.root}/data/universal.lt3"
|
27
|
+
if yesno("Faster initial setup? (no: edit universal.lt3)")
|
28
|
+
author = ask("Author name: ")
|
29
|
+
site = ask("Site/domain: ")
|
30
|
+
# Now stash it...
|
31
|
+
str = File.read(univ)
|
32
|
+
str = str.gsub(/AUTHOR/, author)
|
33
|
+
str = str.gsub(/SITE_DOMAIN/, site)
|
34
|
+
else
|
35
|
+
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(AUTHOR.*\|SITE.*\)"'
|
36
|
+
edit_file(univ, vim: vim_params)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_global
|
41
|
+
if yesno("Faster view setup? (no: edit global.lt3)")
|
42
|
+
view_name = ask("\nFilename: ")
|
43
|
+
@blog.create_view(view_name) # call change_view??
|
44
|
+
title = ask("View title: ")
|
45
|
+
subtitle = ask("Subtitle : ")
|
46
|
+
gname = "#{@blog.root}/views/#{view_name}/themes/standard/global.lt3"
|
47
|
+
text = File.read(gname)
|
48
|
+
text = text.gsub(/VIEW_NAME/, view_name)
|
49
|
+
text = text.gsub(/VIEW_TITLE/, title)
|
50
|
+
text = text.gsub(/VIEW_SUBTITLE/, subtitle)
|
51
|
+
File.write(gname, text)
|
52
|
+
else
|
53
|
+
view_name = ask("\nFilename: ")
|
54
|
+
@blog.create_view(view_name) # call change_view??
|
55
|
+
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(VIEW_.*\|SITE.*\)"'
|
56
|
+
edit_file(@blog.view.dir/"themes/standard/global.lt3", vim: vim_params)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
27
60
|
def get_started
|
28
61
|
if yesno("Do you want to qo a quick setup?")
|
29
62
|
puts " First choose your editor."
|
30
63
|
@blog.editor = pick_editor
|
31
64
|
File.write("#{@blog.root}/data/EDITOR", @blog.editor)
|
32
65
|
|
33
|
-
|
34
|
-
fname = "#{@blog.root}/data/universal.lt3"
|
35
|
-
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(AUTHOR.*\|SITE.*\)"'
|
36
|
-
edit_file(fname, vim: vim_params)
|
37
|
-
end
|
66
|
+
get_universal
|
38
67
|
# Now create a custom global.lt3
|
39
68
|
@blog._generate_global
|
40
|
-
noview = true
|
41
69
|
puts fx("\n Quick setup complete!", :bold)
|
42
70
|
if yesno("Create your first view now?")
|
43
|
-
|
44
|
-
noview = false
|
71
|
+
get_global
|
45
72
|
puts "\n View #{@blog.view} created!\n "
|
46
73
|
end
|
47
74
|
end
|
48
75
|
|
49
|
-
|
50
76
|
puts
|
51
77
|
print fx(" For help", :bold)
|
52
78
|
puts " type h or help."
|
@@ -0,0 +1 @@
|
|
1
|
+
meh
|
@@ -1,5 +1,6 @@
|
|
1
|
-
.
|
2
|
-
|
1
|
+
.seek global.lt3 # FIXME this is a hack!
|
2
|
+
|
3
|
+
<svg width="98%" height="120"
|
3
4
|
viewBox="0 0 98% 100">
|
4
5
|
<defs>
|
5
6
|
<linearGradient id="grad1" x1="100%" y1="100%" x2="0%" y2="100%">
|
@@ -8,12 +9,12 @@
|
|
8
9
|
</linearGradient>
|
9
10
|
</defs>
|
10
11
|
<style>
|
11
|
-
.small { font:
|
12
|
-
.heavy { font: bold
|
12
|
+
.small { font: 18px sans-serif; fill: #98baff }
|
13
|
+
.heavy { font: bold 52px sans-serif; fill: #76a9ff }
|
13
14
|
</style>
|
14
15
|
|
15
16
|
<rect x="20" y="20" rx="15" ry="15" width="98%" height="100" fill="url(#grad1)"/>
|
16
17
|
|
17
|
-
<text x="
|
18
|
-
<text x="
|
18
|
+
<text x="45" y="70" class=heavy>$blog</text>
|
19
|
+
<text x="45" y="98" class=small>$blog.desc</text>
|
19
20
|
</svg>
|
data/lib/default.rb
CHANGED
@@ -8,10 +8,11 @@ def RuneBlog.post_template(num: 0, title: "No title", date: nil, view: "test_vie
|
|
8
8
|
log!(enter: __method__, args: [num, title, date, view, teaser, body, tags, views, back, home], level: 3)
|
9
9
|
viewlist = (views + [view.to_s]).join(" ")
|
10
10
|
taglist = ".tags " + tags.join(" ")
|
11
|
-
<<-TEXT
|
12
|
-
.mixin liveblog
|
13
|
-
. ^ get rid of this later
|
14
11
|
|
12
|
+
# .mixin liveblog
|
13
|
+
# . ^ get rid of this later
|
14
|
+
|
15
|
+
<<-TEXT
|
15
16
|
.post #{num}
|
16
17
|
|
17
18
|
.title #{title}
|
data/lib/liveblog.rb
CHANGED
@@ -18,6 +18,8 @@ def init_liveblog # FIXME - a lot of this logic sucks
|
|
18
18
|
@vdir = @blog.view.dir rescue "NONAME"
|
19
19
|
@version = RuneBlog::VERSION
|
20
20
|
@theme = @vdir/:themes/:standard
|
21
|
+
rescue
|
22
|
+
raise "Only works inside a blog repo"
|
21
23
|
end
|
22
24
|
|
23
25
|
##################
|
@@ -90,7 +92,6 @@ end
|
|
90
92
|
|
91
93
|
def banner
|
92
94
|
count = 0
|
93
|
-
span = 1
|
94
95
|
bg = "white" # outside loop
|
95
96
|
wide = nil
|
96
97
|
high = 250
|
@@ -111,23 +112,23 @@ def banner
|
|
111
112
|
image = "banner"/image
|
112
113
|
wide = data[0]
|
113
114
|
width = wide ? "width=#{wide}" : ""
|
114
|
-
str2 << " <td
|
115
|
+
str2 << " <td><img src=#{image} #{width} height=#{high}></img></td>" + "\n"
|
115
116
|
when "svg_title"
|
116
117
|
stuff, hash = _svg_title(*data)
|
117
118
|
wide = hash["width"]
|
118
|
-
str2 << " <td
|
119
|
+
str2 << " <td width=#{wide}>#{stuff}</td>" + "\n"
|
119
120
|
when "text"
|
120
121
|
data[0] ||= "top.html"
|
121
122
|
file = "banner"/data[0]
|
122
123
|
if ! File.exist?(file)
|
123
124
|
src = file.sub(/html$/, "lt3")
|
124
125
|
if File.exist?(src)
|
125
|
-
preprocess src: src, dst: file, vars:
|
126
|
+
preprocess src: src, dst: file, call: ".nopara" # , vars: @blog.view.globals
|
126
127
|
else
|
127
128
|
raise "Neither #{file} nor #{src} found"
|
128
129
|
end
|
129
130
|
end
|
130
|
-
str2 << "<td
|
131
|
+
str2 << "<td>" + File.read(file) + "</td>" + "\n"
|
131
132
|
when "navbar"
|
132
133
|
dir = @blog.root/:views/@blog.view/"themes/standard/banner/" + "\n"
|
133
134
|
_make_navbar # horiz is default
|
@@ -139,7 +140,6 @@ def banner
|
|
139
140
|
file = "banner/vnavbar.html"
|
140
141
|
navbar = File.read(file)
|
141
142
|
when "break"
|
142
|
-
# span = count - 1
|
143
143
|
str2 << " </tr>\n <tr>" + "\n"
|
144
144
|
else
|
145
145
|
str2 << " '#{tag}' isn't known" + "\n"
|
@@ -159,28 +159,6 @@ rescue => err
|
|
159
159
|
gets
|
160
160
|
end
|
161
161
|
|
162
|
-
def _parse_colon_args(args, hash) # really belongs in livetext
|
163
|
-
h2 = hash.dup
|
164
|
-
e = args.each
|
165
|
-
loop do
|
166
|
-
arg = e.next.chop.to_sym
|
167
|
-
raise "_parse_args: #{arg} is unknown" unless hash.keys.include?(arg)
|
168
|
-
h2[arg] = e.next
|
169
|
-
end
|
170
|
-
h2 = h2.reject {|k,v| v.nil? }
|
171
|
-
h2.each_pair {|k, v| raise "#{k} has no value" if v.empty? }
|
172
|
-
h2
|
173
|
-
end
|
174
|
-
|
175
|
-
def _get_arg(name, args) # really belongs in livetext
|
176
|
-
raise "(#{name}) Expected an array" unless args.is_a? Array
|
177
|
-
raise "(#{name}) Expected an arg" if args.empty?
|
178
|
-
raise "(#{name}) Too many args: #{args.inspect}" if args.size > 1
|
179
|
-
val = args[0]
|
180
|
-
raise "Expected an argument '#{name}'" if val.nil?
|
181
|
-
val
|
182
|
-
end
|
183
|
-
|
184
162
|
def _svg_title(*args)
|
185
163
|
width = "95%"
|
186
164
|
height = 90
|
@@ -574,11 +552,10 @@ def sidebar
|
|
574
552
|
num = rand(1..4)
|
575
553
|
img = "widgets/ad/ad#{num}.png"
|
576
554
|
src, dst = img, @root/:views/@view_name/"remote/widgets/ad/"
|
577
|
-
system!("cp #{src} #{dst}")
|
578
|
-
File.open(wtag/"vars.lt3", "w")
|
579
|
-
|
580
|
-
|
581
|
-
preprocess cwd: wtag, src: tag, dst: tcard, force: true # , debug: true # , deps: depend
|
555
|
+
system!("cp #{src} #{dst}")
|
556
|
+
File.open(wtag/"vars.lt3", "w") {|f| f.puts ".set ad.image = #{img}" }
|
557
|
+
preprocess cwd: wtag, src: tag, dst: tcard, call: ".nopara",
|
558
|
+
force: true # , debug: true # , deps: depend
|
582
559
|
end
|
583
560
|
|
584
561
|
_include_file wtag/tcard
|
@@ -722,7 +699,8 @@ def _make_navbar(orient = :horiz)
|
|
722
699
|
output.puts %[#{li1} <a class="nav-link" href="index.html">#{cdata}<span class="sr-only">(current)</span></a> #{li2}]
|
723
700
|
else
|
724
701
|
dir = @blog.root/:views/@blog.view/"themes/standard/banner"
|
725
|
-
|
702
|
+
dest = vdir/"remote/banner"/basename+".html"
|
703
|
+
preprocess cwd: dir, src: basename, dst: dest, call: ".nopara" # , debug: true
|
726
704
|
output.puts %[#{li1} <a class="nav-link" #{href_main}>#{cdata}</a> #{li2}]
|
727
705
|
end
|
728
706
|
end
|
data/lib/post.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'runeblog'
|
2
|
-
require 'global'
|
3
2
|
require 'pathmagic'
|
4
3
|
|
5
4
|
class RuneBlog::Post
|
@@ -9,12 +8,6 @@ class RuneBlog::Post
|
|
9
8
|
|
10
9
|
include RuneBlog::Helpers
|
11
10
|
|
12
|
-
# def self.files(num, root)
|
13
|
-
# log!(enter: __method__, args: [num, root], level: 3)
|
14
|
-
# files = ::Find.find(root).to_a
|
15
|
-
# result = files.grep(/#{prefix(num)}-/)
|
16
|
-
# result
|
17
|
-
# end
|
18
11
|
|
19
12
|
def self.load(post)
|
20
13
|
log!(enter: __method__, args: [post], level: 3)
|
@@ -22,7 +15,6 @@ class RuneBlog::Post
|
|
22
15
|
raise NoBlogAccessor if RuneBlog.blog.nil?
|
23
16
|
# "post" is a slug
|
24
17
|
pdir = RuneBlog.blog.root/:drafts/post
|
25
|
-
puts "-- load: opening #{pdir}"
|
26
18
|
meta = nil
|
27
19
|
Dir.chdir(pdir) do
|
28
20
|
meta = read_config("metadata.txt")
|
data/lib/processing.rb
CHANGED
@@ -22,7 +22,8 @@ end
|
|
22
22
|
|
23
23
|
def preprocess(cwd: Dir.pwd, src:,
|
24
24
|
dst: (strip = true; File.basename(src).sub(/.lt3$/,"")),
|
25
|
-
deps: [], copy: nil, debug: false, force: false,
|
25
|
+
deps: [], copy: nil, debug: false, force: false,
|
26
|
+
mix: [], call: [], vars: {})
|
26
27
|
src += LEXT unless src.end_with?(LEXT)
|
27
28
|
dst += ".html" unless (dst.end_with?(".html") || strip)
|
28
29
|
sp = " "*12
|
@@ -37,8 +38,8 @@ def preprocess(cwd: Dir.pwd, src:,
|
|
37
38
|
end
|
38
39
|
stale = stale?(src, dst, deps, force)
|
39
40
|
if stale
|
40
|
-
live = Livetext.
|
41
|
-
out = live.xform_file(src
|
41
|
+
live = Livetext.customize(mix: "liveblog", call: call, vars: vars)
|
42
|
+
out = live.xform_file(src)
|
42
43
|
File.write(dst, out)
|
43
44
|
system!("cp #{dst} #{copy}") if copy
|
44
45
|
end
|
data/lib/publish.rb
CHANGED
@@ -2,7 +2,6 @@ if ! defined?(Already_publish)
|
|
2
2
|
|
3
3
|
Already_publish = nil
|
4
4
|
|
5
|
-
require 'global'
|
6
5
|
require 'pathmagic'
|
7
6
|
|
8
7
|
class RuneBlog::Publishing
|
@@ -17,6 +16,7 @@ class RuneBlog::Publishing
|
|
17
16
|
@blog = RuneBlog.blog
|
18
17
|
gfile = @blog.root/:views/view/"themes/standard/global.lt3"
|
19
18
|
data = File.readlines(gfile)
|
19
|
+
# Please refactor the Hal out of this
|
20
20
|
grab = ->(var) { data.grep(/^#{var} /).first.chomp.split(" ", 2)[1] }
|
21
21
|
@user = grab.call("publish.user")
|
22
22
|
@server = grab.call("publish.server")
|
data/lib/repl.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'runeblog'
|
2
|
-
require 'global'
|
3
2
|
require 'ostruct'
|
4
3
|
require 'helpers-repl' # FIXME structure
|
5
4
|
|
@@ -39,27 +38,22 @@ module RuneBlog::REPL
|
|
39
38
|
end
|
40
39
|
|
41
40
|
def cmd_config(arg, testing = false)
|
42
|
-
|
43
|
-
"blog/generate.lt3 Generator for view (usu not edited)",
|
44
|
-
".... head.lt3 HEAD info for view",
|
45
|
-
".... banner.lt3 banner description",
|
46
|
-
".... index.lt3 User-edited detail for view",
|
47
|
-
".... post_entry.lt3 Generator for post entry in recent-posts",
|
48
|
-
"etc/blog.css.lt3 Global CSS",
|
49
|
-
"... externals.lt3 External JS/CSS (Bootstrap, etc.)",
|
50
|
-
"post/generate.lt3 Generator for a post",
|
51
|
-
".... head.lt3 HEAD info for post",
|
52
|
-
".... index.lt3 Content for post",
|
53
|
-
".... permalink.lt3 Generator for permalink"
|
54
|
-
|
55
|
-
name = ["global.lt3", "blog/generate.lt3", "blog/head.lt3", "blog/banner.lt3",
|
56
|
-
"blog/index.lt3", "blog/post_entry.lt3", "etc/blog.css.lt3",
|
57
|
-
"blog/externals.lt3", "post/generate.lt3", "post/head.lt3",
|
58
|
-
"post/index.lt3", "post/permalink.lt3"]
|
41
|
+
hash = {"global.lt3 Global configuration" => "global.lt3",
|
42
|
+
"blog/generate.lt3 Generator for view (usu not edited)" => "blog/generate.lt3",
|
43
|
+
".... head.lt3 HEAD info for view" => "blog/head.lt3",
|
44
|
+
".... banner.lt3 banner description" => "blog/banner.lt3",
|
45
|
+
".... index.lt3 User-edited detail for view" => "blog/index.lt3",
|
46
|
+
".... post_entry.lt3 Generator for post entry in recent-posts" => "blog/post_entry.lt3",
|
47
|
+
"etc/blog.css.lt3 Global CSS" => "etc/blog.css.lt3",
|
48
|
+
"... externals.lt3 External JS/CSS (Bootstrap, etc.)" => "/etc/externals.lt3",
|
49
|
+
"post/generate.lt3 Generator for a post" => "post/generate.lt3",
|
50
|
+
".... head.lt3 HEAD info for post" => "post/head.lt3",
|
51
|
+
".... index.lt3 Content for post" => "post/index.lt3",
|
52
|
+
".... permalink.lt3 Generator for permalink" => "post/permalink.lt3",
|
53
|
+
}
|
59
54
|
|
60
55
|
dir = @blog.view.dir/"themes/standard/"
|
61
|
-
num,
|
62
|
-
target = name[num]
|
56
|
+
num, target = STDSCR.menu(title: "Edit file:", items: hash)
|
63
57
|
edit_file(dir/target)
|
64
58
|
end
|
65
59
|
|
@@ -192,7 +186,7 @@ module RuneBlog::REPL
|
|
192
186
|
puts unless testing
|
193
187
|
reset_output
|
194
188
|
unless @blog.view.can_publish?
|
195
|
-
msg = "Can't publish... see
|
189
|
+
msg = "Can't publish... see global.lt3"
|
196
190
|
puts msg unless testing
|
197
191
|
output! msg
|
198
192
|
return @out
|
@@ -253,6 +247,7 @@ module RuneBlog::REPL
|
|
253
247
|
viewnames = @blog.views.map {|x| x.name }
|
254
248
|
n = viewnames.find_index(@blog.view.name)
|
255
249
|
name = @blog.view.name
|
250
|
+
# TODO: Add view description
|
256
251
|
k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n) unless testing
|
257
252
|
return if name.nil?
|
258
253
|
@blog.view = name
|
data/lib/runeblog.rb
CHANGED
@@ -9,7 +9,6 @@ require 'ostruct'
|
|
9
9
|
require 'logging'
|
10
10
|
|
11
11
|
require 'runeblog_version'
|
12
|
-
require 'global'
|
13
12
|
require 'helpers-blog'
|
14
13
|
require 'default'
|
15
14
|
require 'view'
|
@@ -107,13 +106,14 @@ class RuneBlog
|
|
107
106
|
|
108
107
|
def _generate_global
|
109
108
|
vars = read_vars("#@root/data/universal.lt3")
|
110
|
-
|
109
|
+
gfile = "#@root/data/global.lt3"
|
110
|
+
global = File.read(gfile)
|
111
111
|
global.gsub!(/AUTHOR/, vars["author"])
|
112
112
|
global.gsub!(/SITE/, vars["site"])
|
113
113
|
global.gsub!(/FONT/, vars["font.family"])
|
114
114
|
global.gsub!(/CHARSET/, vars["charset"])
|
115
115
|
global.gsub!(/LOCALE/, vars["locale"])
|
116
|
-
File.write(
|
116
|
+
File.write(gfile, global)
|
117
117
|
end
|
118
118
|
|
119
119
|
def _deploy_local(dir)
|
@@ -163,7 +163,8 @@ class RuneBlog
|
|
163
163
|
dir = @root/:posts/nslug
|
164
164
|
create_dirs(dir)
|
165
165
|
# FIXME dependencies?
|
166
|
-
preprocess cwd: dir, src: @root/:drafts/sourcefile
|
166
|
+
preprocess cwd: dir, src: @root/:drafts/sourcefile,
|
167
|
+
mix: "liveblog" # , debug: true
|
167
168
|
_deploy_local(dir)
|
168
169
|
rescue => err
|
169
170
|
_tmp_error(err)
|
@@ -336,8 +337,10 @@ class RuneBlog
|
|
336
337
|
@theme = @view.dir/"themes/standard"
|
337
338
|
post_entry_name = @theme/"blog/post_entry.lt3"
|
338
339
|
depend = [post_entry_name]
|
339
|
-
|
340
|
-
|
340
|
+
html = "/tmp/post_entry.html"
|
341
|
+
preprocess src: post_entry_name, dst: html,
|
342
|
+
call: ".nopara" # , deps: depend # , debug: true
|
343
|
+
@_post_entry ||= File.read(html)
|
341
344
|
vp = post_lookup(id)
|
342
345
|
nslug, aslug, title, date, teaser_text =
|
343
346
|
vp.nslug, vp.aslug, vp.title, vp.date, vp.teaser_text
|
@@ -389,13 +392,11 @@ class RuneBlog
|
|
389
392
|
end
|
390
393
|
else
|
391
394
|
text << <<-HTML
|
392
|
-
<svg width="95%" height="
|
393
|
-
<style> .huge { font: italic
|
395
|
+
<svg width="95%" height="75%" viewBox="0 0 95% 95%">
|
396
|
+
<style> .huge { font: italic 90px sans-serif; fill: white } </style>
|
394
397
|
<rect x="0" y="0" rx="50" ry="50" width="95%" height="95%" fill="lightblue"/>
|
395
|
-
<text x="
|
396
|
-
<text x="
|
397
|
-
<text x="250" y="340" class=huge>here</text>
|
398
|
-
<text x="250" y="450" class=huge>yet</text>
|
398
|
+
<text x="120" y="250" class=huge>No posts</text>
|
399
|
+
<text x="120" y="350" class=huge>here yet</text>
|
399
400
|
</svg>
|
400
401
|
HTML
|
401
402
|
end
|
@@ -466,9 +467,11 @@ class RuneBlog
|
|
466
467
|
# @theme/"navbar/navbar.lt3",
|
467
468
|
@theme/"blog/index.lt3"] # FIXME what about assets?
|
468
469
|
preprocess cwd: vdir/"themes/standard/etc", # deps: depend, debug: true,
|
469
|
-
src: "blog.css.lt3", copy: vdir/"remote/etc/"
|
470
|
+
src: "blog.css.lt3", copy: vdir/"remote/etc/",
|
471
|
+
call: ".nopara" # , dst: "blog.css"
|
470
472
|
preprocess cwd: vdir/"themes/standard", deps: depend, force: true,
|
471
|
-
src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
|
473
|
+
src: "blog/generate.lt3", dst: vdir/:remote/"index.html",
|
474
|
+
call: ".nopara"
|
472
475
|
copy("#{vdir}/assets/*", "#{vdir}/remote/assets/")
|
473
476
|
copy_widget_html(view)
|
474
477
|
rescue => err
|
@@ -576,7 +579,8 @@ class RuneBlog
|
|
576
579
|
# Step 1...
|
577
580
|
create_dirs(pdraft)
|
578
581
|
# FIXME dependencies?
|
579
|
-
preprocess cwd: pdraft, src: draft, dst: "guts.html"
|
582
|
+
preprocess cwd: pdraft, src: draft, dst: "guts.html",
|
583
|
+
mix: "liveblog" # , debug: true
|
580
584
|
_post_metadata(draft, pdraft)
|
581
585
|
# Step 2...
|
582
586
|
vposts = @root/:views/view_name/:posts
|
@@ -587,10 +591,12 @@ class RuneBlog
|
|
587
591
|
# Step 4...
|
588
592
|
# FIXME dependencies?
|
589
593
|
preprocess cwd: @theme/:post, src: "generate.lt3", force: true,
|
590
|
-
dst: remote/ahtml, copy: @theme/:post
|
594
|
+
dst: remote/ahtml, copy: @theme/:post,
|
595
|
+
call: ".nopara" # , debug: true
|
591
596
|
# FIXME dependencies?
|
592
597
|
preprocess cwd: @theme/:post, src: "permalink.lt3",
|
593
|
-
dst: remote/:permalink/ahtml
|
598
|
+
dst: remote/:permalink/ahtml,
|
599
|
+
mix: "liveblog" # , debug: true
|
594
600
|
copy_widget_html(view_name)
|
595
601
|
rescue => err
|
596
602
|
_tmp_error(err)
|
data/lib/runeblog_version.rb
CHANGED
@@ -1,11 +1,65 @@
|
|
1
|
+
if !defined?(RuneBlog::Path)
|
1
2
|
|
2
|
-
if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
|
3
|
+
# if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
|
3
4
|
|
4
5
|
class RuneBlog
|
5
|
-
VERSION = "0.2.
|
6
|
+
VERSION = "0.2.89"
|
6
7
|
|
7
8
|
path = Gem.find_files("runeblog").grep(/runeblog-/).first
|
8
9
|
Path = File.dirname(path)
|
9
10
|
end
|
10
11
|
|
12
|
+
# skeleton
|
13
|
+
|
14
|
+
class RuneBlog
|
15
|
+
module Helpers
|
16
|
+
end
|
17
|
+
|
18
|
+
class Default
|
19
|
+
end
|
20
|
+
|
21
|
+
class View
|
22
|
+
end
|
23
|
+
|
24
|
+
class Publishing
|
25
|
+
end
|
26
|
+
|
27
|
+
class Post
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Refactor, move stuff elsewhere?
|
32
|
+
|
33
|
+
def make_exception(sym, str)
|
34
|
+
log!(enter: __method__, args: [sym, str], level: 3)
|
35
|
+
return if Object.constants.include?(sym)
|
36
|
+
Object.const_set(sym, StandardError.dup)
|
37
|
+
define_method(sym) do |*args|
|
38
|
+
msg = str
|
39
|
+
args.each.with_index {|arg, i| msg.sub!("$#{i+1}", arg) }
|
40
|
+
Object.class_eval(sym.to_s).new(msg)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def system!(str, show: false)
|
45
|
+
log!(enter: __method__, args: [str], level: 2)
|
46
|
+
STDERR.puts str if show
|
47
|
+
rc = system(str)
|
48
|
+
if rc
|
49
|
+
return rc
|
50
|
+
else
|
51
|
+
STDERR.puts "FAILED: #{str.inspect}"
|
52
|
+
STDERR.puts "\ncaller = \n#{caller.join("\n ")}\n"
|
53
|
+
exit
|
54
|
+
return rc
|
55
|
+
end
|
56
|
+
rc
|
57
|
+
end
|
58
|
+
|
59
|
+
def prefix(num)
|
60
|
+
log!(enter: __method__, args: [num], level: 3)
|
61
|
+
"#{'%04d' % num.to_i}"
|
62
|
+
end
|
63
|
+
|
64
|
+
|
11
65
|
end
|
data/lib/view.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
require 'global'
|
2
1
|
require 'logging'
|
3
2
|
|
4
3
|
class RuneBlog::View
|
5
|
-
attr_reader :name, :state
|
4
|
+
attr_reader :name, :state, :globals
|
6
5
|
attr_accessor :publisher
|
7
6
|
|
8
7
|
include RuneBlog::Helpers
|
@@ -15,6 +14,10 @@ class RuneBlog::View
|
|
15
14
|
@publisher = RuneBlog::Publishing.new(name)
|
16
15
|
@can_publish = true # FIXME
|
17
16
|
@blog.view = self
|
17
|
+
gfile = @blog.root/"views/#{name}/themes/standard/global.lt3"
|
18
|
+
live = Livetext.customize(call: ".nopara")
|
19
|
+
live.xform_file(gfile)
|
20
|
+
@globals = live.vars
|
18
21
|
end
|
19
22
|
|
20
23
|
def dir
|
data/runeblog.gemspec
CHANGED
@@ -20,8 +20,8 @@ spec = Gem::Specification.new do |s|
|
|
20
20
|
s.authors = ["Hal Fulton"]
|
21
21
|
s.email = 'rubyhacker@gmail.com'
|
22
22
|
s.executables << "blog"
|
23
|
-
s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.
|
24
|
-
s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.
|
23
|
+
s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.99'
|
24
|
+
s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.20'
|
25
25
|
|
26
26
|
s.add_development_dependency 'minitest', '~> 5.10', '>= 5.10.0'
|
27
27
|
|
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.
|
4
|
+
version: 0.2.89
|
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-
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.8'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.8.
|
22
|
+
version: 0.8.99
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.8'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.8.
|
32
|
+
version: 0.8.99
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rubytext
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '0.1'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.1.
|
42
|
+
version: 0.1.20
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '0.1'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.1.
|
52
|
+
version: 0.1.20
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: minitest
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- data/universal.lt3
|
90
90
|
- empty_view/assets/austin-pano.jpg
|
91
91
|
- empty_view/assets/sky2.jpg
|
92
|
+
- empty_view/posts/GIT_IS_DUMB
|
92
93
|
- empty_view/remote/assets/GIT_IS_DUMB
|
93
94
|
- empty_view/remote/banner/austin-pano.jpg
|
94
95
|
- empty_view/remote/etc/GIT_IS_DUMB
|
@@ -183,7 +184,6 @@ files:
|
|
183
184
|
- lib/exper/gen_svg.rb
|
184
185
|
- lib/exper/s2.html
|
185
186
|
- lib/exper/varmint.rb
|
186
|
-
- lib/global.rb
|
187
187
|
- lib/helpers-blog.rb
|
188
188
|
- lib/helpers-repl.rb
|
189
189
|
- lib/liveblog.rb
|
data/lib/global.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
# skeleton
|
2
|
-
|
3
|
-
class RuneBlog
|
4
|
-
module Helpers
|
5
|
-
end
|
6
|
-
|
7
|
-
class Default
|
8
|
-
end
|
9
|
-
|
10
|
-
class View
|
11
|
-
end
|
12
|
-
|
13
|
-
class Publishing
|
14
|
-
end
|
15
|
-
|
16
|
-
class Post
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
# Refactor, move stuff elsewhere?
|
21
|
-
|
22
|
-
def make_exception(sym, str)
|
23
|
-
log!(enter: __method__, args: [sym, str], level: 3)
|
24
|
-
return if Object.constants.include?(sym)
|
25
|
-
Object.const_set(sym, StandardError.dup)
|
26
|
-
define_method(sym) do |*args|
|
27
|
-
msg = str
|
28
|
-
args.each.with_index {|arg, i| msg.sub!("$#{i+1}", arg) }
|
29
|
-
Object.class_eval(sym.to_s).new(msg)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def system!(str, show: false)
|
34
|
-
log!(enter: __method__, args: [str], level: 2)
|
35
|
-
STDERR.puts str if show
|
36
|
-
rc = system(str)
|
37
|
-
if rc
|
38
|
-
return rc
|
39
|
-
else
|
40
|
-
STDERR.puts "FAILED: #{str.inspect}"
|
41
|
-
STDERR.puts "\ncaller = \n#{caller.join("\n ")}\n"
|
42
|
-
exit
|
43
|
-
return rc
|
44
|
-
end
|
45
|
-
rc
|
46
|
-
end
|
47
|
-
|
48
|
-
def prefix(num)
|
49
|
-
log!(enter: __method__, args: [num], level: 3)
|
50
|
-
"#{'%04d' % num.to_i}"
|
51
|
-
end
|
52
|
-
|