runeblog 0.2.65 → 0.2.66
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/empty_view/themes/standard/blog/generate.lt3 +8 -1
- data/empty_view/themes/standard/etc/misc.js +15 -4
- data/lib/callout.js +10 -0
- data/lib/exper/2svg.lt3 +38 -0
- data/lib/exper/gen_svg.rb +60 -0
- data/lib/exper/s2.html +25 -0
- data/lib/fbtw-js +48 -0
- data/lib/fbtw.rb +57 -0
- data/lib/liveblog.rb +182 -39
- data/lib/repl.rb +12 -4
- data/lib/runeblog_version.rb +1 -1
- data/runeblog.gemspec +3 -0
- metadata +22 -4
- data/empty_view/themes/standard/banner/austin-pano.jpg +0 -0
- data/empty_view/themes/standard/banner/blog-banner.jpg +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3377a5ba70f92dddd9b045725e85eb7fff8ebbab816574116ec333cbe78b8c8a
|
|
4
|
+
data.tar.gz: 1b867812e0f3fa96b74ea4abfa5331fcf1bb9eb263cfd936b7fd1d57b3a6bc6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3ddff49dff4ddc7e9af3b2d6f762deca151965630ed85dcc7605f9f5889aabd2c5f48bd33a512e8959c3c6e3742fafac46056c5125758bcc96e81299f8caab8
|
|
7
|
+
data.tar.gz: d59bd1c867a21c3210f32283e2818f66f6592a0a872def4715c87ca35df7d572cb96321ac7c50e7b85ec4d1fa178a2d69e75d14c7f9a19fa9e755183fbf5e7e5
|
|
@@ -14,7 +14,14 @@
|
|
|
14
14
|
.include blog/head.lt3
|
|
15
15
|
<body>
|
|
16
16
|
|
|
17
|
-
$.banner
|
|
17
|
+
$.banner
|
|
18
|
+
height 100
|
|
19
|
+
bgcolor 101035
|
|
20
|
+
svg_title bgcolor: #b08080 size: 29px xy: 75,50 align: center size2: 15px xy2: 75,70 align2: center
|
|
21
|
+
image austin-pano.jpg
|
|
22
|
+
break
|
|
23
|
+
navbar
|
|
24
|
+
$.end
|
|
18
25
|
<div class="content container-fluid mt-4">
|
|
19
26
|
<div class="row">
|
|
20
27
|
$.include blog/index.lt3
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
<!-- Miscellaneous local JS pieces are defined here -->
|
|
2
2
|
|
|
3
3
|
<script>
|
|
4
|
-
function open_main(url) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
function open_main(url) {
|
|
5
|
+
var site = url+'?toolbar=0&navpanes=0&scrollbar=0';
|
|
6
|
+
document.getElementById('main').src = site;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function callout(d, id, src) {
|
|
10
|
+
var js, fjs = d.getElementsByTagName('script')[0];
|
|
11
|
+
p=/^http:/.test(d.location)?'http':'https';
|
|
12
|
+
if (d.getElementById(id)) {return;}
|
|
13
|
+
js = d.createElement('script');
|
|
14
|
+
js.id = id;
|
|
15
|
+
js.src = p + src;
|
|
16
|
+
fjs.parentNode.insertBefore(js, fjs);
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
</script>
|
data/lib/callout.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function callout(d, id, src) {
|
|
2
|
+
var js, fjs = d.getElementsByTagName('script')[0];
|
|
3
|
+
p=/^http:/.test(d.location)?'http':'https';
|
|
4
|
+
if (d.getElementById(id)) {return;}
|
|
5
|
+
js = d.createElement('script');
|
|
6
|
+
js.id = id;
|
|
7
|
+
js.src = p + src;
|
|
8
|
+
fjs.parentNode.insertBefore(js, fjs);
|
|
9
|
+
}
|
|
10
|
+
|
data/lib/exper/2svg.lt3
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.nopara
|
|
2
|
+
.variables
|
|
3
|
+
blog Around Austin
|
|
4
|
+
blog.desc The view from downtown
|
|
5
|
+
|
|
6
|
+
viewbox.wide 550
|
|
7
|
+
viewbox.high 90
|
|
8
|
+
|
|
9
|
+
rect.wide 550
|
|
10
|
+
rect.high 90
|
|
11
|
+
rect.fill blue
|
|
12
|
+
|
|
13
|
+
title.font bold 58px sans-serif
|
|
14
|
+
title.fill white
|
|
15
|
+
title.xoff 280
|
|
16
|
+
title.yoff 55
|
|
17
|
+
|
|
18
|
+
subtitle.font italic 24px sans-serif
|
|
19
|
+
subtitle.fill lightblue
|
|
20
|
+
subtitle.xoff 280
|
|
21
|
+
subtitle.yoff 80
|
|
22
|
+
.end
|
|
23
|
+
|
|
24
|
+
<svg width=$viewbox.wide height=$viewbox.high
|
|
25
|
+
viewBox="0 0 $viewbox.wide $viewbox.high"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
27
|
+
<style>
|
|
28
|
+
.subtitle { font: $subtitle.font; fill: $subtitle.fill }
|
|
29
|
+
.title { font: $title.font; fill: $title.fill }
|
|
30
|
+
</style>
|
|
31
|
+
|
|
32
|
+
<rect x="0" y="0" rx="10" ry="10" width="$rect.wide" height="$rect.high" fill="$rect.fill"/>
|
|
33
|
+
|
|
34
|
+
<text text-anchor="middle" x=$title.xoff y=$title.yoff class=title>$blog</text>
|
|
35
|
+
<text text-anchor="middle" x=$subtitle.xoff y=$subtitle.yoff class=subtitle>$blog.desc</text>
|
|
36
|
+
</svg>
|
|
37
|
+
<br>
|
|
38
|
+
Here we are
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
width = 550
|
|
2
|
+
title = "My Stuff" # 13 -> 58, 8 -> 13/8 * 58
|
|
3
|
+
sub = "I always wanted a place for it" # 22 -> 24, 31 -> 15
|
|
4
|
+
|
|
5
|
+
tlen, slen = title.length, sub.length
|
|
6
|
+
tfont = 58
|
|
7
|
+
sfont = 18
|
|
8
|
+
|
|
9
|
+
=begin
|
|
10
|
+
.svg_titles
|
|
11
|
+
title style: bold size: 20px face: sans-serif color: white
|
|
12
|
+
title2 italic 10px sans-serif
|
|
13
|
+
width 550
|
|
14
|
+
height 90
|
|
15
|
+
bgcolor blue
|
|
16
|
+
title_xy 82 55 left
|
|
17
|
+
title2_xy 210 80
|
|
18
|
+
.end
|
|
19
|
+
=end
|
|
20
|
+
|
|
21
|
+
puts <<-EOS
|
|
22
|
+
.nopara
|
|
23
|
+
.variables
|
|
24
|
+
blog #{title}
|
|
25
|
+
blog.desc #{sub}
|
|
26
|
+
|
|
27
|
+
viewbox.wide 550
|
|
28
|
+
viewbox.high 90
|
|
29
|
+
|
|
30
|
+
rect.wide 550
|
|
31
|
+
rect.high 90
|
|
32
|
+
rect.fill blue
|
|
33
|
+
|
|
34
|
+
title.font bold #{tfont}px sans-serif
|
|
35
|
+
title.fill white
|
|
36
|
+
title.xoff 82
|
|
37
|
+
title.yoff 55
|
|
38
|
+
|
|
39
|
+
subtitle.font italic #{sfont}px sans-serif
|
|
40
|
+
subtitle.fill lightblue
|
|
41
|
+
subtitle.xoff 210
|
|
42
|
+
subtitle.yoff 80
|
|
43
|
+
.end
|
|
44
|
+
|
|
45
|
+
<svg width=$viewbox.wide height=$viewbox.high
|
|
46
|
+
viewBox="0 0 $viewbox.wide $viewbox.high"
|
|
47
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
48
|
+
<style>
|
|
49
|
+
.subtitle { font: $subtitle.font; fill: $subtitle.fill }
|
|
50
|
+
.title { font: $title.font; fill: $title.fill }
|
|
51
|
+
</style>
|
|
52
|
+
|
|
53
|
+
<rect x="0" y="0" rx="10" ry="10" width="$rect.wide" height="$rect.high" fill="$rect.fill"/>
|
|
54
|
+
|
|
55
|
+
<text x=$title.xoff y=$title.yoff class=title>$blog</text>
|
|
56
|
+
<text x=$subtitle.xoff y=$subtitle.yoff class=subtitle>$blog.desc</text>
|
|
57
|
+
</svg>
|
|
58
|
+
<br>
|
|
59
|
+
Here we are
|
|
60
|
+
EOS
|
data/lib/exper/s2.html
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<table>
|
|
2
|
+
<tr>
|
|
3
|
+
<td wudth=300>
|
|
4
|
+
<h1>And here we are...</h1>
|
|
5
|
+
</td>
|
|
6
|
+
|
|
7
|
+
<td>
|
|
8
|
+
<svg width=550 height=90
|
|
9
|
+
viewBox="0 0 550 90"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
11
|
+
<style>
|
|
12
|
+
.subtitle { font: italic 24px sans-serif; fill: lightblue }
|
|
13
|
+
.title { font: bold 58px sans-serif; fill: white }
|
|
14
|
+
</style>
|
|
15
|
+
|
|
16
|
+
<rect x="0" y="0" rx="10" ry="10" width="550" height="90" fill="blue"/>
|
|
17
|
+
|
|
18
|
+
<text text-anchor="middle" x=280 y=55 class=title>Around Austin</text>
|
|
19
|
+
<text text-anchor="middle" x=280 y=80 class=subtitle>The view from downtown</text>
|
|
20
|
+
</svg>
|
|
21
|
+
</td>
|
|
22
|
+
</tr>
|
|
23
|
+
<table>
|
|
24
|
+
<br>
|
|
25
|
+
Here we are
|
data/lib/fbtw-js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
<!-- scripts: FB, twitter -->
|
|
3
|
+
|
|
4
|
+
<script>
|
|
5
|
+
window.fbAsyncInit = function() {
|
|
6
|
+
FB.init({
|
|
7
|
+
appId : '1176481582378716',
|
|
8
|
+
xfbml : true,
|
|
9
|
+
version : 'v2.4'
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
callout(document, 'facebook-jssdk',
|
|
14
|
+
'//connect.facebook.net/en_US/sdk.js');
|
|
15
|
+
|
|
16
|
+
callout(document, 'script', 'twitter-wjs',
|
|
17
|
+
'//platform.twitter.com/widgets.js';
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<!-- meta tags -->
|
|
21
|
+
|
|
22
|
+
<!-- meta property='fb:admins' content='767352779' /> -->
|
|
23
|
+
<meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
|
|
24
|
+
<meta property='og:type' content='article'/>
|
|
25
|
+
<meta property='og:title' content='#{title}'/>
|
|
26
|
+
<meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
|
|
27
|
+
<meta property='og:description' content='#{teaser}'/>
|
|
28
|
+
|
|
29
|
+
<!-- facebook -->
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
class='fb-like'
|
|
33
|
+
data-share='true'
|
|
34
|
+
data-width='450'
|
|
35
|
+
data-show-faces='true'>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Twitter: share, follow -->
|
|
39
|
+
|
|
40
|
+
<a href='https://twitter.com/share'
|
|
41
|
+
class='twitter-share-button'
|
|
42
|
+
data-text='#{title}'
|
|
43
|
+
data-url='#{'url'}'
|
|
44
|
+
data-via='hal_fulton'
|
|
45
|
+
data-related='hal_fulton'>Tweet</a>
|
|
46
|
+
|
|
47
|
+
<a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
|
|
48
|
+
|
data/lib/fbtw.rb
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
class Livetext::Functions
|
|
3
|
+
|
|
4
|
+
def facebook_init
|
|
5
|
+
fb_appid = _var("facebook.appid")
|
|
6
|
+
<<~HTML
|
|
7
|
+
window.fbAsyncInit = function() {
|
|
8
|
+
FB.init({
|
|
9
|
+
appId : '#{fb_appid}',
|
|
10
|
+
xfbml : true,
|
|
11
|
+
version : 'v2.4'
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
HTML
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
=begin
|
|
18
|
+
<!-- Needed: btw what is 'content'?
|
|
19
|
+
<meta property='fb:admins' content='767352779'/>
|
|
20
|
+
<meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
|
|
21
|
+
<meta property='og:type' content='article'/>
|
|
22
|
+
<meta property='og:title' content='#{title}'/>
|
|
23
|
+
<meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
|
|
24
|
+
<meta property='og:description' content='#{teaser}'/>
|
|
25
|
+
-->
|
|
26
|
+
=end
|
|
27
|
+
|
|
28
|
+
def facebook_likes
|
|
29
|
+
<<~HTML
|
|
30
|
+
<div class='fb-like'
|
|
31
|
+
data-share='true'
|
|
32
|
+
data-width='450'
|
|
33
|
+
data-show-faces='true'>
|
|
34
|
+
</div>
|
|
35
|
+
HTML
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def twitter_share
|
|
39
|
+
name, title, url = "", "", "" # FIXME
|
|
40
|
+
<<~HTML
|
|
41
|
+
<a href='https://twitter.com/share'
|
|
42
|
+
class='twitter-share-button'
|
|
43
|
+
data-text='#{title}'
|
|
44
|
+
data-url='#{url}'
|
|
45
|
+
data-via='#{name}'
|
|
46
|
+
data-related='#{name}'>Tweet</a>
|
|
47
|
+
HTML
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def twitter_follow
|
|
51
|
+
name = "hal_fulton" # FIXME
|
|
52
|
+
<<~HTML
|
|
53
|
+
<a href='https://twitter.com/#{name}' class='twitter-follow-button' data-show-count='false'>Follow @#{name}</a>
|
|
54
|
+
HTML
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end
|
data/lib/liveblog.rb
CHANGED
|
@@ -79,67 +79,72 @@ def backlink
|
|
|
79
79
|
_out %[<br><a href="javascript:history.go(-1)">[Back]</a>]
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
+
def code
|
|
83
|
+
lines = _body_text
|
|
84
|
+
_out "<font size=+1><pre>\n#{lines}\n</pre></font>"
|
|
85
|
+
end
|
|
86
|
+
|
|
82
87
|
def _read_navbar_data
|
|
83
88
|
dir = @blog.root/:views/@blog.view/"themes/standard/banner/"
|
|
84
89
|
datafile = dir/"list.data"
|
|
85
90
|
File.readlines(datafile)
|
|
86
91
|
end
|
|
87
92
|
|
|
88
|
-
def banner
|
|
89
|
-
enum = _args.each
|
|
93
|
+
def banner
|
|
90
94
|
count = 0
|
|
91
95
|
span = 1
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
bg = nil # bg = white - do nothing
|
|
98
|
-
end
|
|
99
|
-
str = "<table width=100%"
|
|
100
|
-
str << (bg ? " bgcolor=##{bg}>" : ">")
|
|
101
|
-
_out str
|
|
102
|
-
_out " <tr>"
|
|
96
|
+
bg = "white" # outside loop
|
|
97
|
+
wide = nil
|
|
98
|
+
high = 250
|
|
99
|
+
str2 = ""
|
|
100
|
+
lines = _body.to_a
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
lines.each do |line|
|
|
105
103
|
count += 1
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
tag, *data = line.split
|
|
105
|
+
data ||= []
|
|
106
|
+
case tag
|
|
107
|
+
when "width"
|
|
108
|
+
wide = data[0]
|
|
109
|
+
when "height"
|
|
110
|
+
high = data[0]
|
|
111
|
+
when "bgcolor"
|
|
112
|
+
bg = data[0] || "white"
|
|
108
113
|
when "image"
|
|
109
|
-
image = "banner
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
image = data[0] || "banner.jpg"
|
|
115
|
+
image = "banner"/image
|
|
116
|
+
wide = data[0]
|
|
117
|
+
width = wide ? "width=#{wide}" : ""
|
|
118
|
+
str2 << " <td colspan=#{span}><img src=#{image} #{width} height=#{high}></img></td>" + "\n"
|
|
119
|
+
when "svg_title"
|
|
120
|
+
stuff, hash = _svg_title(*data)
|
|
121
|
+
STDERR.puts hash.inspect
|
|
122
|
+
wide = hash["width"]
|
|
123
|
+
str2 << " <td colspan=#{span} width=#{wide}>#{stuff}</td>" + "\n"
|
|
116
124
|
when "text"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
when "text:"
|
|
121
|
-
file = "banner/#{enum.next}"
|
|
122
|
-
_out "<td colspan=#{span}>" + File.read(file) + "</td>" +
|
|
123
|
-
" <!-- #{arg} -->"
|
|
125
|
+
data[0] ||= "top.html"
|
|
126
|
+
file = "banner"/data[0]
|
|
127
|
+
str2 << "<td colspan=#{span}>" + File.read(file) + "</td>" + "\n"
|
|
124
128
|
when "navbar"
|
|
125
|
-
dir = @blog.root/:views/@blog.view/"themes/standard/banner/"
|
|
129
|
+
dir = @blog.root/:views/@blog.view/"themes/standard/banner/" + "\n"
|
|
126
130
|
_make_navbar # horiz is default
|
|
127
131
|
stuff = File.read("banner/navbar.html")
|
|
128
|
-
|
|
129
|
-
" <!-- #{arg} -->"
|
|
132
|
+
str2 << "<td colspan=#{span}><div style='text-align: center'>#{stuff}</div></td>" + "\n"
|
|
130
133
|
when "vnavbar"
|
|
131
134
|
dir = @blog.root/:views/@blog.view/"themes/standard/banner/"
|
|
132
135
|
_make_navbar(:vert)
|
|
133
136
|
file = "banner/vnavbar.html"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
when "//"
|
|
137
|
+
str2 << "<td colspan=#{span}>" + File.read(file) + "</td>" + "\n"
|
|
138
|
+
when "break"
|
|
137
139
|
span = count - 1
|
|
138
|
-
|
|
140
|
+
str2 << " </tr>\n <tr>" + "\n"
|
|
139
141
|
else
|
|
140
|
-
|
|
142
|
+
str2 << " '#{tag}' isn't known" + "\n"
|
|
141
143
|
end
|
|
142
144
|
end
|
|
145
|
+
_out "<table width=100% height=#{high} bgcolor=##{bg}>"
|
|
146
|
+
_out " <tr>"
|
|
147
|
+
_out str2
|
|
143
148
|
_out " </tr>"
|
|
144
149
|
_out "</table>"
|
|
145
150
|
rescue => err
|
|
@@ -148,6 +153,143 @@ rescue => err
|
|
|
148
153
|
gets
|
|
149
154
|
end
|
|
150
155
|
|
|
156
|
+
def _parse_colon_args(args, hash) # really belongs in livetext
|
|
157
|
+
h2 = hash.dup
|
|
158
|
+
e = args.each
|
|
159
|
+
loop do
|
|
160
|
+
arg = e.next.chop.to_sym
|
|
161
|
+
raise "_parse_args: #{arg} is unknown" unless hash.keys.include?(arg)
|
|
162
|
+
h2[arg] = e.next
|
|
163
|
+
end
|
|
164
|
+
h2 = h2.reject {|k,v| v.nil? }
|
|
165
|
+
h2.each_pair {|k, v| raise "#{k} has no value" if v.empty? }
|
|
166
|
+
h2
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def _get_arg(name, args) # really belongs in livetext
|
|
170
|
+
raise "(#{name}) Expected an array" unless args.is_a? Array
|
|
171
|
+
raise "(#{name}) Expected an arg" if args.empty?
|
|
172
|
+
raise "(#{name}) Too many args: #{args.inspect}" if args.size > 1
|
|
173
|
+
val = args[0]
|
|
174
|
+
raise "Expected an argument '#{name}'" if val.nil?
|
|
175
|
+
val
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def _svg_title(*args)
|
|
179
|
+
width = 330
|
|
180
|
+
height = 100
|
|
181
|
+
bgcolor = "blue"
|
|
182
|
+
style = nil
|
|
183
|
+
size = ""
|
|
184
|
+
font = "sans-serif"
|
|
185
|
+
color = "white"
|
|
186
|
+
xy = "5,5"
|
|
187
|
+
align = "center"
|
|
188
|
+
style2 = nil
|
|
189
|
+
size2 = ""
|
|
190
|
+
font2 = "sans-serif"
|
|
191
|
+
color2 = "white"
|
|
192
|
+
xy2 = "5,5"
|
|
193
|
+
align2 = "center"
|
|
194
|
+
|
|
195
|
+
e = args.each
|
|
196
|
+
hash = {}
|
|
197
|
+
loop do
|
|
198
|
+
arg = e.next
|
|
199
|
+
arg = arg.chop
|
|
200
|
+
case arg # can give runtime error if arg missing
|
|
201
|
+
when "width"; width = e.next
|
|
202
|
+
when "height"; height = e.next
|
|
203
|
+
when "bgcolor"; bgcolor = e.next
|
|
204
|
+
when "style"; style = e.next
|
|
205
|
+
when "size"; size = e.next
|
|
206
|
+
when "font"; font = e.next
|
|
207
|
+
when "color"; color = e.next
|
|
208
|
+
when "xy"; xy = e.next
|
|
209
|
+
when "align"; align = e.next
|
|
210
|
+
when "style2"; style2 = e.next
|
|
211
|
+
when "size2"; size2 = e.next
|
|
212
|
+
when "font2"; font2 = e.next
|
|
213
|
+
when "color2"; color2 = e.next
|
|
214
|
+
when "xy2"; xy2 = e.next
|
|
215
|
+
when "align2"; align2 = e.next
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
x, y = xy.split(",")
|
|
219
|
+
x2, y2 = xy2.split(",")
|
|
220
|
+
hash["x"] = x
|
|
221
|
+
hash["y"] = y
|
|
222
|
+
hash["x2"] = x2
|
|
223
|
+
hash["y2"] = y2
|
|
224
|
+
hash["width"] = width
|
|
225
|
+
hash["height"] = height
|
|
226
|
+
hash["bgcolor"] = bgcolor
|
|
227
|
+
hash["style"] = style
|
|
228
|
+
hash["size"] = size
|
|
229
|
+
hash["font"] = font
|
|
230
|
+
hash["color"] = color
|
|
231
|
+
hash["xy"] = xy
|
|
232
|
+
hash["align"] = align
|
|
233
|
+
hash["style2"] = style2
|
|
234
|
+
hash["size2"] = size2
|
|
235
|
+
hash["font2"] = font2
|
|
236
|
+
hash["color2"] = color2
|
|
237
|
+
hash["align2"] = align2
|
|
238
|
+
result = <<~HTML
|
|
239
|
+
<svg width="#{width}" height="#{height}"
|
|
240
|
+
viewBox="0 0 #{width} #{height}">
|
|
241
|
+
<style>
|
|
242
|
+
.title { font: #{style} #{size} #{font}; fill: #{color} }
|
|
243
|
+
.subtitle { font: #{style2} #{size2} #{font2}; fill: #{color2} }
|
|
244
|
+
</style>
|
|
245
|
+
<rect x="10" y="10" rx="10" ry="10" width="#{width-20}" height="#{height-20}" fill="#{bgcolor}"/>
|
|
246
|
+
<text text-anchor="#{align}" x="#{x}" y="#{y}" class="title">#{Livetext::Vars[:blog]} </text>
|
|
247
|
+
<text text-anchor="#{align2}" x="#{x2}" y="#{y2}" class="subtitle">#{Livetext::Vars["blog.desc"]} </text>
|
|
248
|
+
</svg>
|
|
249
|
+
HTML
|
|
250
|
+
[result, hash]
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
def svg_title_SOON
|
|
254
|
+
tstyle = tsize = tfont = tcolor = txy = talign = nil
|
|
255
|
+
t2style = t2size = t2font = t2color = t2xy = t2align = nil
|
|
256
|
+
wide, high, hue = 450, 150, "white"
|
|
257
|
+
_body do |line|
|
|
258
|
+
count += 1
|
|
259
|
+
tag, *data = line.split
|
|
260
|
+
data ||= []
|
|
261
|
+
title_params = {style: nil, size: "", font: "sans-serif", color: "white",
|
|
262
|
+
xy: "5,5", align: "left"}
|
|
263
|
+
case tag
|
|
264
|
+
when "title";
|
|
265
|
+
hash = _parse_colon_args(data, title_params)
|
|
266
|
+
tstyle, tsize, tfont, tcolor, txy, talign =
|
|
267
|
+
hash.values_at(:tstyle, :tsize, :tfont, :tcolor, :txy, :talign)
|
|
268
|
+
tx, ty = txy.split(",")
|
|
269
|
+
when "title2";
|
|
270
|
+
hash = _parse_colon_args(data, title_params)
|
|
271
|
+
t2style, t2size, t2font, t2color, t2xy, t2align =
|
|
272
|
+
hash.values_at(:t2style, :t2size, :t2font, :t2color, :t2xy, :t2align)
|
|
273
|
+
t2x, t2y = t2xy.split(",")
|
|
274
|
+
when "width"; wide = _get_arg(:width, data)
|
|
275
|
+
when "height"; high = _get_arg(:height, data)
|
|
276
|
+
when "bgcolor"; hue = _get_arg(:bgcolor, data)
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
<<~HTML
|
|
280
|
+
<svg width="#{wide}" height="#{high}"
|
|
281
|
+
viewBox="0 0 #{wide} #{high}">
|
|
282
|
+
<style>
|
|
283
|
+
.title { font: #{tstyle} #{tsize} #{tfont}; fill: #{tcolor} }
|
|
284
|
+
.subtitle { font: #{t2style} #{t2size} #{t2font}; fill: #{t2color} }
|
|
285
|
+
</style>
|
|
286
|
+
<rect x="0" y="0" rx="10" ry="10" width="#{wide}" height="#{height}" fill="#{bgcolor}"/>
|
|
287
|
+
<text text-anchor="#{talign}" x="#{tx}" y="#{tx}" class="title">$blog </text>
|
|
288
|
+
<text text-anchor="#{t2align}" x="#{t2x}" y="#{t2y}" class="subtitle">$blog.desc </text>
|
|
289
|
+
</svg>
|
|
290
|
+
HTML
|
|
291
|
+
end
|
|
292
|
+
|
|
151
293
|
def quote
|
|
152
294
|
_passthru "<blockquote>"
|
|
153
295
|
_passthru _body.join(" ")
|
|
@@ -354,7 +496,8 @@ def head # Does NOT output <head> tags
|
|
|
354
496
|
"linkc" => %[<link rel="canonical" href="#{_var(:host)}">],
|
|
355
497
|
"og:url" => %[<meta property="og:url" content="#{_var(:host)}">],
|
|
356
498
|
"og:site_name" => %[<meta property="og:site_name" content="#{_var(:blog)}">],
|
|
357
|
-
|
|
499
|
+
# "style" => %[<link rel="stylesheet" href="etc/blog.css">],
|
|
500
|
+
# ^ FIXME
|
|
358
501
|
"feed" => %[<link type="application/atom+xml" rel="alternate" href="#{_var(:host)}/feed.xml" title="#{_var(:blog)}">],
|
|
359
502
|
"favicon" => %[<link rel="shortcut icon" type="image/x-icon" href="../etc/favicon.ico">\n <link rel="apple-touch-icon" href="../etc/favicon.ico">]
|
|
360
503
|
}
|
data/lib/repl.rb
CHANGED
|
@@ -35,10 +35,18 @@ module RuneBlog::REPL
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def cmd_config(arg, testing = false)
|
|
38
|
-
list = ["global.lt3
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
list = ["global.lt3 Global configuration",
|
|
39
|
+
"blog/generate.lt3 Generator for view (usu not edited)",
|
|
40
|
+
".... head.lt3 HEAD info for view",
|
|
41
|
+
".... index.lt3 User-edited detail for view",
|
|
42
|
+
".... post_entry.lt3 Generator for post entry in recent-posts",
|
|
43
|
+
"etc/blog.css.lt3 Global CSS",
|
|
44
|
+
"... externals.lt3 External JS/CSS (Bootstrap, etc.)",
|
|
45
|
+
"post/generate.lt3 Generator for a post",
|
|
46
|
+
".... head.lt3 HEAD info for post",
|
|
47
|
+
".... index.lt3 Content for post",
|
|
48
|
+
".... permalink.lt3 Generator for permalink"]
|
|
49
|
+
|
|
42
50
|
name = ["global.lt3", "blog/generate.lt3", "blog/head.lt3", "blog/index.lt3",
|
|
43
51
|
"blog/post_entry.lt3", "etc/blog.css.lt3", "blog/externals.lt3",
|
|
44
52
|
"post/generate.lt3", "post/head.lt3", "post/index.lt3",
|
data/lib/runeblog_version.rb
CHANGED
data/runeblog.gemspec
CHANGED
|
@@ -23,6 +23,9 @@ spec = Gem::Specification.new do |s|
|
|
|
23
23
|
s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.95'
|
|
24
24
|
s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.16'
|
|
25
25
|
|
|
26
|
+
s.add_runtime_dependency 'minitest'
|
|
27
|
+
# ^ technically not runtime dep
|
|
28
|
+
|
|
26
29
|
# Files...
|
|
27
30
|
main = Find.find("bin").to_a +
|
|
28
31
|
Find.find("lib").to_a
|
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.66
|
|
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-
|
|
11
|
+
date: 2019-12-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: livetext
|
|
@@ -50,6 +50,20 @@ dependencies:
|
|
|
50
50
|
- - ">="
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
52
|
version: 0.1.16
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
54
|
+
name: minitest
|
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
type: :runtime
|
|
61
|
+
prerelease: false
|
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '0'
|
|
53
67
|
description: A blog system based on Ruby and Livetext
|
|
54
68
|
email: rubyhacker@gmail.com
|
|
55
69
|
executables:
|
|
@@ -76,8 +90,6 @@ files:
|
|
|
76
90
|
- empty_view/remote/widgets/pinned/GIT_IS_DUMB
|
|
77
91
|
- empty_view/themes/standard/README
|
|
78
92
|
- empty_view/themes/standard/banner/about.lt3
|
|
79
|
-
- empty_view/themes/standard/banner/austin-pano.jpg
|
|
80
|
-
- empty_view/themes/standard/banner/blog-banner.jpg
|
|
81
93
|
- empty_view/themes/standard/banner/contact.lt3
|
|
82
94
|
- empty_view/themes/standard/banner/faq.lt3
|
|
83
95
|
- empty_view/themes/standard/banner/list.data
|
|
@@ -152,7 +164,13 @@ files:
|
|
|
152
164
|
- empty_view/themes/standard/widgets/tag-cloud/tag-cloud.lt3
|
|
153
165
|
- empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb
|
|
154
166
|
- lib/Javascript.stuff
|
|
167
|
+
- lib/callout.js
|
|
155
168
|
- lib/default.rb
|
|
169
|
+
- lib/exper/2svg.lt3
|
|
170
|
+
- lib/exper/gen_svg.rb
|
|
171
|
+
- lib/exper/s2.html
|
|
172
|
+
- lib/fbtw-js
|
|
173
|
+
- lib/fbtw.rb
|
|
156
174
|
- lib/global.rb
|
|
157
175
|
- lib/helpers-blog.rb
|
|
158
176
|
- lib/helpers-repl.rb
|
|
Binary file
|
|
Binary file
|