livetext 0.9.52 → 0.9.56
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/imports/bookish.rb +3 -3
- data/lib/livetext/ast/show_ast_clean.rb +10 -0
- data/lib/livetext/ast/show_ast_result.rb +60 -0
- data/lib/livetext/ast/show_raw_arrays.rb +13 -0
- data/lib/livetext/ast.rb +464 -0
- data/lib/livetext/ast_to_html.rb +32 -0
- data/lib/livetext/core.rb +110 -53
- data/lib/livetext/errors.rb +1 -0
- data/lib/livetext/expansion.rb +21 -21
- data/lib/livetext/formatter.rb +70 -200
- data/lib/livetext/formatter_component.rb +189 -0
- data/lib/livetext/function_registry.rb +163 -0
- data/lib/livetext/functions.rb +26 -0
- data/lib/livetext/handler/mixin.rb +53 -0
- data/lib/livetext/helpers.rb +33 -16
- data/lib/livetext/reopen.rb +2 -0
- data/lib/livetext/skeleton.rb +0 -3
- data/lib/livetext/standard.rb +120 -72
- data/lib/livetext/userapi.rb +20 -1
- data/lib/livetext/variable_manager.rb +78 -0
- data/lib/livetext/variables.rb +9 -1
- data/lib/livetext/version.rb +1 -1
- data/lib/livetext.rb +9 -3
- data/plugin/booktool.rb +14 -14
- data/plugin/lt3scriptor.rb +914 -0
- data/plugin/mixin_functions_class.rb +33 -0
- data/test/snapshots/complex_body/expected-error.txt +0 -0
- data/test/snapshots/complex_body/expected-output.txt +8 -0
- data/test/snapshots/complex_body/source.lt3 +19 -0
- data/test/snapshots/debug_command/expected-error.txt +0 -0
- data/test/snapshots/debug_command/expected-output.txt +1 -0
- data/test/snapshots/debug_command/source.lt3 +3 -0
- data/test/snapshots/def_parameters/expected-error.txt +0 -0
- data/test/snapshots/def_parameters/expected-output.txt +21 -0
- data/test/snapshots/def_parameters/source.lt3 +44 -0
- data/test/snapshots/error_missing_end/match-error.txt +1 -1
- data/test/snapshots/functions_reflection/expected-error.txt +0 -0
- data/test/snapshots/functions_reflection/expected-output.txt +27 -0
- data/test/snapshots/functions_reflection/source.lt3 +5 -0
- data/test/snapshots/mixin_functions_class/expected-error.txt +0 -0
- data/test/snapshots/mixin_functions_class/expected-output.txt +20 -0
- data/test/snapshots/mixin_functions_class/mixin_functions_class.rb +33 -0
- data/test/snapshots/mixin_functions_class/source.lt3 +17 -0
- data/test/snapshots/multiple_functions/expected-error.txt +0 -0
- data/test/snapshots/multiple_functions/expected-output.txt +5 -0
- data/test/snapshots/multiple_functions/source.lt3 +16 -0
- data/test/snapshots/nested_includes/expected-error.txt +0 -0
- data/test/snapshots/nested_includes/expected-output.txt +68 -0
- data/test/snapshots/nested_includes/level2.inc +34 -0
- data/test/snapshots/nested_includes/level3.inc +20 -0
- data/test/snapshots/nested_includes/source.lt3 +49 -0
- data/test/snapshots/parameter_handling/expected-error.txt +0 -0
- data/test/snapshots/parameter_handling/expected-output.txt +7 -0
- data/test/snapshots/parameter_handling/source.lt3 +10 -0
- data/test/snapshots/subset.txt +1 -0
- data/test/snapshots/system_info/expected-error.txt +0 -0
- data/test/snapshots/system_info/match-output.txt +18 -0
- data/test/snapshots/system_info/source.lt3 +16 -0
- data/test/unit/all.rb +7 -0
- data/test/unit/ast.rb +90 -0
- data/test/unit/ast_directives.rb +104 -0
- data/test/unit/ast_variables.rb +71 -0
- data/test/unit/core_methods.rb +317 -0
- data/test/unit/formatter.rb +84 -0
- data/test/unit/formatter_component.rb +84 -0
- data/test/unit/function_registry.rb +132 -0
- data/test/unit/mixin_functions_class.rb +131 -0
- data/test/unit/stringparser.rb +14 -32
- data/test/unit/variable_manager.rb +71 -0
- metadata +51 -5
- data/imports/markdown.rb +0 -44
- data/lib/livetext/processor.rb +0 -88
- data/plugin/markdown.rb +0 -43
data/plugin/booktool.rb
CHANGED
@@ -67,12 +67,12 @@ end
|
|
67
67
|
|
68
68
|
# These are duplicated. Remove safely
|
69
69
|
|
70
|
-
def h1(args = nil, body = nil); api.out html.tag(:h1, api.data); return true; end
|
71
|
-
def h2(args = nil, body = nil); api.out html.tag(:h2, api.data); return true; end
|
72
|
-
def h3(args = nil, body = nil); api.out html.tag(:h3, api.data); return true; end
|
73
|
-
def h4(args = nil, body = nil); api.out html.tag(:h4, api.data); return true; end
|
74
|
-
def h5(args = nil, body = nil); api.out html.tag(:h5, api.data); return true; end
|
75
|
-
def h6(args = nil, body = nil); api.out html.tag(:h6, api.data); return true; end
|
70
|
+
def h1(args = nil, body = nil); api.out html.tag(:h1, cdata: api.data); return true; end
|
71
|
+
def h2(args = nil, body = nil); api.out html.tag(:h2, cdata: api.data); return true; end
|
72
|
+
def h3(args = nil, body = nil); api.out html.tag(:h3, cdata: api.data); return true; end
|
73
|
+
def h4(args = nil, body = nil); api.out html.tag(:h4, cdata: api.data); return true; end
|
74
|
+
def h5(args = nil, body = nil); api.out html.tag(:h5, cdata: api.data); return true; end
|
75
|
+
def h6(args = nil, body = nil); api.out html.tag(:h6, cdata: api.data); return true; end
|
76
76
|
|
77
77
|
def alpha_columns(args = nil, body = nil)
|
78
78
|
n = api.args.first.to_i # FIXME: what if it's missing?
|
@@ -301,8 +301,8 @@ def toc!(args = nil, body = nil)
|
|
301
301
|
@toc.close
|
302
302
|
api.optional_blank_line
|
303
303
|
rescue => err
|
304
|
-
puts
|
305
|
-
|
304
|
+
puts self.body
|
305
|
+
self.body = ""
|
306
306
|
_errout "Exception: #{err.inspect}"
|
307
307
|
end
|
308
308
|
|
@@ -391,9 +391,9 @@ def close_output(args = nil, body = nil)
|
|
391
391
|
return if @output == STDOUT
|
392
392
|
@_outdir ||= "."
|
393
393
|
@output.puts "<meta charset='UTF-8'>\n\n"
|
394
|
-
@output.puts
|
394
|
+
@output.puts self.body
|
395
395
|
@output.close
|
396
|
-
|
396
|
+
self.body = "" # See bin/livetext
|
397
397
|
@output = STDOUT
|
398
398
|
end
|
399
399
|
|
@@ -412,8 +412,8 @@ def next_output(args = nil, body = nil)
|
|
412
412
|
@_outdir ||= "."
|
413
413
|
unless @output.nil?
|
414
414
|
@output.puts "<meta charset='UTF-8'>\n\n"
|
415
|
-
|
416
|
-
|
415
|
+
@output.puts self.body
|
416
|
+
self.body = ""
|
417
417
|
@output.close unless @output == STDOUT
|
418
418
|
end
|
419
419
|
fname = @_outdir + "/" + fname
|
@@ -427,8 +427,8 @@ def output(args = nil, body = nil)
|
|
427
427
|
# _output(name)
|
428
428
|
@_outdir ||= "." # FIXME
|
429
429
|
@output.puts "<meta charset='UTF-8'>\n\n"
|
430
|
-
@output.puts
|
431
|
-
|
430
|
+
@output.puts self.body
|
431
|
+
self.body = ""
|
432
432
|
@output.close unless @output == STDOUT
|
433
433
|
fname = @_outdir + "/" + name #; STDERR.puts "--- _output: fname = #{fname.inspect}"
|
434
434
|
@output = File.open(fname, "w") #; STDERR.puts "---- @out = #{@output.inspect}"
|