metanorma-standoc 1.4.4 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +4 -9
- data/.github/workflows/ubuntu.yml +1 -5
- data/.github/workflows/windows.yml +2 -12
- data/.rubocop.yml +1 -1
- data/lib/asciidoctor/standoc/base.rb +11 -5
- data/lib/asciidoctor/standoc/base_structured_text_preprocessor.rb +123 -0
- data/lib/asciidoctor/standoc/basicdoc.rng +23 -0
- data/lib/asciidoctor/standoc/cleanup.rb +32 -12
- data/lib/asciidoctor/standoc/cleanup_amend.rb +54 -0
- data/lib/asciidoctor/standoc/cleanup_block.rb +0 -2
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +11 -24
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +0 -3
- data/lib/asciidoctor/standoc/cleanup_inline.rb +62 -1
- data/lib/asciidoctor/standoc/cleanup_ref.rb +10 -7
- data/lib/asciidoctor/standoc/cleanup_section.rb +91 -8
- data/lib/asciidoctor/standoc/cleanup_terms.rb +12 -2
- data/lib/asciidoctor/standoc/converter.rb +3 -3
- data/lib/asciidoctor/standoc/front.rb +0 -12
- data/lib/asciidoctor/standoc/front_contributor.rb +51 -10
- data/lib/asciidoctor/standoc/inline.rb +21 -31
- data/lib/asciidoctor/standoc/isodoc.rng +137 -21
- data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +44 -0
- data/lib/asciidoctor/standoc/log.rb +10 -1
- data/lib/asciidoctor/standoc/macros.rb +45 -33
- data/lib/asciidoctor/standoc/ref.rb +45 -45
- data/lib/asciidoctor/standoc/section.rb +39 -30
- data/lib/asciidoctor/standoc/table.rb +3 -2
- data/lib/asciidoctor/standoc/utils.rb +18 -1
- data/lib/asciidoctor/standoc/validate.rb +30 -18
- data/lib/asciidoctor/standoc/validate_section.rb +1 -1
- data/lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb +10 -10
- data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +46 -0
- data/lib/liquid/custom_blocks/key_iterator.rb +21 -0
- data/lib/liquid/custom_filters/values.rb +7 -0
- data/lib/metanorma/standoc.rb +0 -5
- data/lib/metanorma/standoc/version.rb +20 -1
- data/metanorma-standoc.gemspec +4 -5
- data/spec/asciidoctor-standoc/base_spec.rb +140 -7
- data/spec/asciidoctor-standoc/blocks_spec.rb +275 -149
- data/spec/asciidoctor-standoc/cleanup_spec.rb +1372 -56
- data/spec/asciidoctor-standoc/inline_spec.rb +133 -6
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +9 -7
- data/spec/asciidoctor-standoc/macros_json2text_spec.rb +10 -0
- data/spec/asciidoctor-standoc/macros_spec.rb +43 -23
- data/spec/asciidoctor-standoc/macros_yaml2text_spec.rb +5 -560
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +9 -7
- data/spec/asciidoctor-standoc/refs_spec.rb +43 -34
- data/spec/asciidoctor-standoc/section_spec.rb +42 -39
- data/spec/asciidoctor-standoc/table_spec.rb +119 -113
- data/spec/asciidoctor-standoc/validate_spec.rb +45 -1
- data/spec/assets/i18n.yaml +17 -2
- data/spec/examples/codes_table.html +1365 -1365
- data/spec/fixtures/macros_datamodel/address_class_profile.xml +46 -46
- data/spec/fixtures/macros_datamodel/address_component_profile.xml +21 -21
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +21 -21
- data/spec/metanorma/processor_spec.rb +1 -2
- data/spec/spec_helper.rb +110 -109
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +629 -0
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +71 -71
- data/spec/vcr_cassettes/isobib_get_123.yml +16 -16
- data/spec/vcr_cassettes/isobib_get_123_1.yml +36 -36
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +16 -16
- data/spec/vcr_cassettes/isobib_get_124.yml +17 -17
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +39 -37
- metadata +29 -14
- data/lib/asciidoctor-yaml/i18n-en.yaml +0 -20
- data/lib/asciidoctor-yaml/i18n-fr.yaml +0 -13
- data/lib/asciidoctor-yaml/i18n-zh-Hans.yaml +0 -15
- data/lib/asciidoctor/standoc/i18n.rb +0 -39
- data/lib/asciidoctor/standoc/macros_yaml2text.rb +0 -165
- data/lib/metanorma/standoc/latexml_requirement.rb +0 -62
- data/lib/metanorma/standoc/requirement.rb +0 -13
@@ -1,62 +0,0 @@
|
|
1
|
-
require_relative "./requirement"
|
2
|
-
|
3
|
-
module Metanorma
|
4
|
-
module Standoc
|
5
|
-
class LatexmlRequirement < Requirement
|
6
|
-
@recommended_version = '0.8.4'
|
7
|
-
@minimal_version = '0.8.0'
|
8
|
-
|
9
|
-
def initialize
|
10
|
-
version_output, = Open3.capture2e("latexml --VERSION")
|
11
|
-
version = version_output&.match(%r{\d+(.\d+)*})
|
12
|
-
|
13
|
-
if version.to_s.empty?
|
14
|
-
@error_message = "LaTeXML is not available. (Or is PATH not setup properly?)"\
|
15
|
-
" You must upgrade/install LaTeXML to a version higher than `#{@recommended_version}`"
|
16
|
-
|
17
|
-
elsif Gem::Version.new(version) < Gem::Version.new(@minimal_version)
|
18
|
-
@error_message = "Minimal supported LaTeXML version is `#{@minimal_version}` "\
|
19
|
-
"Version `#{version}` found; recommended version is `#{@recommended_version}`"
|
20
|
-
|
21
|
-
elsif Gem::Version.new(version) < Gem::Version.new(@recommended_version)
|
22
|
-
version = "unknown" if version.to_s.empty?
|
23
|
-
header_msg = "latexmlmath version `#{version}` below `#{@recommended_version}`!"
|
24
|
-
suggestion = if Gem.win_platform?
|
25
|
-
"cmd encoding is set to UTF-8 with `chcp 65001`"
|
26
|
-
else
|
27
|
-
"terminal encoding is set to UTF-8 with `export LANG=en_US.UTF-8`"
|
28
|
-
end
|
29
|
-
|
30
|
-
@error_message = "WARNING #{header_msg} Please sure that #{suggestion} command."
|
31
|
-
|
32
|
-
@cmd = 'latexmlmath --strict --preload=amsmath -- -'
|
33
|
-
@cmd2 = 'latexmlmath --strict -- -'
|
34
|
-
else
|
35
|
-
@cmd = 'latexmlmath --strict --preload=amsmath --inputencoding=UTF-8 -- -'
|
36
|
-
@cmd2 = 'latexmlmath --strict --inputencoding=UTF-8 -- -'
|
37
|
-
end
|
38
|
-
rescue
|
39
|
-
@error_message = "LaTeXML is not available. (Or is PATH not setup properly?)"\
|
40
|
-
" You must upgrade/install LaTeXML to a version higher than `#{@recommended_version}`"
|
41
|
-
end
|
42
|
-
|
43
|
-
def satisfied(abort = false)
|
44
|
-
unless @error_message.nil?
|
45
|
-
if abort
|
46
|
-
abort @error_message
|
47
|
-
else
|
48
|
-
warn @error_message
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
@error_message.nil?
|
53
|
-
end
|
54
|
-
|
55
|
-
def cmd
|
56
|
-
abort @error_message unless @error_message.nil?
|
57
|
-
|
58
|
-
[@cmd, @cmd2]
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|