metanorma-standoc 2.2.5 → 2.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/html/htmlstyle.css +1 -1
- data/lib/metanorma/standoc/base.rb +4 -5
- data/lib/metanorma/standoc/basicdoc.rng +0 -27
- data/lib/metanorma/standoc/biblio-standoc.rng +164 -0
- data/lib/metanorma/standoc/biblio.rng +50 -18
- data/lib/metanorma/standoc/cleanup.rb +18 -17
- data/lib/metanorma/standoc/cleanup_amend.rb +2 -2
- data/lib/metanorma/standoc/cleanup_asciibib.rb +110 -0
- data/lib/metanorma/standoc/cleanup_biblio.rb +7 -112
- data/lib/metanorma/standoc/cleanup_block.rb +7 -6
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +6 -6
- data/lib/metanorma/standoc/cleanup_inline.rb +2 -2
- data/lib/metanorma/standoc/cleanup_maths.rb +12 -4
- data/lib/metanorma/standoc/cleanup_section.rb +19 -9
- data/lib/metanorma/standoc/cleanup_symbols.rb +14 -7
- data/lib/metanorma/standoc/cleanup_text.rb +19 -6
- data/lib/metanorma/standoc/cleanup_toc.rb +1 -2
- data/lib/metanorma/standoc/cleanup_xref.rb +55 -14
- data/lib/metanorma/standoc/inline.rb +29 -12
- data/lib/metanorma/standoc/isodoc-compile.rng +7 -0
- data/lib/metanorma/standoc/isodoc.rng +69 -207
- data/lib/metanorma/standoc/ref_utility.rb +1 -0
- data/lib/metanorma/standoc/render.rb +10 -1
- data/lib/metanorma/standoc/section.rb +10 -3
- data/lib/metanorma/standoc/utils.rb +6 -1
- data/lib/metanorma/standoc/validate.rb +9 -9
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +5 -3
- metadata +7 -141
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/Rakefile +0 -8
- data/bin/rspec +0 -18
- data/spec/assets/a1.adoc +0 -8
- data/spec/assets/a2.adoc +0 -10
- data/spec/assets/a3.adoc +0 -9
- data/spec/assets/a3a.adoc +0 -7
- data/spec/assets/a4.adoc +0 -4
- data/spec/assets/boilerplate.xml +0 -4
- data/spec/assets/codes.yml +0 -695
- data/spec/assets/correct.png +0 -0
- data/spec/assets/corrupt.png +0 -0
- data/spec/assets/header.html +0 -7
- data/spec/assets/html-override.css +0 -1
- data/spec/assets/html.scss +0 -13
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -17
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -8
- data/spec/assets/iso123.rxl +0 -107
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word-override.css +0 -1
- data/spec/assets/word.scss +0 -13
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/assets/xref_error.adoc +0 -8
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/codes_table.html +0 -3174
- data/spec/examples/datamodel/address_class_profile.adoc +0 -5
- data/spec/examples/datamodel/address_class_profile.presentation.xml +0 -14
- data/spec/examples/datamodel/address_component_profile.adoc +0 -5
- data/spec/examples/datamodel/blank_definition_profile.adoc +0 -5
- data/spec/examples/datamodel/common_models_diagram.adoc +0 -5
- data/spec/examples/datamodel/models/models/AddressClassProfile.yml +0 -90
- data/spec/examples/datamodel/models/models/AddressComponentProfile.yml +0 -63
- data/spec/examples/datamodel/models/models/AddressComponentSpecification.yml +0 -15
- data/spec/examples/datamodel/models/models/AddressProfile.yml +0 -36
- data/spec/examples/datamodel/models/models/AttributeProfile.yml +0 -32
- data/spec/examples/datamodel/models/models/InterchangeAddressClassProfile.yml +0 -79
- data/spec/examples/datamodel/models/models/Localization copy.yml +0 -23
- data/spec/examples/datamodel/models/models/Localization.yml +0 -23
- data/spec/examples/datamodel/models/models/ProfileCompliantAddress.yml +0 -36
- data/spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml +0 -15
- data/spec/examples/datamodel/models/models/Signature.yml +0 -20
- data/spec/examples/datamodel/models/models/SignatureBlankDefinition.yml +0 -20
- data/spec/examples/datamodel/models/models/TextDirectionCode copy.yml +0 -16
- data/spec/examples/datamodel/models/models/TextDirectionCode.yml +0 -16
- data/spec/examples/datamodel/models/models/Validity.yml +0 -14
- data/spec/examples/datamodel/models/models/iso19160-1/Address.yml +0 -22
- data/spec/examples/datamodel/models/models/iso19160-1/AddressComponent.yml +0 -2
- data/spec/examples/datamodel/models/style.uml.inc +0 -37
- data/spec/examples/datamodel/models/views/CommonModels.yml +0 -9
- data/spec/examples/datamodel/models/views/TopDown.yml +0 -62
- data/spec/examples/datamodel/top_down_diagram.adoc +0 -5
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -46
- data/spec/examples/iso_123_all_parts.xml +0 -46
- data/spec/examples/iso_123_no_year_note.xml +0 -47
- data/spec/examples/iso_124_.xml +0 -42
- data/spec/examples/iso_216_.xml +0 -48
- data/spec/examples/iso_iec_12382_.xml +0 -49
- data/spec/examples/rice.adoc +0 -715
- data/spec/examples/rice.preview.html +0 -1877
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_images/rice_image1.png +0 -0
- data/spec/examples/rice_images/rice_image2.png +0 -0
- data/spec/examples/rice_images/rice_image3_1.png +0 -0
- data/spec/examples/rice_images/rice_image3_2.png +0 -0
- data/spec/examples/rice_images/rice_image3_3.png +0 -0
- data/spec/fixtures/action_schemaexpg1.svg +0 -122
- data/spec/fixtures/datamodel_description_sections_tree.xml +0 -327
- data/spec/fixtures/diagram_definitions.lutaml +0 -22
- data/spec/fixtures/macros_datamodel/address_class_profile.xml +0 -149
- data/spec/fixtures/macros_datamodel/address_component_profile.xml +0 -71
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +0 -51
- data/spec/fixtures/macros_datamodel/common_models_diagram.xml +0 -7
- data/spec/fixtures/macros_datamodel/top_down_diagram.xml +0 -7
- data/spec/fixtures/test.exp +0 -121
- data/spec/fixtures/test.xmi +0 -9250
- data/spec/metanorma/base_spec.rb +0 -1125
- data/spec/metanorma/biblio_spec.rb +0 -1004
- data/spec/metanorma/blank_spec.rb +0 -37
- data/spec/metanorma/blocks_spec.rb +0 -1784
- data/spec/metanorma/cleanup_blocks_spec.rb +0 -1099
- data/spec/metanorma/cleanup_sections_spec.rb +0 -1850
- data/spec/metanorma/cleanup_spec.rb +0 -1920
- data/spec/metanorma/cleanup_terms_spec.rb +0 -1543
- data/spec/metanorma/datamodel/attributes_table_preprocessor_spec.rb +0 -111
- data/spec/metanorma/datamodel/diagram_preprocessor_spec.rb +0 -72
- data/spec/metanorma/inline_spec.rb +0 -724
- data/spec/metanorma/isobib_cache_spec.rb +0 -742
- data/spec/metanorma/lists_spec.rb +0 -232
- data/spec/metanorma/macros_concept_spec.rb +0 -1052
- data/spec/metanorma/macros_json2text_spec.rb +0 -10
- data/spec/metanorma/macros_plantuml_spec.rb +0 -402
- data/spec/metanorma/macros_spec.rb +0 -1183
- data/spec/metanorma/macros_yaml2text_spec.rb +0 -10
- data/spec/metanorma/processor_spec.rb +0 -96
- data/spec/metanorma/refs_spec.rb +0 -2807
- data/spec/metanorma/reqt_spec.rb +0 -130
- data/spec/metanorma/section_spec.rb +0 -1325
- data/spec/metanorma/table_spec.rb +0 -474
- data/spec/metanorma/validate_spec.rb +0 -886
- data/spec/spec_helper.rb +0 -290
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +0 -781
- data/spec/vcr_cassettes/bsi16341.yml +0 -488
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +0 -611
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +0 -149
- data/spec/vcr_cassettes/hide_refs.yml +0 -587
- data/spec/vcr_cassettes/isobib_get_123.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_123_1.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +0 -385
- data/spec/vcr_cassettes/isobib_get_123_2.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_124.yml +0 -149
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +0 -351
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +0 -560
- data/spec/vcr_cassettes/std-link.yml +0 -149
@@ -1,96 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "metanorma"
|
3
|
-
require "fileutils"
|
4
|
-
|
5
|
-
RSpec.describe Metanorma::Standoc::Processor do
|
6
|
-
registry = Metanorma::Registry.instance
|
7
|
-
registry.register(Metanorma::Standoc::Processor)
|
8
|
-
processor = registry.find_processor(:standoc)
|
9
|
-
|
10
|
-
it "registers against metanorma" do
|
11
|
-
expect(processor).not_to be nil
|
12
|
-
end
|
13
|
-
|
14
|
-
it "registers output formats against metanorma" do
|
15
|
-
expect(processor.output_formats.sort.to_s).to be_equivalent_to <<~"OUTPUT"
|
16
|
-
[[:doc, "doc"], [:html, "html"], [:pdf, "pdf"], [:presentation, "presentation.xml"], [:rxl, "rxl"], [:xml, "xml"]]
|
17
|
-
OUTPUT
|
18
|
-
end
|
19
|
-
|
20
|
-
it "registers version against metanorma" do
|
21
|
-
expect(processor.version.to_s).to match(%r{^Metanorma::Standoc })
|
22
|
-
expect(processor.version.to_s).to match(%r{/IsoDoc })
|
23
|
-
end
|
24
|
-
|
25
|
-
it "generates IsoDoc XML from a blank document" do
|
26
|
-
input = <<~INPUT
|
27
|
-
#{ASCIIDOC_BLANK_HDR}
|
28
|
-
INPUT
|
29
|
-
output = <<~"OUTPUT"
|
30
|
-
#{BLANK_HDR}
|
31
|
-
<sections/>
|
32
|
-
</iso-standard>
|
33
|
-
OUTPUT
|
34
|
-
expect(processor.input_to_isodoc(input, "test"))
|
35
|
-
.to be_equivalent_to output
|
36
|
-
end
|
37
|
-
|
38
|
-
it "generates HTML from IsoDoc XML" do
|
39
|
-
FileUtils.rm_f "test.html"
|
40
|
-
processor.output(<<~"INPUT", "test.xml", "test.html", :html)
|
41
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
42
|
-
<sections>
|
43
|
-
<terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
44
|
-
<term id="J">
|
45
|
-
<preferred>Term2</preferred>
|
46
|
-
</term>
|
47
|
-
</terms>
|
48
|
-
</sections>
|
49
|
-
</iso-standard>
|
50
|
-
INPUT
|
51
|
-
expect(File.read("test.html", encoding: "utf-8")
|
52
|
-
.gsub(%r{^.*<main}m, "<main")
|
53
|
-
.gsub(%r{</main>.*}m, "</main>"))
|
54
|
-
.to be_equivalent_to <<~"OUTPUT"
|
55
|
-
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
56
|
-
<p class="zzSTDTitle1"></p>
|
57
|
-
<div id="H"><h1>Terms, Definitions, Symbols and Abbreviated Terms</h1><h2 class="TermNum" id="J"></h2>
|
58
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
59
|
-
</div>
|
60
|
-
</main>
|
61
|
-
OUTPUT
|
62
|
-
end
|
63
|
-
|
64
|
-
it "generates HTML from IsoDoc XML" do
|
65
|
-
FileUtils.rm_f "test.doc"
|
66
|
-
processor.output(<<~"INPUT", "test.xml", "test.doc", :doc)
|
67
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
68
|
-
<sections>
|
69
|
-
<terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
70
|
-
<term id="J">
|
71
|
-
<preferred>Term2</preferred>
|
72
|
-
</term>
|
73
|
-
</terms>
|
74
|
-
</sections>
|
75
|
-
</iso-standard>
|
76
|
-
INPUT
|
77
|
-
expect(File.read("test.doc", encoding: "utf-8"))
|
78
|
-
.to match(/Terms, Definitions, Symbols and Abbreviated Terms/)
|
79
|
-
end
|
80
|
-
|
81
|
-
it "generates XML from IsoDoc XML" do
|
82
|
-
FileUtils.rm_f "test.xml"
|
83
|
-
processor.output(<<~"INPUT", "test.xml", "test.xml", :xml)
|
84
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
85
|
-
<sections>
|
86
|
-
<terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
87
|
-
<term id="J">
|
88
|
-
<preferred>Term2</preferred>
|
89
|
-
</term>
|
90
|
-
</terms>
|
91
|
-
</sections>
|
92
|
-
</iso-standard>
|
93
|
-
INPUT
|
94
|
-
expect(File.exist?("test.xml")).to be true
|
95
|
-
end
|
96
|
-
end
|