livetext 0.8.62 → 0.8.63
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/livetext.rb +1 -1
- data/plugin/liveblog.rb +63 -25
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ecefd7b98d49f5249cdc6c824c06723cd2aadcabc1fcdf9fa0e26b6278605af
|
4
|
+
data.tar.gz: af7eabe2aa02501c29af2c756c443316eb751627c388ad4f19a1d8f9507e30c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16b6d95f524c33fb45c3247421e31377888b346dde63702663aff3b5f1bcbae62e9214bf4e7f0281bf82073b82bff2ad8343185920da17651a659cf091cd9b74
|
7
|
+
data.tar.gz: e2d59f0f673fb6280fac1d6d41e0888192ee74a480c0b5e860d19ea5366582b18f5ddd834e6aef4e9a6f3a98a0e682a01c38dce567d084ba5e82619805b4b510
|
data/lib/livetext.rb
CHANGED
data/plugin/liveblog.rb
CHANGED
@@ -5,9 +5,10 @@ require 'date'
|
|
5
5
|
require 'runeblog' # Now depends explicitly
|
6
6
|
|
7
7
|
def quote
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
_passthru "<blockquote>"
|
9
|
+
_passthru _body
|
10
|
+
_passthru "</blockquote>"
|
11
|
+
_optional_blank_line
|
11
12
|
end
|
12
13
|
|
13
14
|
class ::Livetext::Functions # do this differently??
|
@@ -31,6 +32,26 @@ class ::Livetext::Functions # do this differently??
|
|
31
32
|
|
32
33
|
end
|
33
34
|
|
35
|
+
### inset
|
36
|
+
|
37
|
+
def inset
|
38
|
+
lines = _body
|
39
|
+
box = []
|
40
|
+
lines.each do |line|
|
41
|
+
if line[0] == "|"
|
42
|
+
line[0] = ' '
|
43
|
+
box << line
|
44
|
+
end
|
45
|
+
_passthru(line)
|
46
|
+
end
|
47
|
+
lr = _args.first
|
48
|
+
_passthru "<div style='float:#{lr}; width: 25%; padding:8px; padding-right:12px; font-family:verdana'>"
|
49
|
+
_passthru '<b><i>'
|
50
|
+
_passthru box.join("<br>")
|
51
|
+
_passthru_noline '</i></b></div>'
|
52
|
+
_optional_blank_line
|
53
|
+
end
|
54
|
+
|
34
55
|
### copy_asset
|
35
56
|
|
36
57
|
def copy_asset(asset)
|
@@ -67,10 +88,18 @@ def _passthru(line, context = nil)
|
|
67
88
|
@body << "<p>" if line.empty? && ! @_nopara
|
68
89
|
end
|
69
90
|
|
91
|
+
def _passthru_noline(line, context = nil)
|
92
|
+
return if line.nil?
|
93
|
+
line = _formatting(line, context)
|
94
|
+
@body << line
|
95
|
+
@body << "<p>" if line.empty? && ! @_nopara
|
96
|
+
end
|
97
|
+
|
70
98
|
def title
|
71
99
|
title = @_data.chomp
|
72
100
|
@meta.title = title
|
73
101
|
@body << "<h1>#{title}</h1>"
|
102
|
+
_optional_blank_line
|
74
103
|
end
|
75
104
|
|
76
105
|
def pubdate
|
@@ -81,6 +110,7 @@ def pubdate
|
|
81
110
|
y, m, d = y.to_i, m.to_i, d.to_i
|
82
111
|
@meta.date = ::Date.new(y, m, d)
|
83
112
|
@meta.pubdate = "%04d-%02d-%02d" % [y, m, d]
|
113
|
+
_optional_blank_line
|
84
114
|
end
|
85
115
|
|
86
116
|
def image # primitive so far
|
@@ -88,22 +118,26 @@ def image # primitive so far
|
|
88
118
|
fname = _args.first
|
89
119
|
path = "../assets/#{fname}"
|
90
120
|
@body << "<img src=#{path}></img>"
|
121
|
+
_optional_blank_line
|
91
122
|
end
|
92
123
|
|
93
124
|
def tags
|
94
125
|
_debug "args = #{_args}"
|
95
126
|
@meta.tags = _args.dup || []
|
127
|
+
_optional_blank_line
|
96
128
|
end
|
97
129
|
|
98
130
|
def views
|
99
131
|
_debug "data = #{_args}"
|
100
132
|
@meta.views = _args.dup # + ["main"]
|
133
|
+
_optional_blank_line
|
101
134
|
end
|
102
135
|
|
103
136
|
def pin
|
104
137
|
_debug "data = #{_args}"
|
105
138
|
# verify only already-specified views?
|
106
139
|
@meta.pinned = _args.dup
|
140
|
+
_optional_blank_line
|
107
141
|
end
|
108
142
|
|
109
143
|
# def liveblog_version
|
@@ -113,6 +147,7 @@ def list
|
|
113
147
|
@body << "<ul>"
|
114
148
|
_body {|line| @body << "<li>#{line}</li>" }
|
115
149
|
@body << "</ul>"
|
150
|
+
_optional_blank_line
|
116
151
|
end
|
117
152
|
|
118
153
|
def list!
|
@@ -128,6 +163,7 @@ def list!
|
|
128
163
|
end
|
129
164
|
end
|
130
165
|
@body << "</ul>"
|
166
|
+
_optional_blank_line
|
131
167
|
end
|
132
168
|
|
133
169
|
def asset
|
@@ -136,34 +172,36 @@ def asset
|
|
136
172
|
# For now: copies, doesn't keep record
|
137
173
|
# Later: Add to file and uniq; use in publishing
|
138
174
|
list.each {|asset| copy_asset(asset) }
|
175
|
+
_optional_blank_line
|
139
176
|
end
|
140
177
|
|
141
178
|
def assets
|
142
179
|
@meta.assets ||= []
|
143
180
|
@meta.assets += _body
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
Dir.chdir(save)
|
163
|
-
rescue => err
|
164
|
-
puts "err = #{err}"
|
165
|
-
puts err.backtrace.join("\n")
|
181
|
+
_optional_blank_line
|
182
|
+
end
|
183
|
+
|
184
|
+
def write_post(meta)
|
185
|
+
save = Dir.pwd
|
186
|
+
@postdir.gsub!(/\/\//, "/") # FIXME unneeded?
|
187
|
+
Dir.mkdir(@postdir) unless Dir.exist?(@postdir) # FIXME remember assets!
|
188
|
+
Dir.chdir(@postdir)
|
189
|
+
meta.views = meta.views.join(" ")
|
190
|
+
meta.tags = meta.tags.join(" ") rescue ""
|
191
|
+
File.write("body.txt", @body) # Actually HTML...
|
192
|
+
File.write("teaser.txt", meta.teaser)
|
193
|
+
|
194
|
+
fields = [:num, :title, :date, :pubdate, :views, :tags]
|
195
|
+
|
196
|
+
fname2 = "metadata.txt"
|
197
|
+
f2 = File.open(fname2, "w") do |f2|
|
198
|
+
fields.each {|fld| f2.puts "#{fld}: #{meta.send(fld)}" }
|
166
199
|
end
|
200
|
+
Dir.chdir(save)
|
201
|
+
rescue => err
|
202
|
+
puts "err = #{err}"
|
203
|
+
puts err.backtrace.join("\n")
|
204
|
+
end
|
167
205
|
|
168
206
|
def teaser
|
169
207
|
@meta.teaser = _body_text
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: livetext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.63
|
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-03-
|
11
|
+
date: 2019-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|