liquidoc 0.9.4 → 0.9.5
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/asciidoctor/xref-stripper-preprocessor.rb +13 -0
- data/lib/liquidoc/version.rb +1 -1
- data/lib/liquidoc.rb +27 -5
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12b5d860a86e2b0c934b1cfc196df2a4ff6c92261eeea9770259716874f4b27f
|
4
|
+
data.tar.gz: 81e2e73815e12bccd7c4c09217ba1d86f6d8a96e4584842ebe2d2668958fe341
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2c552ee847fc84d2a45333f00923c8a1d5305fa3db8a4c262b2ebfec7da234222471e7e5a88e72edff1b9c88213a092d9fc2caa083a671f56a05f406ccd3d7c
|
7
|
+
data.tar.gz: 60fa6c8196d38b609f5a59f8d922c89d25926d4122bb437e82b455a3c3ad2902b61bb6c9269e59acff97c425c6a11b02e0b7e97f2da1bc74409251098d43f2fd
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
|
2
|
+
|
3
|
+
include Asciidoctor
|
4
|
+
|
5
|
+
Extensions.register {
|
6
|
+
preprocessor {
|
7
|
+
process {|document, reader|
|
8
|
+
Reader.new reader.readlines.map {|l|
|
9
|
+
(l.empty? || (l.start_with? '=')) ? l : %(#{l} +)
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
data/lib/liquidoc/version.rb
CHANGED
data/lib/liquidoc.rb
CHANGED
@@ -123,8 +123,12 @@ def iterate_build cfg
|
|
123
123
|
end
|
124
124
|
when "migrate"
|
125
125
|
inclusive = true
|
126
|
-
|
127
|
-
|
126
|
+
missing = "exit"
|
127
|
+
if step.options
|
128
|
+
inclusive = step.options['inclusive'] if step.options.has_key?("inclusive")
|
129
|
+
missing = step.options['missing'] if step.options.has_key?("missing")
|
130
|
+
end
|
131
|
+
copy_assets(step.source, step.target, inclusive, missing)
|
128
132
|
when "render"
|
129
133
|
validate_file_input(step.source, "source") if step.source
|
130
134
|
builds = step.builds
|
@@ -252,6 +256,7 @@ class BuildConfigStep
|
|
252
256
|
if (defined?(@step['action'])).nil?
|
253
257
|
raise "ConfigStructError"
|
254
258
|
end
|
259
|
+
@step['options'] = nil unless defined?(step['options'])
|
255
260
|
validate()
|
256
261
|
end
|
257
262
|
|
@@ -787,11 +792,25 @@ end
|
|
787
792
|
# ===
|
788
793
|
|
789
794
|
# Copy images and other files into target dir
|
790
|
-
def copy_assets src, dest, inclusive=true
|
795
|
+
def copy_assets src, dest, inclusive=true, missing='exit'
|
791
796
|
unless File.file?(src)
|
792
797
|
unless inclusive then src = src + "/." end
|
793
798
|
end
|
794
|
-
|
799
|
+
src_to_dest = "#{src} to #{dest}"
|
800
|
+
unless (File.file?(src) || File.directory?(src))
|
801
|
+
case missing
|
802
|
+
when "warn"
|
803
|
+
@logger.warn "Skipping migrate action (#{src_to_dest}); source not found."
|
804
|
+
return
|
805
|
+
when "skip"
|
806
|
+
@logger.debug "Skipping migrate action (#{src_to_dest}); source not found."
|
807
|
+
return
|
808
|
+
when "exit"
|
809
|
+
@logger.error "Unexpected missing source in migrate action (#{src_to_dest})."
|
810
|
+
raise "MissingSourceExit"
|
811
|
+
end
|
812
|
+
end
|
813
|
+
@logger.debug "Copying #{src_to_dest}"
|
795
814
|
begin
|
796
815
|
FileUtils.mkdir_p(dest) unless File.directory?(dest)
|
797
816
|
if File.directory?(src)
|
@@ -801,7 +820,7 @@ def copy_assets src, dest, inclusive=true
|
|
801
820
|
end
|
802
821
|
@logger.info "Copied #{src} to #{dest}."
|
803
822
|
rescue Exception => ex
|
804
|
-
@logger.
|
823
|
+
@logger.error "Problem while copying assets. #{ex.message}"
|
805
824
|
raise
|
806
825
|
end
|
807
826
|
end
|
@@ -905,6 +924,9 @@ def asciidocify doc, build
|
|
905
924
|
if build.backend == "pdf"
|
906
925
|
@logger.info "Generating PDF. This can take some time..."
|
907
926
|
end
|
927
|
+
|
928
|
+
|
929
|
+
|
908
930
|
Asciidoctor.convert_file(
|
909
931
|
doc.index,
|
910
932
|
to_file: to_file,
|
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.9.
|
4
|
+
version: 0.9.5
|
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: 2019-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -49,6 +49,7 @@ extensions: []
|
|
49
49
|
extra_rdoc_files: []
|
50
50
|
files:
|
51
51
|
- bin/liquidoc
|
52
|
+
- lib/asciidoctor/xref-stripper-preprocessor.rb
|
52
53
|
- lib/liquidoc.rb
|
53
54
|
- lib/liquidoc/version.rb
|
54
55
|
homepage: https://github.com/scalingdata/liquidoc
|
@@ -72,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
73
|
version: '0'
|
73
74
|
requirements: []
|
74
75
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.7.
|
76
|
+
rubygems_version: 2.7.6
|
76
77
|
signing_key:
|
77
78
|
specification_version: 4
|
78
79
|
summary: A highly configurable command-line tool for parsing data and content in common
|