livetext 0.8.95 → 0.8.96
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/formatline.rb +3 -0
- data/lib/functions.rb +1 -1
- data/lib/livetext.rb +6 -1
- data/lib/standard.rb +3 -1
- data/lib/userapi.rb +9 -15
- data/plugin/bookish.rb +12 -7
- 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: 61efdb7cdd7d3a5c6597796d18922ba7f405c7b421a35d7b8708031a3a1d56c3
|
4
|
+
data.tar.gz: f6452c5a4bc7c1c28154774e9847a6502072be8e63ecb33ba6e85799452c10a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc2c1c48f54e7411a9f6571256fa8ba1612d7e056010440a86be6d4038b1593c3771032f9305024d9fa0adfdc6543893a0f4183b435c22aab66cd40684b679e8
|
7
|
+
data.tar.gz: d45545ba38eec5669650e7171c285acc1627599fadce73cb80b5c3c7b38e9ef01be1d12ca4bbfd54e89d8e9c6b8e45b7779b7685cdb46812b64a5f6dae6471f4
|
data/lib/formatline.rb
CHANGED
data/lib/functions.rb
CHANGED
@@ -29,7 +29,7 @@ class Livetext::Functions # Functions will go here... user-def AND pre-def??
|
|
29
29
|
|
30
30
|
def link(param=nil)
|
31
31
|
text, url = param.split("|", 2) # reverse these?
|
32
|
-
"<a href='#{url}'>#{text}</a>"
|
32
|
+
"<a style='text-decoration: none' href='#{url}'>#{text}</a>"
|
33
33
|
end
|
34
34
|
|
35
35
|
def br(n="1")
|
data/lib/livetext.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Livetext
|
2
|
-
VERSION = "0.8.
|
2
|
+
VERSION = "0.8.96"
|
3
3
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
4
4
|
end
|
5
5
|
|
@@ -97,6 +97,11 @@ class Livetext
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
def xform_file(file)
|
101
|
+
self.process_file(file)
|
102
|
+
self.body
|
103
|
+
end
|
104
|
+
|
100
105
|
def transform(text)
|
101
106
|
_setfile!("(string)")
|
102
107
|
@output = ::Livetext.output
|
data/lib/standard.rb
CHANGED
@@ -198,10 +198,12 @@ EOS
|
|
198
198
|
end
|
199
199
|
|
200
200
|
def variables
|
201
|
+
prefix = _args[0]
|
201
202
|
_body.each do |line|
|
202
203
|
next if line.strip.empty?
|
203
204
|
var, val = line.split(" ", 2)
|
204
205
|
val = FormatLine.var_func_parse(val)
|
206
|
+
var = prefix + "." + var if prefix
|
205
207
|
@parent._setvar(var, val)
|
206
208
|
end
|
207
209
|
end
|
@@ -443,7 +445,7 @@ EOS
|
|
443
445
|
def link
|
444
446
|
url = _args.first
|
445
447
|
text = _args[2..-1].join(" ")
|
446
|
-
_out "<a href='#{url}'>#{text}</a>"
|
448
|
+
_out "<a style='text-decoration: none' href='#{url}'>#{text}</a>"
|
447
449
|
end
|
448
450
|
|
449
451
|
def xtable # Borrowed from bookish - FIXME
|
data/lib/userapi.rb
CHANGED
@@ -45,16 +45,10 @@ module Livetext::UserAPI
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def _end?(str)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
# indent << "$" unless indent.empty?
|
53
|
-
return false if str.nil?
|
54
|
-
cmd = indent + Livetext::Sigil + "end"
|
55
|
-
return false if str.index(cmd) != 0
|
56
|
-
return false unless _trailing?(str[5])
|
57
|
-
return true
|
48
|
+
str = str.dup
|
49
|
+
str.gsub!(/^ */, "")
|
50
|
+
return true if str == ".end" || str == "$.end"
|
51
|
+
return false
|
58
52
|
end
|
59
53
|
|
60
54
|
def _raw_body(tag = "__EOF__")
|
@@ -83,19 +77,17 @@ module Livetext::UserAPI
|
|
83
77
|
@line = nextline
|
84
78
|
break if @line.nil?
|
85
79
|
@line.chomp!
|
80
|
+
# STDERR.puts "LINE = #{@line.inspect}"
|
86
81
|
if _end?(@line)
|
87
82
|
end_found = true
|
88
83
|
break
|
89
84
|
end
|
90
85
|
next if _comment?(@line)
|
91
|
-
flag = (@line.include?("og:title"))
|
92
86
|
# FIXME Will cause problem with $. ?
|
93
|
-
# STDERR.puts "lt3: _body @line = #{@line.inspect}" if flag
|
94
87
|
@line = _format(@line) unless raw
|
95
|
-
# STDERR.puts " @line = #{@line.inspect}" if flag
|
96
88
|
lines << @line
|
97
89
|
end
|
98
|
-
raise unless end_found
|
90
|
+
raise "this stupid error again" unless end_found
|
99
91
|
_optional_blank_line
|
100
92
|
if block_given?
|
101
93
|
lines.each {|line| yield line } # FIXME what about $. ?
|
@@ -106,7 +98,9 @@ flag = (@line.include?("og:title"))
|
|
106
98
|
str = "Fake error? 'Expecting .end, found end of file'\n"
|
107
99
|
str << err.inspect + "\n"
|
108
100
|
str << err.backtrace.map {|x| " " + x }.join("\n")
|
109
|
-
|
101
|
+
STDERR.puts str
|
102
|
+
exit
|
103
|
+
# _error!(str)
|
110
104
|
end
|
111
105
|
|
112
106
|
def _body_text(raw=false)
|
data/plugin/bookish.rb
CHANGED
@@ -118,8 +118,11 @@ def sec
|
|
118
118
|
@section = "#@chapter.#@sec"
|
119
119
|
# _errout("section #@section")
|
120
120
|
@toc << "#{_nbsp(3)}<b>#@section</b> #@_data<br>"
|
121
|
-
|
121
|
+
_next_output(_slug(@_data))
|
122
122
|
_out "<h3>#@section #{@_data}</h3>\n"
|
123
|
+
rescue => err
|
124
|
+
STDERR.puts "#{err}\n#{err.backtrace}"
|
125
|
+
exit
|
123
126
|
end
|
124
127
|
|
125
128
|
def subsec
|
@@ -127,7 +130,7 @@ def subsec
|
|
127
130
|
@subsec = "#@chapter.#@sec.#@sec2"
|
128
131
|
@toc << "#{_nbsp(6)}<b>#@subsec</b> #@_data<br>"
|
129
132
|
# _errout("section #@subsec")
|
130
|
-
|
133
|
+
_next_output(_slug(@_data))
|
131
134
|
_out "<h3>#@subsec #{@_data}</h3>\n"
|
132
135
|
end
|
133
136
|
|
@@ -222,8 +225,8 @@ def toc!
|
|
222
225
|
_debug "Closing TOC"
|
223
226
|
@toc.close
|
224
227
|
rescue => err
|
225
|
-
puts @body
|
226
|
-
@body = ""
|
228
|
+
puts @parent.body
|
229
|
+
@parent.body = ""
|
227
230
|
_errout "Exception: #{err.inspect}"
|
228
231
|
end
|
229
232
|
|
@@ -242,9 +245,8 @@ end
|
|
242
245
|
|
243
246
|
def missing
|
244
247
|
@toc << "#{_nbsp(8)}<font color=red>TBD: #@_data</font><br>"
|
245
|
-
|
246
|
-
_print "
|
247
|
-
_out "]</i></font><br>\n "
|
248
|
+
stuff = @_data.empty? ? "" : ": #@_data"
|
249
|
+
_print "<br><font color=red><i>[Material missing#{stuff}]</i></font><br>\n "
|
248
250
|
end
|
249
251
|
|
250
252
|
def TBC
|
@@ -262,6 +264,9 @@ def quote
|
|
262
264
|
_out "<blockquote>"
|
263
265
|
_body {|line| _out line }
|
264
266
|
_out "</blockquote>"
|
267
|
+
rescue => err
|
268
|
+
STDERR.puts "#{err}\n#{err.backtrace}"
|
269
|
+
exit
|
265
270
|
end
|
266
271
|
|
267
272
|
def init_bookish
|
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.96
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|