runeblog 0.3.26 → 0.3.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.lt3 +8 -5
- data/README.md +3 -1
- data/bin/blog +5 -3
- data/bin/blog.rb +237 -0
- data/data/global.lt3 +1 -1
- data/empty_view/config/reddit/redpost.rb +1 -6
- data/lib/helpers-blog.rb +0 -7
- data/lib/liveblog.rb +92 -91
- data/lib/lowlevel.rb +6 -5
- data/lib/menus.rb +96 -22
- data/lib/processing.rb +6 -3
- data/lib/repl.rb +18 -25
- data/lib/runeblog.rb +32 -43
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +2 -2
- data/runeblog.gemspec +1 -1
- metadata +18 -17
data/lib/liveblog.rb
CHANGED
@@ -49,20 +49,20 @@ end
|
|
49
49
|
def dropcap
|
50
50
|
log!(enter: __method__)
|
51
51
|
# Bad form: adds another HEAD
|
52
|
-
text =
|
53
|
-
|
52
|
+
text = api.data
|
53
|
+
api.out " "
|
54
54
|
letter = text[0]
|
55
55
|
remain = text[1..-1]
|
56
|
-
|
57
|
-
|
56
|
+
api.out %[<div class='mydrop'>#{letter}</div>]
|
57
|
+
api.out %[<div style="padding-top: 1px">#{remain}]
|
58
58
|
end
|
59
59
|
|
60
60
|
def post
|
61
61
|
log!(enter: __method__)
|
62
62
|
@meta = OpenStruct.new
|
63
|
-
@meta.num =
|
63
|
+
@meta.num = api.args[0]
|
64
64
|
setvar("post.num", @meta.num.to_i)
|
65
|
-
|
65
|
+
api.out " <!-- Post number #{@meta.num} -->\n "
|
66
66
|
end
|
67
67
|
|
68
68
|
def _got_python?
|
@@ -91,7 +91,7 @@ def post_toolbar
|
|
91
91
|
log!(enter: __method__)
|
92
92
|
back_icon = %[<img src="assets/back-icon.png" width=24 height=24 alt="Go back"></img>]
|
93
93
|
back = %[<a style="text-decoration: none" href="javascript:history.go(-1)">#{back_icon}</a>]
|
94
|
-
|
94
|
+
api.out <<~HTML
|
95
95
|
<div align='right'>#{back} #@reddit_comments</div>
|
96
96
|
HTML
|
97
97
|
end
|
@@ -138,7 +138,7 @@ log! str: " -- dir = #{dir}"
|
|
138
138
|
# damned syntax highlighting </>
|
139
139
|
end
|
140
140
|
# STDERR.print "Pausing... "; getch
|
141
|
-
|
141
|
+
api.out <<~HTML
|
142
142
|
#{reddit_txt}
|
143
143
|
<hr>
|
144
144
|
<table width=100%><tr>
|
@@ -151,27 +151,27 @@ end
|
|
151
151
|
def faq
|
152
152
|
log!(enter: __method__)
|
153
153
|
@faq_count ||= 0
|
154
|
-
|
154
|
+
api.out "<br>" if @faq_count == 0
|
155
155
|
@faq_count += 1
|
156
|
-
ques =
|
157
|
-
ans =
|
156
|
+
ques = api.data.chomp
|
157
|
+
ans = api.body.join("\n")
|
158
158
|
id = "faq#@faq_count"
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
159
|
+
api.out %[ <a data-toggle="collapse" href="##{id}" role="button" aria-expanded="false" aria-controls="collapseExample"><font size=+3>⌄</font></a>]
|
160
|
+
api.out %[ <b>#{ques}</b>]
|
161
|
+
api.out %[<div class="collapse" id="#{id}"><br><font size=+1> #{ans}</font></div>\n]
|
162
|
+
api.out "<br>" # unless @faq_count == 1
|
163
|
+
api.optional_blank_line
|
164
164
|
end
|
165
165
|
|
166
166
|
def backlink
|
167
167
|
log!(enter: __method__)
|
168
|
-
|
168
|
+
api.out %[<br><a href="javascript:history.go(-1)">[Back]</a>]
|
169
169
|
end
|
170
170
|
|
171
171
|
def code
|
172
172
|
log!(enter: __method__)
|
173
|
-
lines =
|
174
|
-
|
173
|
+
lines = api.body # _text
|
174
|
+
api.out "<font size=+1><pre>\n#{lines}\n</pre></font>"
|
175
175
|
end
|
176
176
|
|
177
177
|
def _read_navbar_data
|
@@ -191,7 +191,7 @@ def banner
|
|
191
191
|
str2 = ""
|
192
192
|
navbar = nil
|
193
193
|
vdir = @blog.root/:views/@blog.view
|
194
|
-
lines =
|
194
|
+
lines = api.body.to_a
|
195
195
|
|
196
196
|
lines.each do |line|
|
197
197
|
count += 1
|
@@ -234,14 +234,14 @@ def banner
|
|
234
234
|
str2 << " '#{tag}' isn't known" + "\n"
|
235
235
|
end
|
236
236
|
end
|
237
|
-
|
237
|
+
api.out <<~HTML
|
238
238
|
<table width=100% bgcolor=#{bg}>
|
239
239
|
<tr>
|
240
240
|
#{str2}
|
241
241
|
</tr>
|
242
242
|
</table>
|
243
243
|
HTML
|
244
|
-
|
244
|
+
api.out navbar if navbar
|
245
245
|
rescue => err
|
246
246
|
STDERR.puts "err = #{err}"
|
247
247
|
STDERR.puts err.backtrace.join("\n") if err.respond_to?(:backtrace)
|
@@ -306,7 +306,7 @@ end
|
|
306
306
|
def quote
|
307
307
|
log!(enter: __method__)
|
308
308
|
_passthru "<blockquote>"
|
309
|
-
_passthru
|
309
|
+
_passthru api.body.join(" ")
|
310
310
|
_passthru "</blockquote>"
|
311
311
|
_optional_blank_line
|
312
312
|
end
|
@@ -317,7 +317,7 @@ end
|
|
317
317
|
|
318
318
|
def style
|
319
319
|
log!(enter: __method__)
|
320
|
-
fname =
|
320
|
+
fname = api.args[0]
|
321
321
|
_passthru %[<link rel="stylesheet" href="???/etc/#{fname}')">]
|
322
322
|
end
|
323
323
|
|
@@ -333,43 +333,43 @@ def h6; _passthru "<h6>#{@_data}</h6>"; end
|
|
333
333
|
def hr; _passthru "<hr>"; end
|
334
334
|
|
335
335
|
def nlist
|
336
|
-
log!(enter:
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
336
|
+
log!(enter: api._method__)
|
337
|
+
api.out "<ol>"
|
338
|
+
api.body {|line| api.out "<li>#{line}</li>" }
|
339
|
+
api.out "</ol>"
|
340
|
+
api.optional_blank_line
|
341
341
|
end
|
342
342
|
|
343
343
|
def list
|
344
344
|
log!(enter: __method__)
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
345
|
+
api.out "<ul>"
|
346
|
+
api.body {|line| api.out "<li>#{line}</li>" }
|
347
|
+
api.out "</ul>"
|
348
|
+
api.optional_blank_line
|
349
349
|
end
|
350
350
|
|
351
351
|
def list!
|
352
352
|
log!(enter: __method__)
|
353
|
-
|
354
|
-
lines =
|
353
|
+
api.out "<ul>"
|
354
|
+
lines = api.body.each
|
355
355
|
loop do
|
356
356
|
line = lines.next
|
357
|
-
line =
|
357
|
+
line = api.format(line)
|
358
358
|
if line[0] == " "
|
359
|
-
|
359
|
+
api.out line
|
360
360
|
else
|
361
|
-
|
361
|
+
api.out "<li>#{line}</li>"
|
362
362
|
end
|
363
363
|
end
|
364
|
-
|
365
|
-
|
364
|
+
api.out "</ul>"
|
365
|
+
api.optional_blank_line
|
366
366
|
end
|
367
367
|
|
368
368
|
### inset
|
369
369
|
|
370
370
|
def inset
|
371
371
|
log!(enter: __method__)
|
372
|
-
lines =
|
372
|
+
lines = api.body
|
373
373
|
box = ""
|
374
374
|
output = []
|
375
375
|
lines.each do |line|
|
@@ -387,16 +387,16 @@ def inset
|
|
387
387
|
output << line
|
388
388
|
end
|
389
389
|
end
|
390
|
-
lr =
|
391
|
-
wide =
|
390
|
+
lr = api.args.first
|
391
|
+
wide = api.args[1] || "25"
|
392
392
|
stuff = "<div style='float:#{lr}; width: #{wide}%; padding:8px; padding-right:12px'>"
|
393
393
|
stuff << '<b><i>' + box + '</i></b></div>'
|
394
|
-
|
394
|
+
api.out "</p>" # kludge!! nopara
|
395
395
|
0.upto(2) {|i| _passthru output[i] }
|
396
396
|
_passthru stuff
|
397
397
|
3.upto(output.length-1) {|i| _passthru output[i] }
|
398
|
-
|
399
|
-
|
398
|
+
api.out "<p>" # kludge!! para
|
399
|
+
api.optional_blank_line
|
400
400
|
end
|
401
401
|
|
402
402
|
def title
|
@@ -406,42 +406,42 @@ def title
|
|
406
406
|
@meta.title = title
|
407
407
|
setvar :title, title
|
408
408
|
# FIXME refactor -- just output variables for a template
|
409
|
-
|
409
|
+
api.optional_blank_line
|
410
410
|
end
|
411
411
|
|
412
412
|
def pubdate
|
413
413
|
log!(enter: __method__)
|
414
414
|
raise NoPostCall unless @meta
|
415
|
-
|
415
|
+
api.debug "data = #@_data"
|
416
416
|
# Check for discrepancy?
|
417
417
|
match = /(\d{4}).(\d{2}).(\d{2})/.match @_data
|
418
418
|
junk, y, m, d = match.to_a
|
419
419
|
y, m, d = y.to_i, m.to_i, d.to_i
|
420
420
|
@meta.date = ::Date.new(y, m, d)
|
421
421
|
@meta.pubdate = "%04d-%02d-%02d" % [y, m, d]
|
422
|
-
|
422
|
+
api.optional_blank_line
|
423
423
|
end
|
424
424
|
|
425
425
|
def tags
|
426
426
|
log!(enter: __method__)
|
427
427
|
raise NoPostCall unless @meta
|
428
|
-
|
429
|
-
@meta.tags =
|
430
|
-
|
428
|
+
api.debug "args = #{_args}"
|
429
|
+
@meta.tags = api.args.dup || []
|
430
|
+
api.optional_blank_line
|
431
431
|
end
|
432
432
|
|
433
433
|
def views
|
434
434
|
log!(enter: __method__)
|
435
435
|
raise NoPostCall unless @meta
|
436
|
-
|
437
|
-
@meta.views =
|
438
|
-
|
436
|
+
api.debug "data = #{_args}"
|
437
|
+
@meta.views = api.args.dup
|
438
|
+
api.optional_blank_line
|
439
439
|
end
|
440
440
|
|
441
441
|
def pin
|
442
442
|
log!(enter: __method__)
|
443
443
|
raise NoPostCall unless @meta
|
444
|
-
|
444
|
+
api.debug "data = #{_args}" # verify only valid views?
|
445
445
|
pinned = @_args
|
446
446
|
@meta.pinned = pinned
|
447
447
|
pinned.each do |pinview|
|
@@ -452,7 +452,7 @@ def pin
|
|
452
452
|
pins.uniq!
|
453
453
|
File.open(datafile, "w") {|out| pins.each {|pin| out.puts pin } }
|
454
454
|
end
|
455
|
-
|
455
|
+
api.optional_blank_line
|
456
456
|
rescue => err
|
457
457
|
STDERR.puts "err = #{err}"
|
458
458
|
STDERR.puts err.backtrace.join("\n") if err.respond_to?(:backtrace)
|
@@ -472,15 +472,15 @@ end
|
|
472
472
|
def teaser
|
473
473
|
log!(enter: __method__)
|
474
474
|
raise NoPostCall unless @meta
|
475
|
-
text =
|
475
|
+
text = api.body.join("\n")
|
476
476
|
@meta.teaser = text
|
477
477
|
setvar :teaser, @meta.teaser
|
478
|
-
if
|
478
|
+
if api.args[0] == "dropcap" # FIXME doesn't work yet!
|
479
479
|
letter, remain = text[0], text[1..-1]
|
480
|
-
|
481
|
-
|
480
|
+
api.out %[<div class='mydrop'>#{letter}</div>]
|
481
|
+
api.out %[<div style="padding-top: 1px">#{remain}] + "\n"
|
482
482
|
else
|
483
|
-
|
483
|
+
api.out @meta.teaser + "\n"
|
484
484
|
end
|
485
485
|
end
|
486
486
|
|
@@ -498,10 +498,10 @@ end
|
|
498
498
|
|
499
499
|
def head # Does NOT output <head> tags
|
500
500
|
log!(enter: __method__)
|
501
|
-
args =
|
501
|
+
args = api.args
|
502
502
|
args.each do |inc|
|
503
503
|
self.data = inc
|
504
|
-
|
504
|
+
dot_include
|
505
505
|
end
|
506
506
|
# Depends on vars: title, desc, host
|
507
507
|
defaults = {}
|
@@ -522,7 +522,7 @@ def head # Does NOT output <head> tags
|
|
522
522
|
"favicon" => %[<link rel="shortcut icon" type="image/x-icon" href="etc/favicon.ico">\n <link rel="apple-touch-icon" href="etc/favicon.ico">]
|
523
523
|
}
|
524
524
|
result = {}
|
525
|
-
lines =
|
525
|
+
lines = api.body
|
526
526
|
lines.each do |line|
|
527
527
|
line.chomp
|
528
528
|
word, remain = line.split(" ", 2)
|
@@ -547,14 +547,14 @@ def head # Does NOT output <head> tags
|
|
547
547
|
end
|
548
548
|
hash = defaults.dup.update(result) # FIXME collisions?
|
549
549
|
|
550
|
-
hash.each_value {|x|
|
550
|
+
hash.each_value {|x| api.out " " + x }
|
551
551
|
end
|
552
552
|
|
553
553
|
########## newer stuff...
|
554
554
|
|
555
555
|
def meta
|
556
556
|
log!(enter: __method__)
|
557
|
-
args =
|
557
|
+
args = api.args
|
558
558
|
enum = args.each
|
559
559
|
str = "<meta"
|
560
560
|
arg = enum.next
|
@@ -569,12 +569,12 @@ def meta
|
|
569
569
|
arg = enum.next
|
570
570
|
end
|
571
571
|
str << ">"
|
572
|
-
|
572
|
+
api.out str
|
573
573
|
end
|
574
574
|
|
575
575
|
def recent_posts # side-effect
|
576
576
|
log!(enter: __method__)
|
577
|
-
|
577
|
+
api.out <<-HTML
|
578
578
|
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
|
579
579
|
<iframe id="main" style="width: 70vw; height: 100vh; position: relative;"
|
580
580
|
src='recent.html' width=100% frameborder="0" allowfullscreen>
|
@@ -623,17 +623,18 @@ end
|
|
623
623
|
|
624
624
|
def sidebar
|
625
625
|
log!(enter: __method__)
|
626
|
-
|
627
|
-
if
|
628
|
-
|
626
|
+
api.debug "--- handling sidebar\r"
|
627
|
+
if api.args.include? "off"
|
628
|
+
api.body { } # iterate, do nothing
|
629
629
|
return
|
630
630
|
end
|
631
631
|
|
632
|
-
|
632
|
+
api.out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
|
633
633
|
|
634
634
|
standard = %w[pinned pages links news]
|
635
635
|
|
636
|
-
|
636
|
+
lines = api.body.to_a
|
637
|
+
lines.each do |token|
|
637
638
|
tag = token.chomp.strip.downcase
|
638
639
|
wtag = "../../widgets"/tag
|
639
640
|
raise CantFindWidgetDir(wtag) unless Dir.exist?(wtag)
|
@@ -645,9 +646,9 @@ def sidebar
|
|
645
646
|
raise "Nonstandard widget?"
|
646
647
|
end
|
647
648
|
|
648
|
-
|
649
|
+
api.include_file wtag/tcard
|
649
650
|
end
|
650
|
-
|
651
|
+
api.out %[</div>]
|
651
652
|
rescue => err
|
652
653
|
puts "err = #{err}"
|
653
654
|
puts err.backtrace.join("\n") if err.respond_to?(:backtrace)
|
@@ -657,20 +658,20 @@ end
|
|
657
658
|
|
658
659
|
def stylesheet
|
659
660
|
log!(enter: __method__)
|
660
|
-
lines =
|
661
|
+
lines = api.body
|
661
662
|
url = lines[0]
|
662
663
|
integ = lines[1]
|
663
664
|
cross = lines[2] || "anonymous"
|
664
|
-
|
665
|
+
api.out %[<link rel="stylesheet" href="#{url}" integrity="#{integ}" crossorigin="#{cross}"></link>]
|
665
666
|
end
|
666
667
|
|
667
668
|
def script
|
668
669
|
log!(enter: __method__)
|
669
|
-
lines =
|
670
|
+
lines = api.body
|
670
671
|
url = lines[0]
|
671
672
|
integ = lines[1]
|
672
673
|
cross = lines[2] || "anonymous"
|
673
|
-
|
674
|
+
api.out %[<script src="#{url}" integrity="#{integ}" crossorigin="#{cross}"></script>]
|
674
675
|
end
|
675
676
|
|
676
677
|
$Dot = self # Clunky! for dot commands called from Functions class
|
@@ -716,7 +717,7 @@ end
|
|
716
717
|
|
717
718
|
def tag_cloud
|
718
719
|
log!(enter: __method__)
|
719
|
-
title =
|
720
|
+
title = api.data
|
720
721
|
title = "Tag Cloud" if title.empty?
|
721
722
|
open = <<-HTML
|
722
723
|
<div class="card mb-3">
|
@@ -727,15 +728,15 @@ def tag_cloud
|
|
727
728
|
</h5>
|
728
729
|
<div class="collapse" id="tag-cloud">
|
729
730
|
HTML
|
730
|
-
|
731
|
-
|
731
|
+
api.out open
|
732
|
+
api.body do |line|
|
732
733
|
line.chomp!
|
733
734
|
url, classname, cdata = line.split(",", 3)
|
734
735
|
main = _main(url)
|
735
|
-
|
736
|
+
api.out %[<a #{main} class="#{classname}">#{cdata}</a>]
|
736
737
|
end
|
737
738
|
close = %[ </div>\n </div>\n </div>]
|
738
|
-
|
739
|
+
api.out close
|
739
740
|
end
|
740
741
|
|
741
742
|
def vnavbar
|
@@ -785,7 +786,7 @@ def _make_navbar(orient = :horiz)
|
|
785
786
|
output = File.new(html_file, "w")
|
786
787
|
output.puts start
|
787
788
|
lines = _read_navbar_data
|
788
|
-
lines = ["index Home"] + lines unless
|
789
|
+
lines = ["index Home"] + lines unless api.args.include?("nohome")
|
789
790
|
lines.each do |line|
|
790
791
|
basename, cdata = line.chomp.strip.split(" ", 2)
|
791
792
|
full = :banner/:navbar/basename+".html"
|
@@ -831,16 +832,16 @@ def _passthru(line)
|
|
831
832
|
log!(enter: __method__)
|
832
833
|
return if line.nil?
|
833
834
|
line = _format(line)
|
834
|
-
|
835
|
-
|
835
|
+
api.out line + "\n"
|
836
|
+
api.out "<p>" if line.empty? && ! @_nopara
|
836
837
|
end
|
837
838
|
|
838
839
|
def _passthru_noline(line)
|
839
840
|
log!(enter: __method__)
|
840
841
|
return if line.nil?
|
841
842
|
line = _format(line)
|
842
|
-
|
843
|
-
|
843
|
+
api.out line
|
844
|
+
api.out "<p>" if line.empty? && ! @_nopara
|
844
845
|
end
|
845
846
|
|
846
847
|
def _write_metadata
|
@@ -891,7 +892,7 @@ def _card_generic(card_title:, middle:, extra: "")
|
|
891
892
|
</div>
|
892
893
|
HTML
|
893
894
|
text = front + middle + tail
|
894
|
-
|
895
|
+
api.out text + "\n "
|
895
896
|
end
|
896
897
|
|
897
898
|
def _var(name) # FIXME scope issue!
|
data/lib/lowlevel.rb
CHANGED
@@ -23,13 +23,14 @@
|
|
23
23
|
File.open(file, "a") {|f| f.puts "#{Time.now} #{line}" }
|
24
24
|
end
|
25
25
|
|
26
|
-
def system!(
|
27
|
-
log!(enter: __method__, args: [
|
28
|
-
|
29
|
-
|
26
|
+
def system!(os_cmd, show: false)
|
27
|
+
log!(enter: __method__, args: [os_cmd], level: 2)
|
28
|
+
caller.each {|x| print "::: "; p x }
|
29
|
+
STDERR.puts os_cmd if show
|
30
|
+
rc = system(os_cmd)
|
30
31
|
STDERR.puts " rc = #{rc.inspect}" if show
|
31
32
|
return rc if rc
|
32
|
-
STDERR.puts "FAILED: #{
|
33
|
+
STDERR.puts "FAILED: #{os_cmd.inspect}"
|
33
34
|
STDERR.puts "\ncaller = \n#{caller.join("\n ")}\n"
|
34
35
|
if defined?(RubyText)
|
35
36
|
sleep 6
|
data/lib/menus.rb
CHANGED
@@ -14,33 +14,107 @@ notimp = proc { RubyText.splash("Not implemented yet") }
|
|
14
14
|
top_about = proc { RubyText.splash("RuneBlog v #{RuneBlog::VERSION}") }
|
15
15
|
top_help = proc { RubyText.splash(RuneBlog::REPL::Help.gsub(/[{}]/, " ")) }
|
16
16
|
|
17
|
+
def edit_blog_generate
|
18
|
+
edit_file("#@std/blog/generate.lt3")
|
19
|
+
end
|
20
|
+
|
21
|
+
def edit_blog_head
|
22
|
+
edit_file("#@std/blog/head.lt3")
|
23
|
+
end
|
24
|
+
|
25
|
+
def edit_blog_index
|
26
|
+
edit_file("#@std/blog/index.lt3")
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit_post_entry
|
30
|
+
edit_file("#@std/blog/post_entry.lt3")
|
31
|
+
end
|
32
|
+
|
33
|
+
def edit_blog_banner
|
34
|
+
edit_file("#@std/banner/banner.lt3")
|
35
|
+
end
|
36
|
+
|
37
|
+
def edit_blog_navbar
|
38
|
+
edit_file("#@std/navbar/navbar.lt3")
|
39
|
+
end
|
40
|
+
|
41
|
+
def edit_post_generate
|
42
|
+
edit_file("#@std/post/generate.lt3")
|
43
|
+
end
|
44
|
+
|
45
|
+
def edit_post_head
|
46
|
+
edit_file("#@std/post/head.lt3")
|
47
|
+
end
|
48
|
+
|
49
|
+
def edit_post_index
|
50
|
+
edit_file("#@std/post/index.lt3")
|
51
|
+
end
|
52
|
+
|
53
|
+
def edit_view_global
|
54
|
+
edit_file("#@data/global.lt3")
|
55
|
+
end
|
56
|
+
|
57
|
+
def edit_settings_view
|
58
|
+
edit_file("settings/view.txt")
|
59
|
+
end
|
60
|
+
|
61
|
+
def edit_settings_recent
|
62
|
+
edit_file("settings/recent.txt")
|
63
|
+
end
|
64
|
+
|
65
|
+
def edit_settings_publish
|
66
|
+
edit_file("settings/publish.txt")
|
67
|
+
end
|
68
|
+
|
69
|
+
def edit_settings_features
|
70
|
+
edit_file("settings/features.txt")
|
71
|
+
end
|
72
|
+
|
73
|
+
def edit_config_reddit
|
74
|
+
edit_file("config/reddit/credentials.txt")
|
75
|
+
end
|
76
|
+
|
77
|
+
def edit_config_facebook
|
78
|
+
edit_file("config/facebook/credentials.txt")
|
79
|
+
end
|
80
|
+
|
81
|
+
def edit_config_twitter
|
82
|
+
edit_file("config/twitter/credentials.txt")
|
83
|
+
end
|
84
|
+
|
85
|
+
def edit_etc_blog_css
|
86
|
+
edit_file("#@std/etc/blog.css.lt3")
|
87
|
+
end
|
88
|
+
|
89
|
+
def edit_etc_externals
|
90
|
+
edit_file("#@std/etc/externals.lt3")
|
91
|
+
end
|
17
92
|
|
18
93
|
# dir = @blog.view.dir/"themes/standard/"
|
19
94
|
|
20
|
-
std
|
21
|
-
data = "." # CHANGED
|
95
|
+
@std = "themes/standard"
|
96
|
+
@data = "." # CHANGED
|
22
97
|
|
23
98
|
Menu.top_config = {
|
24
|
-
"View: generator" =>
|
25
|
-
" HEAD info" =>
|
26
|
-
" Layout " =>
|
27
|
-
" Recent-posts entry" =>
|
28
|
-
" Banner: Description" =>
|
29
|
-
" Navbar" =>
|
30
|
-
|
31
|
-
"
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"External JS/CSS (Bootstrap, etc.)" => edit("/etc/externals.lt3")
|
99
|
+
"View: generator" => proc { edit_blog_generate },
|
100
|
+
" HEAD info" => proc { edit_blog_head },
|
101
|
+
" Layout " => proc { edit_blog/index },
|
102
|
+
" Recent-posts entry" => proc { edit_post_entry },
|
103
|
+
" Banner: Description" => proc { edit_banner },
|
104
|
+
" Navbar" => proc { edit_navbar },
|
105
|
+
"Generator for a post" => proc { edit_post_generate },
|
106
|
+
" HEAD info for post" => proc { edit_post_head },
|
107
|
+
" Content for post" => proc { edit_post_index },
|
108
|
+
"Variables (general)" => proc { edit_view_global },
|
109
|
+
" View-specific" => proc { edit_settings_view },
|
110
|
+
" Recent posts" => proc { edit_settings_recent },
|
111
|
+
" Publishing" => proc { edit_settings_publish },
|
112
|
+
"Configuration: enable/disable" => proc { edit_settings_features },
|
113
|
+
" Reddit" => proc { edit_config_reddit },
|
114
|
+
" Facebook" => proc { edit_config_facebook },
|
115
|
+
" Twitter" => proc { edit_config_twitter },
|
116
|
+
"Global CSS" => proc { edit_etc_blog_css },
|
117
|
+
"External JS/CSS (Bootstrap, etc.)" => proc { edit_etc_externals }
|
44
118
|
}
|
45
119
|
|
46
120
|
Menu.top_build = {
|
data/lib/processing.rb
CHANGED
@@ -77,11 +77,14 @@ rescue => err
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def get_live_vars(src)
|
80
|
+
dir, base = File.dirname(src), File.basename(src)
|
80
81
|
live = Livetext.customize(call: [".nopara"])
|
81
|
-
|
82
|
-
# STDERR.puts "glv: src = #{src.inspect}"
|
83
|
-
live.xform_file(src)
|
82
|
+
Dir.chdir(dir) { live.xform_file(base) }
|
84
83
|
live
|
84
|
+
rescue => e
|
85
|
+
puts e
|
86
|
+
puts $!
|
87
|
+
gets
|
85
88
|
end
|
86
89
|
|
87
90
|
end
|