liquidoc 0.12.0.pre.rc4 → 0.12.0.pre.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liquidoc.rb +20 -6
- data/lib/liquidoc/version.rb +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: 40a1c127ce84efe07e6762641c2cc16d8248770cf8c8b2e65f5e1ae299ac5fa4
|
4
|
+
data.tar.gz: 35436583f8eb40766990bc1740ef60541160c7d2c4f67b1c71277e1f6f653d68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ad1a76573b551921a54b4595a79621fbbef203f4506882ac30baa3fc71fb40a8a735981340e1f7c70755fb9f660a1aca71ebe4a04fcff56325fc7adbd62c0ee
|
7
|
+
data.tar.gz: 60072de6a7cd07e61dcbf73c43d88d6d816c0509400247c0ba2326a0f4d6eb80c4ad9084563ac34cfad71b4bbf9a0eab2433af7f28aa4ba8fd7afca5fe67dd2f
|
data/lib/liquidoc.rb
CHANGED
@@ -45,7 +45,6 @@ require 'highline'
|
|
45
45
|
@attributes_file = @attributes_file_def
|
46
46
|
@pdf_theme_file = 'theme/pdf-theme.yml'
|
47
47
|
@fonts_dir = 'theme/fonts/'
|
48
|
-
@output_filename = 'index'
|
49
48
|
@attributes = {}
|
50
49
|
@passed_attrs = {}
|
51
50
|
@passed_vars = {}
|
@@ -888,6 +887,11 @@ end
|
|
888
887
|
def cli_liquify data_files=nil, template_file=nil, output_file=nil, passed_vars
|
889
888
|
# converts command-line options into liquify or regurgidata inputs
|
890
889
|
data_obj = DataObj.new()
|
890
|
+
if output_file
|
891
|
+
output = output_file
|
892
|
+
else
|
893
|
+
output = "stdout"
|
894
|
+
end
|
891
895
|
if data_files
|
892
896
|
payload = get_payload(data_files)
|
893
897
|
data_obj.add_payload!(payload)
|
@@ -895,11 +899,11 @@ def cli_liquify data_files=nil, template_file=nil, output_file=nil, passed_vars
|
|
895
899
|
if template_file
|
896
900
|
# data_obj.add_data!(ingested, "data") if df
|
897
901
|
data_obj.add_data!(passed_vars, "vars") if passed_vars
|
898
|
-
liquify(data_obj, template_file,
|
902
|
+
liquify(data_obj, template_file, output)
|
899
903
|
else
|
900
904
|
data_obj.remove_scope("vars")
|
901
905
|
data_obj.add_data!(passed_vars) if passed_vars
|
902
|
-
regurgidata(data_obj,
|
906
|
+
regurgidata(data_obj, output)
|
903
907
|
end
|
904
908
|
end
|
905
909
|
|
@@ -1294,6 +1298,16 @@ module CustomFilters
|
|
1294
1298
|
input.to_s.gsub(Regexp.new(regex), replacement.to_s)
|
1295
1299
|
end
|
1296
1300
|
|
1301
|
+
def to_yaml input
|
1302
|
+
o = input.to_yaml
|
1303
|
+
o = o.gsub(/^\-\-\-$\n/, "")
|
1304
|
+
o
|
1305
|
+
end
|
1306
|
+
|
1307
|
+
def to_json input
|
1308
|
+
o = input.to_json
|
1309
|
+
o
|
1310
|
+
end
|
1297
1311
|
end
|
1298
1312
|
|
1299
1313
|
# register custom Liquid filters
|
@@ -1344,7 +1358,7 @@ command_parser = OptionParser.new do|opts|
|
|
1344
1358
|
end
|
1345
1359
|
|
1346
1360
|
opts.on("-o PATH", "--output=PATH", "Output file path for generated content. Ex. path/to/file.adoc. Required unless --config is called.") do |n|
|
1347
|
-
@
|
1361
|
+
@output = @base_dir + n
|
1348
1362
|
end
|
1349
1363
|
|
1350
1364
|
opts.on("-t PATH", "--template=PATH", "Path to liquid template. Required unless --configuration is called." ) do |n|
|
@@ -1369,7 +1383,7 @@ command_parser = OptionParser.new do|opts|
|
|
1369
1383
|
end
|
1370
1384
|
|
1371
1385
|
opts.on("--stdout", "Puts the output in STDOUT instead of writing to a file.") do
|
1372
|
-
@
|
1386
|
+
@output = "stdout"
|
1373
1387
|
end
|
1374
1388
|
|
1375
1389
|
opts.on("--deploy", "EXPERIMENTAL: Trigger a jekyll serve operation against the destination dir of a Jekyll render step.") do
|
@@ -1425,7 +1439,7 @@ explainer_init
|
|
1425
1439
|
unless @config_file
|
1426
1440
|
@logger.debug "Executing config-free build based on API/CLI arguments alone."
|
1427
1441
|
if @data_files
|
1428
|
-
cli_liquify(@data_files, @template_file, @
|
1442
|
+
cli_liquify(@data_files, @template_file, @output, @passed_vars)
|
1429
1443
|
end
|
1430
1444
|
if @index_file
|
1431
1445
|
@logger.warn "Rendering via command line arguments is not yet implemented. Use a config file."
|
data/lib/liquidoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquidoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.0.pre.
|
4
|
+
version: 0.12.0.pre.rc5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Dominick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|