runeblog 0.3.35 → 0.3.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/global.lt3 +3 -3
- data/empty_view/themes/standard/blog/index.lt3 +8 -4
- data/lib/liveblog.rb +1 -0
- data/lib/lowlevel.rb +19 -7
- data/lib/processing.rb +6 -0
- data/lib/repl.rb +2 -4
- data/lib/runeblog.rb +1 -4
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +0 -2
- data/runeblog.gemspec +2 -2
- data/test/.blogs/data/VERSION +2 -2
- data/test/.blogs/data/global.lt3 +3 -3
- data/test/.blogs/data/sequence +1 -1
- data/test/.blogs/drafts/0001-whats-at-stubbs.lt3 +13 -0
- data/test/.blogs/drafts/0002-the-new-amphitheatre-is-overrated.lt3 +14 -0
- data/test/.blogs/drafts/0003-the-graffiti-wall.lt3 +42 -0
- data/test/.blogs/drafts/0004-the-waller-creek-project.lt3 +13 -0
- data/test/.blogs/drafts/0005-life-on-sabine-street.lt3 +13 -0
- data/test/.blogs/drafts/0006-remember-modest-mouse.lt3 +14 -0
- data/test/.blogs/posts/0001-whats-at-stubbs/guts.html +6 -0
- data/test/.blogs/posts/0001-whats-at-stubbs/metadata.txt +7 -0
- data/test/.blogs/posts/0001-whats-at-stubbs/teaser.txt +1 -0
- data/test/.blogs/posts/0002-the-new-amphitheatre-is-overrated/guts.html +6 -0
- data/test/.blogs/posts/0002-the-new-amphitheatre-is-overrated/metadata.txt +7 -0
- data/test/.blogs/posts/0002-the-new-amphitheatre-is-overrated/teaser.txt +1 -0
- data/test/.blogs/posts/0003-the-graffiti-wall/guts.html +6 -0
- data/test/.blogs/posts/0003-the-graffiti-wall/metadata.txt +7 -0
- data/test/.blogs/posts/0003-the-graffiti-wall/teaser.txt +1 -0
- data/test/.blogs/posts/0004-the-waller-creek-project/guts.html +6 -0
- data/test/.blogs/posts/0004-the-waller-creek-project/metadata.txt +7 -0
- data/test/.blogs/posts/0004-the-waller-creek-project/teaser.txt +1 -0
- data/test/.blogs/posts/0005-life-on-sabine-street/guts.html +6 -0
- data/test/.blogs/posts/0005-life-on-sabine-street/metadata.txt +7 -0
- data/test/.blogs/posts/0005-life-on-sabine-street/teaser.txt +1 -0
- data/test/.blogs/posts/0006-remember-modest-mouse/guts.html +6 -0
- data/test/.blogs/posts/0006-remember-modest-mouse/metadata.txt +7 -0
- data/test/.blogs/posts/0006-remember-modest-mouse/teaser.txt +1 -0
- data/test/.blogs/views/around_austin/global.lt3 +3 -3
- data/test/.blogs/views/around_austin/posts/0001-whats-at-stubbs/guts.html +6 -0
- data/test/.blogs/views/around_austin/posts/0001-whats-at-stubbs/metadata.txt +7 -0
- data/test/.blogs/views/around_austin/posts/0001-whats-at-stubbs/teaser.txt +1 -0
- data/test/.blogs/views/around_austin/posts/0002-the-new-amphitheatre-is-overrated/guts.html +6 -0
- data/test/.blogs/views/around_austin/posts/0002-the-new-amphitheatre-is-overrated/metadata.txt +7 -0
- data/test/.blogs/views/around_austin/posts/0002-the-new-amphitheatre-is-overrated/teaser.txt +1 -0
- data/test/.blogs/views/around_austin/posts/0003-the-graffiti-wall/guts.html +6 -0
- data/test/.blogs/views/around_austin/posts/0003-the-graffiti-wall/metadata.txt +7 -0
- data/test/.blogs/views/around_austin/posts/0003-the-graffiti-wall/teaser.txt +1 -0
- data/test/.blogs/views/around_austin/posts/0004-the-waller-creek-project/guts.html +6 -0
- data/test/.blogs/views/around_austin/posts/0004-the-waller-creek-project/metadata.txt +7 -0
- data/test/.blogs/views/around_austin/posts/0004-the-waller-creek-project/teaser.txt +1 -0
- data/test/.blogs/views/around_austin/posts/0005-life-on-sabine-street/guts.html +6 -0
- data/test/.blogs/views/around_austin/posts/0005-life-on-sabine-street/metadata.txt +7 -0
- data/test/.blogs/views/around_austin/posts/0005-life-on-sabine-street/teaser.txt +1 -0
- data/test/.blogs/views/around_austin/posts/0006-remember-modest-mouse/guts.html +6 -0
- data/test/.blogs/views/around_austin/posts/0006-remember-modest-mouse/metadata.txt +7 -0
- data/test/.blogs/views/around_austin/posts/0006-remember-modest-mouse/teaser.txt +1 -0
- data/test/.blogs/views/around_austin/remote/banner/navbar/about.html +10 -0
- data/test/.blogs/views/around_austin/remote/banner/navbar/contact.html +10 -0
- data/test/.blogs/views/around_austin/remote/banner/navbar/faq.html +46 -0
- data/test/.blogs/views/around_austin/remote/etc/blog.css +66 -0
- data/test/.blogs/views/around_austin/remote/history +6 -0
- data/test/.blogs/views/around_austin/remote/life-on-sabine-street.html +2 -0
- data/test/.blogs/views/around_austin/remote/recent.html +4 -0
- data/test/.blogs/views/around_austin/remote/remember-modest-mouse.html +2 -0
- data/test/.blogs/views/around_austin/remote/the-graffiti-wall.html +2 -0
- data/test/.blogs/views/around_austin/remote/the-new-amphitheatre-is-overrated.html +2 -0
- data/test/.blogs/views/around_austin/remote/the-waller-creek-project.html +2 -0
- data/test/.blogs/views/around_austin/remote/whats-at-stubbs.html +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/bydates/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/bydates/bydates.rb +18 -0
- data/test/.blogs/views/around_austin/remote/widgets/bydates/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/bydates/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/bydates/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/links/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/links/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/links/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/links/links.rb +90 -0
- data/test/.blogs/views/around_austin/remote/widgets/links/list.data +3 -0
- data/test/.blogs/views/around_austin/remote/widgets/links/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/news/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/news/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/news/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/news/list.data +4 -0
- data/test/.blogs/views/around_austin/remote/widgets/news/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/news/news.rb +88 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/disclaim.lt3 +10 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/faq.lt3 +41 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/like-dislike.lt3 +11 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/list.data +4 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/local.rb +0 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/other-stuff.lt3 +10 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/pages.rb +130 -0
- data/test/.blogs/views/around_austin/remote/widgets/pinned/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/pinned/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/pinned/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/pinned/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/pinned/pinned.rb +111 -0
- data/test/.blogs/views/around_austin/remote/widgets/search/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/search/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/search/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/search/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/search/search.rb +18 -0
- data/test/.blogs/views/around_austin/remote/widgets/sitemap/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/sitemap/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/sitemap/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/sitemap/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/sitemap/sitemap.rb +18 -0
- data/test/.blogs/views/around_austin/remote/widgets/tag-cloud/OLD-example.lt3 +12 -0
- data/test/.blogs/views/around_austin/remote/widgets/tag-cloud/README +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/tag-cloud/card.css +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/tag-cloud/custom.rb +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/tag-cloud/main.css +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/tag-cloud/tag-cloud.lt3 +3 -0
- data/test/.blogs/views/around_austin/remote/widgets/tag-cloud/tag-cloud.rb +18 -0
- data/test/.blogs/views/around_austin/settings/view.txt +4 -4
- data/test/.blogs/views/around_austin/themes/standard/banner/navbar/navbar.html +10 -0
- data/test/.blogs/views/around_austin/themes/standard/banner/top.html +22 -0
- data/test/.blogs/views/around_austin/themes/standard/blog/index.lt3 +8 -4
- data/test/.blogs/views/around_austin/themes/standard/etc/blog.css +66 -0
- data/test/.blogs/views/around_austin/widgets/links/links-card.html +18 -0
- data/test/.blogs/views/around_austin/widgets/links/links-main.html +13 -0
- data/test/binblog.txt +2 -0
- data/test/stderr.out +0 -0
- metadata +119 -9
- data/test/.blogs/views/around_austin/themes/standard/global.lt3 +0 -20
@@ -0,0 +1,46 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<p>
|
4
|
+
|
5
|
+
<style>
|
6
|
+
body { font-family: verdana }
|
7
|
+
</style>
|
8
|
+
<p>
|
9
|
+
|
10
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
11
|
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"></link>
|
12
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap-theme.min.css"></link>
|
13
|
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
14
|
+
<p>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
<p>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<p>
|
21
|
+
|
22
|
+
<h2>Frequently Asked Questions</h2>
|
23
|
+
<p>
|
24
|
+
|
25
|
+
<br>
|
26
|
+
<a data-toggle="collapse" href="#faq1" role="button" aria-expanded="false" aria-controls="collapseExample"><font size=+3>⌄</font></a>
|
27
|
+
<b>Are you a rabbit?</b>
|
28
|
+
<div class="collapse" id="faq1"><br><font size=+1> Yes, I am.</font></div>
|
29
|
+
<br>
|
30
|
+
<a data-toggle="collapse" href="#faq2" role="button" aria-expanded="false" aria-controls="collapseExample"><font size=+3>⌄</font></a>
|
31
|
+
<b>Are you a frog?</b>
|
32
|
+
<div class="collapse" id="faq2"><br><font size=+1> Don't be stupid. I just told you I was a rabbit.</font></div>
|
33
|
+
<br>
|
34
|
+
<a data-toggle="collapse" href="#faq3" role="button" aria-expanded="false" aria-controls="collapseExample"><font size=+3>⌄</font></a>
|
35
|
+
<b>Why do you answer a question with a question?</b>
|
36
|
+
<div class="collapse" id="faq3"><br><font size=+1> <b>Do</b> I in fact answer a question with a question?</font></div>
|
37
|
+
<br>
|
38
|
+
<a data-toggle="collapse" href="#faq4" role="button" aria-expanded="false" aria-controls="collapseExample"><font size=+3>⌄</font></a>
|
39
|
+
<b>Are you serious?</b>
|
40
|
+
<div class="collapse" id="faq4"><br><font size=+1> No, I'm a rabbit.</font></div>
|
41
|
+
<br>
|
42
|
+
<br><a href="javascript:history.go(-1)">[Back]</a>
|
43
|
+
<p>
|
44
|
+
|
45
|
+
</body>
|
46
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
|
5
|
+
body { font-family: verdana }
|
6
|
+
<p>
|
7
|
+
|
8
|
+
.recent-title a {
|
9
|
+
color: [recent.title.color is undefined];
|
10
|
+
font-family: verdana;
|
11
|
+
font-size: [recent.title.size is undefined];
|
12
|
+
float: right;
|
13
|
+
display: inline-block;
|
14
|
+
text-align: top;
|
15
|
+
text-decoration: none;
|
16
|
+
}
|
17
|
+
<p>
|
18
|
+
|
19
|
+
.recent-title a:hover {
|
20
|
+
text-decoration: none;
|
21
|
+
}
|
22
|
+
<p>
|
23
|
+
|
24
|
+
.recent-title-text a {
|
25
|
+
color: [recent.text.color is undefined];
|
26
|
+
font-family: verdana;
|
27
|
+
font-size: [recent.text.size is undefined];
|
28
|
+
display: block;
|
29
|
+
text-decoration: none;
|
30
|
+
}
|
31
|
+
<p>
|
32
|
+
|
33
|
+
.recent-title-text a:hover {
|
34
|
+
text-decoration: none;
|
35
|
+
}
|
36
|
+
<p>
|
37
|
+
|
38
|
+
.recent-date {
|
39
|
+
color: [recent.date.color is undefined];
|
40
|
+
font-family: verdana;
|
41
|
+
font-size: [recent.date.size is undefined];
|
42
|
+
display: block;
|
43
|
+
float: left;
|
44
|
+
text-align: top;
|
45
|
+
}
|
46
|
+
<p>
|
47
|
+
|
48
|
+
.mydrop {
|
49
|
+
color: #444444;
|
50
|
+
float: left;
|
51
|
+
text-align: top;
|
52
|
+
# font-family: Verdana;
|
53
|
+
font-size: 38px;
|
54
|
+
line-height: 38px;
|
55
|
+
# padding-top: 0px;
|
56
|
+
padding-right: 8px;
|
57
|
+
padding-left: 3px;
|
58
|
+
}
|
59
|
+
<p>
|
60
|
+
|
61
|
+
.thumbnail img {
|
62
|
+
max-height: 100%;
|
63
|
+
max-width: 100%;
|
64
|
+
}
|
65
|
+
<p>
|
66
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
# CSS for sidebar card
|
@@ -0,0 +1 @@
|
|
1
|
+
# This is for specialized livetext add-ons (Ruby methods)
|
@@ -0,0 +1 @@
|
|
1
|
+
# CSS for sidebar card
|
@@ -0,0 +1 @@
|
|
1
|
+
# This is for specialized livetext add-ons (Ruby methods)
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# Custom code for 'links' widget
|
2
|
+
|
3
|
+
require 'liveblog'
|
4
|
+
|
5
|
+
class ::RuneBlog::Widget
|
6
|
+
class Links
|
7
|
+
Type, Title = "links", "External links"
|
8
|
+
|
9
|
+
def initialize(repo)
|
10
|
+
@blog = repo
|
11
|
+
@datafile = input = "list.data"
|
12
|
+
@lines = _get_data(@datafile)
|
13
|
+
end
|
14
|
+
|
15
|
+
def build
|
16
|
+
write_main
|
17
|
+
write_card
|
18
|
+
end
|
19
|
+
|
20
|
+
def _html_body(file, css = nil)
|
21
|
+
file.puts "<html>"
|
22
|
+
if css
|
23
|
+
file.puts " <head>"
|
24
|
+
file.puts " <style>\n#{css}\n </style>"
|
25
|
+
file.puts " </head>"
|
26
|
+
end
|
27
|
+
file.puts " <body>"
|
28
|
+
yield
|
29
|
+
file.puts " </body>\n</html>"
|
30
|
+
end
|
31
|
+
|
32
|
+
def write_main
|
33
|
+
@data = @lines.map! {|x| x.chomp.split(/, */, 3) }
|
34
|
+
css = "body { font-family: verdana }"
|
35
|
+
card_title = Title
|
36
|
+
File.open("#{Type}-main.html", "w") do |f|
|
37
|
+
_html_body(f, css) do
|
38
|
+
f.puts "<h1>#{card_title}</h1><br><hr>"
|
39
|
+
url_ref = nil
|
40
|
+
@data.each do |url, frameable, title|
|
41
|
+
url_ref = "href = '#{url}'"
|
42
|
+
url_ref << " target=blank" if frameable == "yes"
|
43
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px"
|
44
|
+
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def write_card
|
51
|
+
tag = "links"
|
52
|
+
url = :widgets/tag/tag+"-main.html"
|
53
|
+
card_title = "External links" # FIXME
|
54
|
+
cardfile = "#{Type}-card"
|
55
|
+
File.open("#{cardfile}.html", "w") do |f|
|
56
|
+
f.puts <<-EOS
|
57
|
+
<div class="card mb-3">
|
58
|
+
<div class="card-body">
|
59
|
+
<h5 class="card-title">
|
60
|
+
<button type="button" class="btn btn-primary" data-toggle="collapse" data-target="##{tag}">+</button>
|
61
|
+
<a href="javascript: void(0)"
|
62
|
+
onclick="javascript:open_main('#{url}')"
|
63
|
+
style="text-decoration: none; color: black"> #{card_title}</a>
|
64
|
+
</h5>
|
65
|
+
<div class="collapse" id="#{tag}">
|
66
|
+
EOS
|
67
|
+
@data.each do |url2, frameable, title|
|
68
|
+
f.puts "<!-- #{[url2, frameable, title].inspect} -->"
|
69
|
+
main_ref = %[href="javascript: void(0)" onclick="javascript:open_main('#{url2}')"]
|
70
|
+
tab_ref = %[href="#{url2}"]
|
71
|
+
url_ref = (frameable == "yes") ? main_ref : tab_ref
|
72
|
+
anchor = %[<a #{url_ref}>#{title}</a>]
|
73
|
+
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
74
|
+
f.puts wrapper
|
75
|
+
end
|
76
|
+
f.puts <<-EOS
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
EOS
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def edit_menu
|
85
|
+
end
|
86
|
+
|
87
|
+
def refresh
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# CSS for sidebar card
|
@@ -0,0 +1 @@
|
|
1
|
+
# This is for specialized livetext add-ons (Ruby methods)
|
@@ -0,0 +1,4 @@
|
|
1
|
+
https://techcrunch.com/2019/09/16/fossa-scores-8-5-million-series-a-to-help-enterprise-manage-open-source-licenses/, yes, FOSSA scores \$8.5 million Series A to help enterprise manage open-source licenses
|
2
|
+
https://techcrunch.com/2019/09/17/spacexs-orbital-starship-prototype-construction-progress-detailed-in-new-photos/, yes, SpaceX’s orbital Starship prototype construction progress detailed in new photos
|
3
|
+
https://developers.googleblog.com/2019/05/Flutter-io19.html, yes, Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop
|
4
|
+
https://jaycarlson.net/microcontrollers/, no, The Amazing \$1 Microcontroller (2017)
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# Custom code for 'news' widget
|
2
|
+
|
3
|
+
class ::RuneBlog::Widget
|
4
|
+
class News
|
5
|
+
Type, Title = "news", "News"
|
6
|
+
|
7
|
+
def initialize(repo)
|
8
|
+
@blog = repo
|
9
|
+
@datafile = "list.data"
|
10
|
+
lines = _get_data(@datafile)
|
11
|
+
@data = lines.map {|line| line.chomp.split(/, */) }
|
12
|
+
end
|
13
|
+
|
14
|
+
def build
|
15
|
+
write_main
|
16
|
+
write_card
|
17
|
+
end
|
18
|
+
|
19
|
+
def _html_body(file, css = nil)
|
20
|
+
file.puts "<html>"
|
21
|
+
if css
|
22
|
+
file.puts " <head>"
|
23
|
+
file.puts " <style>\n#{css}\n </style>"
|
24
|
+
file.puts " </head>"
|
25
|
+
end
|
26
|
+
file.puts " <body>"
|
27
|
+
yield
|
28
|
+
file.puts " </body>\n</html>"
|
29
|
+
end
|
30
|
+
|
31
|
+
def write_main
|
32
|
+
mainfile = "#{Type}-main"
|
33
|
+
css = "body { font-family: verdana }"
|
34
|
+
File.open("#{mainfile}.html", "w") do |f|
|
35
|
+
_html_body(f, css) do
|
36
|
+
f.puts "<h1>#{Title}</h1><br><hr>"
|
37
|
+
@data.each do |file, frameable, title|
|
38
|
+
title = title.gsub(/\\/, "") # kludge
|
39
|
+
case frameable
|
40
|
+
when "yes"; url_ref = "href = '#{file}'"
|
41
|
+
when "no"; url_ref = %[href='#{file}' target='blank']
|
42
|
+
end
|
43
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px"
|
44
|
+
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def write_card
|
51
|
+
cardfile = "#{Type}-card"
|
52
|
+
url = "widgets/#{Type}/#{Type}-main.html"
|
53
|
+
File.open("#{cardfile}.html", "w") do |f|
|
54
|
+
f.puts <<-EOS
|
55
|
+
<div class="card mb-3">
|
56
|
+
<div class="card-body">
|
57
|
+
<h5 class="card-title">
|
58
|
+
<button type="button" class="btn btn-primary" data-toggle="collapse" data-target="##{Type}">+</button>
|
59
|
+
<a href="javascript: void(0)"
|
60
|
+
onclick="javascript:open_main('#{url}')"
|
61
|
+
style="text-decoration: none; color: black"> #{Title}</a>
|
62
|
+
</h5>
|
63
|
+
<div class="collapse" id="#{Type}">
|
64
|
+
EOS
|
65
|
+
@data.each do |file, frameable, title|
|
66
|
+
case frameable
|
67
|
+
when "yes"; url_ref = _main(file) # remote, frameable
|
68
|
+
when "no"; url_ref = _blank(file) # remote, not frameable
|
69
|
+
end
|
70
|
+
anchor = %[<a #{url_ref}>#{title}</a>]
|
71
|
+
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
72
|
+
f.puts wrapper
|
73
|
+
end
|
74
|
+
f.puts <<-EOS
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
EOS
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def edit_menu
|
83
|
+
end
|
84
|
+
|
85
|
+
def refresh
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
# This is for specialized livetext add-ons (Ruby methods)
|
@@ -0,0 +1,41 @@
|
|
1
|
+
.nopara # FIXME later
|
2
|
+
.mixin liveblog
|
3
|
+
|
4
|
+
<html>
|
5
|
+
<head>
|
6
|
+
|
7
|
+
<style>
|
8
|
+
body { font-family: verdana }
|
9
|
+
</style>
|
10
|
+
|
11
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
12
|
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"></link>
|
13
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap-theme.min.css"></link>
|
14
|
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<h2>Frequently Asked Questions</h2>
|
21
|
+
|
22
|
+
.faq Are you a rabbit?
|
23
|
+
Yes, I am.
|
24
|
+
.end
|
25
|
+
|
26
|
+
.faq Are you a frog?
|
27
|
+
Don't be stupid. I just told you I was a rabbit.
|
28
|
+
.end
|
29
|
+
|
30
|
+
.faq Why do you answer a question with a question?
|
31
|
+
*Do I in fact answer a question with a question?
|
32
|
+
.end
|
33
|
+
|
34
|
+
.faq Are you serious?
|
35
|
+
No, I'm a rabbit.
|
36
|
+
.end
|
37
|
+
|
38
|
+
.backlink
|
39
|
+
|
40
|
+
</body>
|
41
|
+
</html>
|
File without changes
|
@@ -0,0 +1,130 @@
|
|
1
|
+
# Custom code for 'pages' widget
|
2
|
+
|
3
|
+
# How to update repl code?
|
4
|
+
|
5
|
+
class ::RuneBlog::Widget
|
6
|
+
class Pages
|
7
|
+
Type, Title = "pages", "My Pages"
|
8
|
+
|
9
|
+
def initialize(repo)
|
10
|
+
@blog = repo
|
11
|
+
@datafile = "list.data"
|
12
|
+
@lines = _get_data(@datafile)
|
13
|
+
@data = @lines.map {|x| x.chomp.split(/, */, 2) }
|
14
|
+
end
|
15
|
+
|
16
|
+
def build
|
17
|
+
# build child pages
|
18
|
+
children = Dir["*.lt3"] - ["pages.lt3"]
|
19
|
+
children.each do |child|
|
20
|
+
dest = child.sub(/.lt3$/, ".html")
|
21
|
+
preprocess src: child, dst: dest
|
22
|
+
end
|
23
|
+
write_main
|
24
|
+
write_card
|
25
|
+
end
|
26
|
+
|
27
|
+
def _html_body(file, css = nil)
|
28
|
+
file.puts "<html>"
|
29
|
+
if css
|
30
|
+
file.puts " <head>"
|
31
|
+
file.puts " <style>\n#{css}\n </style>"
|
32
|
+
file.puts " </head>"
|
33
|
+
end
|
34
|
+
file.puts " <body>"
|
35
|
+
yield
|
36
|
+
file.puts " </body>\n</html>"
|
37
|
+
end
|
38
|
+
|
39
|
+
def write_main
|
40
|
+
css = "body { font-family: verdana }"
|
41
|
+
card_title = Title
|
42
|
+
File.open("#{Type}-main.html", "w") do |f|
|
43
|
+
_html_body(f, css) do
|
44
|
+
f.puts "<h1>#{card_title}</h1><br><hr>"
|
45
|
+
url_ref = nil
|
46
|
+
@data.each do |url, title|
|
47
|
+
url_ref = "href = '#{url}'"
|
48
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px"
|
49
|
+
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def write_card
|
56
|
+
tag = Type
|
57
|
+
url = :widgets/tag/tag+"-main.html"
|
58
|
+
card_title = "Pages" # FIXME
|
59
|
+
cardfile = "#{Type}-card"
|
60
|
+
File.open("#{cardfile}.html", "w") do |f|
|
61
|
+
f.puts <<-EOS
|
62
|
+
<div class="card mb-3">
|
63
|
+
<div class="card-body">
|
64
|
+
<h5 class="card-title">
|
65
|
+
<button type="button" class="btn btn-primary" data-toggle="collapse" data-target="##{tag}">+</button>
|
66
|
+
<a href="javascript: void(0)"
|
67
|
+
onclick="javascript:open_main('#{url}')"
|
68
|
+
style="text-decoration: none; color: black">#{card_title}</a>
|
69
|
+
</h5>
|
70
|
+
<div class="collapse" id="#{tag}">
|
71
|
+
EOS
|
72
|
+
@data.each do |url2, title|
|
73
|
+
f.puts "<!-- #{[url2, title].inspect} -->"
|
74
|
+
url3 = :widgets/tag/url2
|
75
|
+
f.puts "<!-- url3 = #{url3.inspect} -->"
|
76
|
+
url_ref = %[href="javascript: void(0)" onclick="javascript:open_main('#{url3}')"]
|
77
|
+
anchor = %[<a #{url_ref}>#{title}</a>]
|
78
|
+
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
79
|
+
f.puts wrapper
|
80
|
+
end
|
81
|
+
f.puts <<-EOS
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
EOS
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def manage
|
90
|
+
dir = @blog.view.dir/"widgets/pages"
|
91
|
+
# Assume child files already generated (and list.data??)
|
92
|
+
data = dir/"list.data"
|
93
|
+
lines = _get_data?(data)
|
94
|
+
hash = {}
|
95
|
+
lines.each do |line|
|
96
|
+
url, name = line.chomp.split(",")
|
97
|
+
source = url.sub(/.html$/, ".lt3")
|
98
|
+
hash[name] = source
|
99
|
+
end
|
100
|
+
new_item = "[New page]"
|
101
|
+
num, fname = STDSCR.menu(title: "Edit page:", items: hash.keys + [new_item])
|
102
|
+
return if fname.nil?
|
103
|
+
if fname == new_item
|
104
|
+
print "Page title: "
|
105
|
+
title = RubyText.gets
|
106
|
+
title.chomp!
|
107
|
+
print "File name (.lt3): "
|
108
|
+
fname = RubyText.gets
|
109
|
+
fname << ".lt3" unless fname.end_with?(".lt3")
|
110
|
+
fhtml = fname.sub(/.lt3$/, ".html")
|
111
|
+
File.open(data, "a") {|f| f.puts "#{fhtml},#{title}" }
|
112
|
+
new_file = dir/fname
|
113
|
+
File.open(new_file, "w") do |f|
|
114
|
+
f.puts "<h1>#{title}</h1>\n\n\n "
|
115
|
+
f.puts ".backlink"
|
116
|
+
end
|
117
|
+
edit_file(new_file)
|
118
|
+
else
|
119
|
+
target = hash[fname]
|
120
|
+
edit_file(dir/target)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def edit_menu
|
125
|
+
end
|
126
|
+
|
127
|
+
def refresh
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# CSS for sidebar card
|
@@ -0,0 +1 @@
|
|
1
|
+
# This is for specialized livetext add-ons (Ruby methods)
|