runeblog 0.3.19 → 0.3.24
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 +4 -4
- data/bin/blog +80 -52
- data/data/global.lt3 +3 -3
- data/data/universal.lt3 +2 -0
- data/empty_view/data/GIT_IS_DUMB +0 -0
- data/empty_view/themes/standard/banner/top.lt3 +1 -1
- data/empty_view/themes/standard/blog/generate.lt3 +1 -1
- data/empty_view/themes/standard/etc/blog.css.lt3 +1 -1
- data/empty_view/themes/standard/etc/github.css +209 -0
- data/empty_view/themes/standard/post/generate.lt3 +8 -5
- data/empty_view/themes/standard/post/permalink.lt3 +1 -1
- data/lib/exceptions.rb +1 -1
- data/lib/helpers-blog.rb +6 -4
- data/lib/liveblog.rb +99 -20
- data/lib/lowlevel.rb +25 -8
- data/lib/menus.rb +5 -3
- data/lib/newpost.rb +82 -0
- data/lib/post.rb +3 -2
- data/lib/processing.rb +29 -1
- data/lib/publish.rb +3 -1
- data/lib/repl.rb +72 -18
- data/lib/runeblog.rb +86 -46
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +22 -3
- data/runeblog.gemspec +4 -2
- metadata +32 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcf07214d034b5091d1b1b0910aee40fe46b8c735c33451fd364eaf57621084f
|
4
|
+
data.tar.gz: 7b6bab92b5a4a1835de24650c721f62aac77d0a36405877871b5db98198ba976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14d8f4233ae7a9e8aaa91f9f9c9bb725d821f852ccfcaee2a493074743ed8ac3d830e334dda9b1367bea2951e04b5ddb78987a9f11130adaadb0af26a0ea39d1
|
7
|
+
data.tar.gz: 3c2904ff1064fb28dd1885f2e58f640287a9c8e3527d379eb573e2a950753bdbe01d0b206e5060d7bbbd0d28880c92c43435721b0693c27658cc08862abc02ad
|
data/bin/blog
CHANGED
@@ -27,8 +27,12 @@ end
|
|
27
27
|
def get_universal
|
28
28
|
univ = "#{@blog.root}/data/universal.lt3"
|
29
29
|
if yesno("Faster initial setup? (no: edit universal.lt3)")
|
30
|
-
|
31
|
-
|
30
|
+
# author = ask!(" Author name: ")
|
31
|
+
# site = ask!(" Site/domain: ")
|
32
|
+
# Temporarily, for speed:
|
33
|
+
author, site = "Hal Fulton", "somedomain.com"
|
34
|
+
puts " Author name: #{author}"
|
35
|
+
puts " Site/domain: #{site}"
|
32
36
|
# Now stash it...
|
33
37
|
str = File.read(univ)
|
34
38
|
str = str.gsub(/AUTHOR/, author)
|
@@ -41,22 +45,16 @@ def get_universal
|
|
41
45
|
end
|
42
46
|
|
43
47
|
def get_global
|
48
|
+
view_name = ask!(" Filename: ")
|
49
|
+
@blog.create_view(view_name) # call change_view??
|
44
50
|
if yesno("Faster view setup? (no: edit global.lt3)")
|
45
|
-
view_name = ask!(" Filename: ")
|
46
|
-
@blog.create_view(view_name) # call change_view??
|
47
51
|
title = ask!(" View title: ")
|
48
52
|
subtitle = ask!(" Subtitle : ")
|
49
53
|
domain = ask!(" Domain : ")
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
/VIEW_TITLE/ => title,
|
54
|
-
/VIEW_SUBTITLE/ => subtitle,
|
55
|
-
/VIEW_DOMAIN/ => domain}
|
56
|
-
@blog.complete_file(vfile, nil, hash)
|
54
|
+
modify_view_global(view_name)
|
55
|
+
modify_view_settings(name: view_name, title: title, subtitle: subtitle,
|
56
|
+
domain: domain)
|
57
57
|
else
|
58
|
-
view_name = ask!(" Filename: ")
|
59
|
-
@blog.create_view(view_name) # call change_view??
|
60
58
|
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(VIEW_.*\|SITE.*\)"'
|
61
59
|
edit_file(@blog.view.dir/"themes/standard/global.lt3", vim: vim_params)
|
62
60
|
end
|
@@ -109,7 +107,12 @@ def mainloop
|
|
109
107
|
puts "Don't understand '#{cmd.inspect}'\n "
|
110
108
|
end
|
111
109
|
rescue => err
|
110
|
+
log!(str: err.to_s)
|
111
|
+
log!(str: err.backtrace.join("\n")) if err.respond_to?(:backtrace)
|
112
|
+
puts "Current dir = #{Dir.pwd}"
|
112
113
|
puts err
|
114
|
+
puts err.backtrace.join("\n")
|
115
|
+
puts "Pausing..."; gets
|
113
116
|
end
|
114
117
|
|
115
118
|
def cmdline_preview
|
@@ -159,57 +162,82 @@ def handle_cmdline
|
|
159
162
|
exit
|
160
163
|
end
|
161
164
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
ver
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
165
|
+
def check_ruby_version
|
166
|
+
major, minor = RUBY_VERSION.split(".").values_at(0,1)
|
167
|
+
ver = major.to_i*10 + minor.to_i
|
168
|
+
unless ver >= 24
|
169
|
+
RubyText.stop
|
170
|
+
sleep 0.2
|
171
|
+
puts "Needs Ruby 2.4 or greater"
|
172
|
+
exit
|
173
|
+
end
|
171
174
|
end
|
172
175
|
|
173
|
-
|
176
|
+
def reopen_stderr
|
177
|
+
errfile = File.new("stderr.out", "w")
|
178
|
+
STDERR.reopen(errfile)
|
179
|
+
end
|
174
180
|
|
175
|
-
|
181
|
+
def set_fgbg
|
182
|
+
# read a .rubytext file here?? Call it something else?
|
183
|
+
home = ENV['HOME']
|
184
|
+
@fg, @bg = Blue, White ## FIXME!! try_read_config("#{home}/.rubytext", fg: Blue, bg: White)
|
185
|
+
@fg = @fg.downcase.to_sym
|
186
|
+
@bg = @bg.downcase.to_sym
|
176
187
|
|
177
|
-
|
178
|
-
|
188
|
+
RubyText.start(:_echo, :keypad, scroll: true, log: "binblog.txt", fg: @fg, bg: @bg)
|
189
|
+
end
|
179
190
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
191
|
+
def create_new_repo?
|
192
|
+
new_repo = false
|
193
|
+
if ! RuneBlog.exist?
|
194
|
+
exit unless yesno("No blog repo found. Create new one?")
|
195
|
+
RuneBlog.create_new_blog_repo
|
196
|
+
puts fx(" Blog repo successfully created.", :bold)
|
197
|
+
new_repo = true
|
198
|
+
end
|
185
199
|
|
186
|
-
|
200
|
+
@blog = RuneBlog.new
|
201
|
+
get_started if new_repo
|
202
|
+
rescue => err
|
203
|
+
STDERR.puts "Error - #{err.to_s}"
|
204
|
+
STDERR.puts err.backtrace if err.respond_to?(:backtrace)
|
205
|
+
end
|
187
206
|
|
207
|
+
def print_intro
|
208
|
+
print fx(" For help", :bold)
|
209
|
+
puts " type h or help.\n "
|
188
210
|
|
189
|
-
|
190
|
-
if ! RuneBlog.exist?
|
191
|
-
exit unless yesno("No blog repo found. Create new one?")
|
192
|
-
RuneBlog.create_new_blog_repo
|
193
|
-
puts fx(" Blog repo successfully created.", :bold)
|
194
|
-
new_repo = true
|
211
|
+
puts fx("\n RuneBlog", :bold), fx(" v #{RuneBlog::VERSION}\n", Red)
|
195
212
|
end
|
196
213
|
|
197
|
-
|
198
|
-
|
214
|
+
def cmd_history_etc
|
215
|
+
@cmdhist = []
|
216
|
+
@tabcom = RuneBlog::REPL::Patterns.keys.uniq - RuneBlog::REPL::Abbr.keys
|
217
|
+
@tabcom.map! {|x| x.sub(/ [\$\>].*/, "") + " " }
|
218
|
+
@tabcom.sort!
|
219
|
+
end
|
199
220
|
|
200
|
-
|
201
|
-
|
221
|
+
def exit_repl
|
222
|
+
# RubyText.stop
|
223
|
+
sleep 0.2
|
224
|
+
puts
|
225
|
+
end
|
202
226
|
|
203
|
-
|
227
|
+
### Main
|
204
228
|
|
205
|
-
|
206
|
-
@tabcom = RuneBlog::REPL::Patterns.keys.uniq - RuneBlog::REPL::Abbr.keys
|
207
|
-
@tabcom.map! {|x| x.sub(/ [\$\>].*/, "") + " " }
|
208
|
-
@tabcom.sort!
|
209
|
-
|
210
|
-
loop { mainloop }
|
229
|
+
include RuneBlog::Helpers # for try_read_config
|
211
230
|
|
212
|
-
|
213
|
-
sleep 0.2
|
214
|
-
puts
|
231
|
+
reopen_stderr
|
215
232
|
|
233
|
+
check_ruby_version
|
234
|
+
handle_cmdline unless ARGV.empty?
|
235
|
+
set_fgbg
|
236
|
+
print_intro
|
237
|
+
# STDERR.puts "cp 6 - pause"; gets
|
238
|
+
create_new_repo?
|
239
|
+
# STDERR.puts "cp 7 - pause"; gets
|
240
|
+
cmd_history_etc
|
241
|
+
# STDERR.puts "cp 8 - pause"; gets
|
242
|
+
loop { mainloop }
|
243
|
+
exit_repl
|
data/data/global.lt3
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
. <variable> <value>
|
4
4
|
. --------------------------------------------------
|
5
5
|
|
6
|
-
.variables view
|
6
|
+
.variables view ../settings/view.txt
|
7
7
|
|
8
|
-
.variables recent
|
8
|
+
.variables recent ../settings/recent.txt
|
9
9
|
|
10
|
-
.variables publish
|
10
|
+
.variables publish ../settings/publish.txt
|
11
11
|
|
12
12
|
.variables
|
13
13
|
host http://SITE
|
data/data/universal.lt3
CHANGED
File without changes
|
@@ -0,0 +1,209 @@
|
|
1
|
+
.highlight table td { padding: 5px; }
|
2
|
+
.highlight table pre { margin: 0; }
|
3
|
+
.highlight .cm {
|
4
|
+
color: #999988;
|
5
|
+
font-style: italic;
|
6
|
+
}
|
7
|
+
.highlight .cp {
|
8
|
+
color: #999999;
|
9
|
+
font-weight: bold;
|
10
|
+
}
|
11
|
+
.highlight .c1 {
|
12
|
+
color: #999988;
|
13
|
+
font-style: italic;
|
14
|
+
}
|
15
|
+
.highlight .cs {
|
16
|
+
color: #999999;
|
17
|
+
font-weight: bold;
|
18
|
+
font-style: italic;
|
19
|
+
}
|
20
|
+
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cpf {
|
21
|
+
color: #999988;
|
22
|
+
font-style: italic;
|
23
|
+
}
|
24
|
+
.highlight .err {
|
25
|
+
color: #a61717;
|
26
|
+
background-color: #e3d2d2;
|
27
|
+
}
|
28
|
+
.highlight .gd {
|
29
|
+
color: #000000;
|
30
|
+
background-color: #ffdddd;
|
31
|
+
}
|
32
|
+
.highlight .ge {
|
33
|
+
color: #000000;
|
34
|
+
font-style: italic;
|
35
|
+
}
|
36
|
+
.highlight .gr {
|
37
|
+
color: #aa0000;
|
38
|
+
}
|
39
|
+
.highlight .gh {
|
40
|
+
color: #999999;
|
41
|
+
}
|
42
|
+
.highlight .gi {
|
43
|
+
color: #000000;
|
44
|
+
background-color: #ddffdd;
|
45
|
+
}
|
46
|
+
.highlight .go {
|
47
|
+
color: #888888;
|
48
|
+
}
|
49
|
+
.highlight .gp {
|
50
|
+
color: #555555;
|
51
|
+
}
|
52
|
+
.highlight .gs {
|
53
|
+
font-weight: bold;
|
54
|
+
}
|
55
|
+
.highlight .gu {
|
56
|
+
color: #aaaaaa;
|
57
|
+
}
|
58
|
+
.highlight .gt {
|
59
|
+
color: #aa0000;
|
60
|
+
}
|
61
|
+
.highlight .kc {
|
62
|
+
color: #000000;
|
63
|
+
font-weight: bold;
|
64
|
+
}
|
65
|
+
.highlight .kd {
|
66
|
+
color: #000000;
|
67
|
+
font-weight: bold;
|
68
|
+
}
|
69
|
+
.highlight .kn {
|
70
|
+
color: #000000;
|
71
|
+
font-weight: bold;
|
72
|
+
}
|
73
|
+
.highlight .kp {
|
74
|
+
color: #000000;
|
75
|
+
font-weight: bold;
|
76
|
+
}
|
77
|
+
.highlight .kr {
|
78
|
+
color: #000000;
|
79
|
+
font-weight: bold;
|
80
|
+
}
|
81
|
+
.highlight .kt {
|
82
|
+
color: #445588;
|
83
|
+
font-weight: bold;
|
84
|
+
}
|
85
|
+
.highlight .k, .highlight .kv {
|
86
|
+
color: #000000;
|
87
|
+
font-weight: bold;
|
88
|
+
}
|
89
|
+
.highlight .mf {
|
90
|
+
color: #009999;
|
91
|
+
}
|
92
|
+
.highlight .mh {
|
93
|
+
color: #009999;
|
94
|
+
}
|
95
|
+
.highlight .il {
|
96
|
+
color: #009999;
|
97
|
+
}
|
98
|
+
.highlight .mi {
|
99
|
+
color: #009999;
|
100
|
+
}
|
101
|
+
.highlight .mo {
|
102
|
+
color: #009999;
|
103
|
+
}
|
104
|
+
.highlight .m, .highlight .mb, .highlight .mx {
|
105
|
+
color: #009999;
|
106
|
+
}
|
107
|
+
.highlight .sb {
|
108
|
+
color: #d14;
|
109
|
+
}
|
110
|
+
.highlight .sc {
|
111
|
+
color: #d14;
|
112
|
+
}
|
113
|
+
.highlight .sd {
|
114
|
+
color: #d14;
|
115
|
+
}
|
116
|
+
.highlight .s2 {
|
117
|
+
color: #d14;
|
118
|
+
}
|
119
|
+
.highlight .se {
|
120
|
+
color: #d14;
|
121
|
+
}
|
122
|
+
.highlight .sh {
|
123
|
+
color: #d14;
|
124
|
+
}
|
125
|
+
.highlight .si {
|
126
|
+
color: #d14;
|
127
|
+
}
|
128
|
+
.highlight .sx {
|
129
|
+
color: #d14;
|
130
|
+
}
|
131
|
+
.highlight .sr {
|
132
|
+
color: #009926;
|
133
|
+
}
|
134
|
+
.highlight .s1 {
|
135
|
+
color: #d14;
|
136
|
+
}
|
137
|
+
.highlight .ss {
|
138
|
+
color: #990073;
|
139
|
+
}
|
140
|
+
.highlight .s, .highlight .sa, .highlight .dl {
|
141
|
+
color: #d14;
|
142
|
+
}
|
143
|
+
.highlight .na {
|
144
|
+
color: #008080;
|
145
|
+
}
|
146
|
+
.highlight .bp {
|
147
|
+
color: #999999;
|
148
|
+
}
|
149
|
+
.highlight .nb {
|
150
|
+
color: #0086B3;
|
151
|
+
}
|
152
|
+
.highlight .nc {
|
153
|
+
color: #445588;
|
154
|
+
font-weight: bold;
|
155
|
+
}
|
156
|
+
.highlight .no {
|
157
|
+
color: #008080;
|
158
|
+
}
|
159
|
+
.highlight .nd {
|
160
|
+
color: #3c5d5d;
|
161
|
+
font-weight: bold;
|
162
|
+
}
|
163
|
+
.highlight .ni {
|
164
|
+
color: #800080;
|
165
|
+
}
|
166
|
+
.highlight .ne {
|
167
|
+
color: #990000;
|
168
|
+
font-weight: bold;
|
169
|
+
}
|
170
|
+
.highlight .nf, .highlight .fm {
|
171
|
+
color: #990000;
|
172
|
+
font-weight: bold;
|
173
|
+
}
|
174
|
+
.highlight .nl {
|
175
|
+
color: #990000;
|
176
|
+
font-weight: bold;
|
177
|
+
}
|
178
|
+
.highlight .nn {
|
179
|
+
color: #555555;
|
180
|
+
}
|
181
|
+
.highlight .nt {
|
182
|
+
color: #000080;
|
183
|
+
}
|
184
|
+
.highlight .vc {
|
185
|
+
color: #008080;
|
186
|
+
}
|
187
|
+
.highlight .vg {
|
188
|
+
color: #008080;
|
189
|
+
}
|
190
|
+
.highlight .vi {
|
191
|
+
color: #008080;
|
192
|
+
}
|
193
|
+
.highlight .nv, .highlight .vm {
|
194
|
+
color: #008080;
|
195
|
+
}
|
196
|
+
.highlight .ow {
|
197
|
+
color: #000000;
|
198
|
+
font-weight: bold;
|
199
|
+
}
|
200
|
+
.highlight .o {
|
201
|
+
color: #000000;
|
202
|
+
font-weight: bold;
|
203
|
+
}
|
204
|
+
.highlight .w {
|
205
|
+
color: #bbbbbb;
|
206
|
+
}
|
207
|
+
.highlight {
|
208
|
+
background-color: #f8f8f8;
|
209
|
+
}.highlight { font-family: courier; white-space: pre }
|