livetext 0.8.69 → 0.8.70
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/lib/livetext.rb +4 -9
- data/lib/standard.rb +1 -1
- data/lib/userapi.rb +11 -3
- data/test/data/basic_formatting/expected-output.txt +2 -2
- data/test/data/lines.txt +20 -20
- data/test/data/table_with_heredocs/expected-output.txt +1 -1
- 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: e413bcfe4586395dc9143b00a87955be2ae80f1da20d54a2fdc5809db8b99324
|
|
4
|
+
data.tar.gz: 81a2d9729aafe869516edccdb145545135b27d881f7d06442b2136db7e6cb1e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3972eb3083aa1a1638c26af552947a61346a437668cdf55f2e5b6c9f00f99ff691306bc097c545af1325853b5e49f39d216243be4f55d9d6517c8535c2c1cc36
|
|
7
|
+
data.tar.gz: 61b5c70f1695849bb5db9e77edbb7502b506980c9948d845f66776ea9513ba10d72cbb77e87a6649294447a29ba62fdb67827cefab4af19318f8be6d37ea64fa
|
data/lib/livetext.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Livetext
|
|
2
|
-
VERSION = "0.8.
|
|
2
|
+
VERSION = "0.8.70"
|
|
3
3
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
|
4
4
|
end
|
|
5
5
|
|
|
@@ -23,6 +23,7 @@ class Livetext
|
|
|
23
23
|
Vars = {}
|
|
24
24
|
|
|
25
25
|
attr_reader :main, :context
|
|
26
|
+
attr_accessor :no_puts
|
|
26
27
|
|
|
27
28
|
class << self
|
|
28
29
|
attr_accessor :parameters # from outside world (process_text)
|
|
@@ -50,18 +51,12 @@ class Livetext
|
|
|
50
51
|
@parent = parent
|
|
51
52
|
@_nopass = false
|
|
52
53
|
@_nopara = false
|
|
54
|
+
parent.no_puts = output.nil?
|
|
55
|
+
@body = "" # not always used
|
|
53
56
|
@output = ::Livetext.output = (output || File.open("/dev/null", "w"))
|
|
54
57
|
@sources = []
|
|
55
58
|
end
|
|
56
59
|
|
|
57
|
-
def _out(str)
|
|
58
|
-
if @no_puts
|
|
59
|
-
@body << str
|
|
60
|
-
else
|
|
61
|
-
_puts str
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
|
|
65
60
|
def output=(io)
|
|
66
61
|
@output = io
|
|
67
62
|
end
|
data/lib/standard.rb
CHANGED
data/lib/userapi.rb
CHANGED
|
@@ -107,10 +107,18 @@ module Livetext::UserAPI
|
|
|
107
107
|
$which = 1
|
|
108
108
|
return if @_nopass
|
|
109
109
|
# p [@_nopara, line]
|
|
110
|
-
|
|
111
|
-
#
|
|
110
|
+
_out "<p>" if line == "\n" and ! @_nopara
|
|
111
|
+
# _out "<p>" if line == "" and ! @_nopara
|
|
112
112
|
_formatting(line, context)
|
|
113
|
-
|
|
113
|
+
_out line
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def _out(str)
|
|
117
|
+
if @no_puts
|
|
118
|
+
@body << str
|
|
119
|
+
else
|
|
120
|
+
_puts str
|
|
121
|
+
end
|
|
114
122
|
end
|
|
115
123
|
|
|
116
124
|
def _puts(*args)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Here are examples of <b>boldface</b> and <i>italics</i> and <tt>code</tt>
|
|
1
|
+
Here are examples of <b>boldface</b> and <i>italics</i> and <font size=+1><tt>code</tt></font>
|
|
2
2
|
as well as <b>more complex</b> examples of <i>italicized text</i>
|
|
3
|
-
and <tt>code font</tt>.
|
|
3
|
+
and <font size=+1><tt>code font</tt></font>.
|
|
4
4
|
<p>
|
|
5
5
|
|
|
6
6
|
Here are some random punctuation marks:
|
data/test/data/lines.txt
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
tick: Single token, beginning of line
|
|
2
2
|
`def is like a reserved word
|
|
3
|
-
<tt>def</tt> is like a reserved word
|
|
3
|
+
<font size=+1><tt>def</tt></font> is like a reserved word
|
|
4
4
|
|
|
5
5
|
tick: Single token, middle of line
|
|
6
6
|
They say `def is like a reserved word
|
|
7
|
-
They say <tt>def</tt> is like a reserved word
|
|
7
|
+
They say <font size=+1><tt>def</tt></font> is like a reserved word
|
|
8
8
|
|
|
9
9
|
tick: Single token, end of line
|
|
10
10
|
like a reserved word, is `def
|
|
11
|
-
like a reserved word, is <tt>def</tt>
|
|
11
|
+
like a reserved word, is <font size=+1><tt>def</tt></font>
|
|
12
12
|
|
|
13
13
|
tick: Bracketed, normal
|
|
14
14
|
This is `[code font] here
|
|
15
|
-
This is <tt>code font</tt> here
|
|
15
|
+
This is <font size=+1><tt>code font</tt></font> here
|
|
16
16
|
|
|
17
17
|
tick: Bracketed, hits EOL
|
|
18
18
|
This is `[code font here
|
|
19
|
-
This is <tt>code font here</tt>
|
|
19
|
+
This is <font size=+1><tt>code font here</tt></font>
|
|
20
20
|
|
|
21
21
|
tick: followed by space
|
|
22
22
|
This is not ` code
|
|
@@ -28,19 +28,19 @@ This also isn't code: `
|
|
|
28
28
|
|
|
29
29
|
tick: Doubled, ignores comma
|
|
30
30
|
This is ``code, of course
|
|
31
|
-
This is <tt>code</tt>, of course
|
|
31
|
+
This is <font size=+1><tt>code</tt></font>, of course
|
|
32
32
|
|
|
33
33
|
tick: Doubled, ignores period
|
|
34
34
|
This is ``code. Hooray, I guess.
|
|
35
|
-
This is <tt>code</tt>. Hooray, I guess.
|
|
35
|
+
This is <font size=+1><tt>code</tt></font>. Hooray, I guess.
|
|
36
36
|
|
|
37
37
|
tick: Doubled, ignores right paren
|
|
38
38
|
(By the way, this is ``code)
|
|
39
|
-
(By the way, this is <tt>code</tt>)
|
|
39
|
+
(By the way, this is <font size=+1><tt>code</tt></font>)
|
|
40
40
|
|
|
41
41
|
tick: Doubled, ignores EOL
|
|
42
42
|
Up to EOL, this is ``code
|
|
43
|
-
Up to EOL, this is <tt>code</tt>
|
|
43
|
+
Up to EOL, this is <font size=+1><tt>code</tt></font>
|
|
44
44
|
|
|
45
45
|
uscore: Single token, beginning of line
|
|
46
46
|
_This is italics
|
|
@@ -88,7 +88,7 @@ Be there in a <i>second</i>
|
|
|
88
88
|
|
|
89
89
|
Tick has precedence over underscore
|
|
90
90
|
This is a `piece_of_code here
|
|
91
|
-
This is a <tt>piece_of_code</tt> here
|
|
91
|
+
This is a <font size=+1><tt>piece_of_code</tt></font> here
|
|
92
92
|
|
|
93
93
|
under: Starts after double quote?
|
|
94
94
|
He said, "_Please go away."
|
|
@@ -204,7 +204,7 @@ There is <i>some text</i> here
|
|
|
204
204
|
|
|
205
205
|
Try $$t
|
|
206
206
|
There is $$t[some text] here
|
|
207
|
-
There is <tt>some text</tt> here
|
|
207
|
+
There is <font size=+1><tt>some text</tt></font> here
|
|
208
208
|
|
|
209
209
|
Try $$s
|
|
210
210
|
There is $$s[some text] here
|
|
@@ -216,7 +216,7 @@ There is <b><i>some text</i></b> here
|
|
|
216
216
|
|
|
217
217
|
Try $$bt
|
|
218
218
|
There is $$bt[some text] here
|
|
219
|
-
There is <b><tt>some text</tt></b> here
|
|
219
|
+
There is <b><font size=+1><tt>some text</tt></font></b> here
|
|
220
220
|
|
|
221
221
|
Try $$bs
|
|
222
222
|
There is $$bs[some text] here
|
|
@@ -224,7 +224,7 @@ There is <b><strike>some text</strike></b> here
|
|
|
224
224
|
|
|
225
225
|
Try $$it
|
|
226
226
|
There is $$it[some text] here
|
|
227
|
-
There is <i><tt>some text</tt></i> here
|
|
227
|
+
There is <i><font size=+1><tt>some text</tt></font></i> here
|
|
228
228
|
|
|
229
229
|
Try $$is
|
|
230
230
|
There is $$is[some text] here
|
|
@@ -232,11 +232,11 @@ There is <i><strike>some text</strike></i> here
|
|
|
232
232
|
|
|
233
233
|
Try $$ts
|
|
234
234
|
There is $$ts[some text] here
|
|
235
|
-
There is <tt><strike>some text</strike></tt> here
|
|
235
|
+
There is <font size=+1><tt><strike>some text</strike></tt></font> here
|
|
236
236
|
|
|
237
237
|
Try $$bit
|
|
238
238
|
There is $$bit[some text] here
|
|
239
|
-
There is <b><i><tt>some text</tt></i></b> here
|
|
239
|
+
There is <b><i><font size=+1><tt>some text</tt></font></i></b> here
|
|
240
240
|
|
|
241
241
|
Try $$bis
|
|
242
242
|
There is $$bis[some text] here
|
|
@@ -244,19 +244,19 @@ There is <b><i><strike>some text</strike></i></b> here
|
|
|
244
244
|
|
|
245
245
|
Try $$bts
|
|
246
246
|
There is $$bts[some text] here
|
|
247
|
-
There is <b><tt><strike>some text</strike></tt></b> here
|
|
247
|
+
There is <b><font size=+1><tt><strike>some text</strike></tt></font></b> here
|
|
248
248
|
|
|
249
249
|
Try $$its
|
|
250
250
|
There is $$its[some text] here
|
|
251
|
-
There is <i><tt><strike>some text</strike></tt></i> here
|
|
251
|
+
There is <i><font size=+1><tt><strike>some text</strike></tt></font></i> here
|
|
252
252
|
|
|
253
253
|
Try $$bits
|
|
254
254
|
There is $$bits[some text] here
|
|
255
|
-
There is <b><i><tt><strike>some text</strike></tt></i></b> here
|
|
255
|
+
There is <b><i><font size=+1><tt><strike>some text</strike></tt></font></i></b> here
|
|
256
256
|
|
|
257
257
|
Escaped brackets inside bracketed function parameter
|
|
258
258
|
Here is an $$t[\[:array, :expression\]] with escapes.
|
|
259
|
-
Here is an <tt>[:array, :expression]</tt> with escapes.
|
|
259
|
+
Here is an <font size=+1><tt>[:array, :expression]</tt></font> with escapes.
|
|
260
260
|
|
|
261
261
|
Escape brackets inside *
|
|
262
262
|
There are brackets *[\[\]] here
|
|
@@ -268,7 +268,7 @@ There are brackets <i>[]</i> here
|
|
|
268
268
|
|
|
269
269
|
Escape brackets inside `
|
|
270
270
|
There are brackets `[\[\]] here
|
|
271
|
-
There are brackets <tt>[]</tt> here
|
|
271
|
+
There are brackets <font size=+1><tt>[]</tt></font> here
|
|
272
272
|
|
|
273
273
|
Escape brackets inside ~
|
|
274
274
|
There are brackets ~[\[\]] here
|
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.70
|
|
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-04-
|
|
11
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A smart text processor extensible in Ruby
|
|
14
14
|
email: rubyhacker@gmail.com
|