metanorma-standoc 1.11.4 → 2.0.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/rake.yml +3 -31
- data/.gitignore +23 -0
- data/lib/asciidoctor/standoc/base.rb +2 -145
- data/lib/asciidoctor/standoc/blocks.rb +2 -238
- data/lib/asciidoctor/standoc/blocks_notes.rb +2 -100
- data/lib/asciidoctor/standoc/cleanup.rb +2 -208
- data/lib/asciidoctor/standoc/cleanup_amend.rb +2 -53
- data/lib/asciidoctor/standoc/cleanup_block.rb +2 -172
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -212
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +2 -108
- data/lib/asciidoctor/standoc/cleanup_image.rb +2 -69
- data/lib/asciidoctor/standoc/cleanup_inline.rb +2 -189
- data/lib/asciidoctor/standoc/cleanup_maths.rb +2 -221
- data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -169
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +2 -103
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -110
- data/lib/asciidoctor/standoc/cleanup_section.rb +2 -184
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -91
- data/lib/asciidoctor/standoc/cleanup_symbols.rb +2 -47
- data/lib/asciidoctor/standoc/cleanup_table.rb +2 -67
- data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -139
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +2 -198
- data/lib/asciidoctor/standoc/cleanup_text.rb +2 -95
- data/lib/asciidoctor/standoc/cleanup_toc.rb +3 -0
- data/lib/asciidoctor/standoc/cleanup_xref.rb +2 -106
- data/lib/asciidoctor/standoc/converter.rb +2 -123
- data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +2 -56
- data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +2 -102
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +3 -404
- data/lib/asciidoctor/standoc/deprecated.rb +5 -0
- data/lib/asciidoctor/standoc/front.rb +2 -223
- data/lib/asciidoctor/standoc/front_contributor.rb +2 -191
- data/lib/asciidoctor/standoc/inline.rb +2 -231
- data/lib/asciidoctor/standoc/lists.rb +2 -119
- data/lib/asciidoctor/standoc/macros.rb +2 -203
- data/lib/asciidoctor/standoc/macros_form.rb +2 -62
- data/lib/asciidoctor/standoc/macros_note.rb +2 -44
- data/lib/asciidoctor/standoc/macros_plantuml.rb +2 -112
- data/lib/asciidoctor/standoc/macros_terms.rb +2 -180
- data/lib/asciidoctor/standoc/ref.rb +2 -251
- data/lib/asciidoctor/standoc/ref_sect.rb +2 -153
- data/lib/asciidoctor/standoc/ref_utility.rb +2 -0
- data/lib/asciidoctor/standoc/render.rb +2 -114
- data/lib/asciidoctor/standoc/reqt.rb +2 -89
- data/lib/asciidoctor/standoc/section.rb +2 -207
- data/lib/asciidoctor/standoc/table.rb +2 -84
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +2 -178
- data/lib/asciidoctor/standoc/terms.rb +2 -159
- data/lib/asciidoctor/standoc/utils.rb +2 -100
- data/lib/asciidoctor/standoc/validate.rb +2 -157
- data/lib/asciidoctor/standoc/validate_section.rb +2 -54
- data/lib/metanorma/standoc/base.rb +149 -0
- data/lib/{asciidoctor → metanorma}/standoc/basicdoc.rng +0 -0
- data/lib/{asciidoctor → metanorma}/standoc/biblio.rng +0 -0
- data/lib/metanorma/standoc/blocks.rb +239 -0
- data/lib/metanorma/standoc/blocks_notes.rb +101 -0
- data/lib/metanorma/standoc/cleanup.rb +146 -0
- data/lib/metanorma/standoc/cleanup_amend.rb +54 -0
- data/lib/metanorma/standoc/cleanup_block.rb +173 -0
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +213 -0
- data/lib/metanorma/standoc/cleanup_footnotes.rb +109 -0
- data/lib/metanorma/standoc/cleanup_image.rb +70 -0
- data/lib/metanorma/standoc/cleanup_inline.rb +190 -0
- data/lib/metanorma/standoc/cleanup_maths.rb +222 -0
- data/lib/metanorma/standoc/cleanup_ref.rb +170 -0
- data/lib/metanorma/standoc/cleanup_ref_dl.rb +104 -0
- data/lib/metanorma/standoc/cleanup_reqt.rb +111 -0
- data/lib/metanorma/standoc/cleanup_section.rb +212 -0
- data/lib/metanorma/standoc/cleanup_section_names.rb +92 -0
- data/lib/metanorma/standoc/cleanup_symbols.rb +48 -0
- data/lib/metanorma/standoc/cleanup_table.rb +68 -0
- data/lib/metanorma/standoc/cleanup_terms.rb +140 -0
- data/lib/metanorma/standoc/cleanup_terms_designations.rb +199 -0
- data/lib/metanorma/standoc/cleanup_text.rb +96 -0
- data/lib/metanorma/standoc/cleanup_toc.rb +98 -0
- data/lib/metanorma/standoc/cleanup_xref.rb +107 -0
- data/lib/metanorma/standoc/converter.rb +124 -0
- data/lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb +57 -0
- data/lib/metanorma/standoc/datamodel/diagram_preprocessor.rb +103 -0
- data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +409 -0
- data/lib/metanorma/standoc/front.rb +224 -0
- data/lib/metanorma/standoc/front_contributor.rb +192 -0
- data/lib/metanorma/standoc/inline.rb +232 -0
- data/lib/{asciidoctor → metanorma}/standoc/isodoc.rng +29 -0
- data/lib/metanorma/standoc/lists.rb +120 -0
- data/lib/metanorma/standoc/macros.rb +204 -0
- data/lib/metanorma/standoc/macros_form.rb +63 -0
- data/lib/metanorma/standoc/macros_note.rb +45 -0
- data/lib/metanorma/standoc/macros_plantuml.rb +113 -0
- data/lib/metanorma/standoc/macros_terms.rb +181 -0
- data/lib/metanorma/standoc/ref.rb +243 -0
- data/lib/metanorma/standoc/ref_sect.rb +153 -0
- data/lib/{asciidoctor/standoc/ref_date_id.rb → metanorma/standoc/ref_utility.rb} +43 -5
- data/lib/metanorma/standoc/render.rb +115 -0
- data/lib/metanorma/standoc/reqt.rb +90 -0
- data/lib/{asciidoctor → metanorma}/standoc/reqt.rng +0 -0
- data/lib/metanorma/standoc/section.rb +209 -0
- data/lib/metanorma/standoc/table.rb +85 -0
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +179 -0
- data/lib/metanorma/standoc/terms.rb +160 -0
- data/lib/metanorma/standoc/utils.rb +101 -0
- data/lib/metanorma/standoc/validate.rb +158 -0
- data/lib/metanorma/standoc/validate_section.rb +55 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/model_representation.adoc.erb +0 -0
- data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/plantuml_representation.adoc.erb +0 -0
- data/lib/metanorma-standoc.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/{asciidoctor → metanorma}/base_spec.rb +27 -10
- data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_blocks_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_sections_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +5 -5
- data/spec/{asciidoctor → metanorma}/cleanup_terms_spec.rb +2 -2
- data/spec/{asciidoctor → metanorma}/datamodel/attributes_table_preprocessor_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/datamodel/diagram_preprocessor_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/isobib_cache_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/macros_json2text_spec.rb +0 -0
- data/spec/{asciidoctor → metanorma}/macros_plantuml_spec.rb +3 -3
- data/spec/{asciidoctor → metanorma}/macros_spec.rb +6 -6
- data/spec/{asciidoctor → metanorma}/macros_yaml2text_spec.rb +0 -0
- data/spec/metanorma/refs_dl_spec.rb +863 -0
- data/spec/{asciidoctor → metanorma}/refs_spec.rb +399 -25
- data/spec/{asciidoctor → metanorma}/section_spec.rb +42 -17
- data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/validate_spec.rb +2 -2
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +42 -42
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +11 -11
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +21 -21
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +81 -81
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +10 -10
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -11
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +13 -13
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +82 -32
- data/spec/asciidoctor/refs_dl_spec.rb +0 -864
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
require "relaton_iec"
|
3
3
|
require "fileutils"
|
4
4
|
|
5
|
-
RSpec.describe
|
5
|
+
RSpec.describe Metanorma::Standoc do
|
6
6
|
it "applies smartquotes by default" do
|
7
7
|
input = <<~INPUT
|
8
8
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -778,7 +778,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
778
778
|
</sections>
|
779
779
|
</standard-document>
|
780
780
|
OUTPUT
|
781
|
-
expect(
|
781
|
+
expect(Metanorma::Standoc::Converter.new(nil, *OPTIONS)
|
782
782
|
.cleanup(Nokogiri::XML(input)).to_xml)
|
783
783
|
.to be_equivalent_to xmlpp(output)
|
784
784
|
end
|
@@ -836,7 +836,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
836
836
|
</bibliography>
|
837
837
|
</standard-document>
|
838
838
|
OUTPUT
|
839
|
-
expect(
|
839
|
+
expect(Metanorma::Standoc::Converter.new(nil, *OPTIONS)
|
840
840
|
.cleanup(Nokogiri::XML(input)).to_xml)
|
841
841
|
.to be_equivalent_to xmlpp(output)
|
842
842
|
end
|
@@ -1822,7 +1822,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1822
1822
|
<stage>published</stage>
|
1823
1823
|
</status>
|
1824
1824
|
<copyright>
|
1825
|
-
<from
|
1825
|
+
<from>#{Time.now.year}</from>
|
1826
1826
|
</copyright>
|
1827
1827
|
<ext>
|
1828
1828
|
<doctype>article</doctype>
|
@@ -1865,7 +1865,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1865
1865
|
private
|
1866
1866
|
|
1867
1867
|
def mock_mathml_italicise(string)
|
1868
|
-
allow_any_instance_of(::
|
1868
|
+
allow_any_instance_of(::Metanorma::Standoc::Cleanup)
|
1869
1869
|
.to receive(:mathml_mi_italics).and_return(string)
|
1870
1870
|
end
|
1871
1871
|
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
require "relaton_iec"
|
3
3
|
require "fileutils"
|
4
4
|
|
5
|
-
RSpec.describe
|
5
|
+
RSpec.describe Metanorma::Standoc do
|
6
6
|
it "processes term and designation metadata and term sources" do
|
7
7
|
input = <<~INPUT
|
8
8
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1341,7 +1341,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1341
1341
|
<stage>published</stage>
|
1342
1342
|
</status>
|
1343
1343
|
<copyright>
|
1344
|
-
<from
|
1344
|
+
<from>#{Time.now.year}</from>
|
1345
1345
|
</copyright>
|
1346
1346
|
<ext>
|
1347
1347
|
<doctype>article</doctype>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
RSpec.describe
|
5
|
+
RSpec.describe Metanorma::Standoc::Datamodel::AttributesTablePreprocessor do
|
6
6
|
describe "#process" do
|
7
7
|
context "when simple models without relations" do
|
8
8
|
let(:datamodel_file) do
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
RSpec.describe
|
5
|
+
RSpec.describe Metanorma::Standoc::Datamodel::DiagramPreprocessor do
|
6
6
|
describe "#process" do
|
7
7
|
context "when simple models without relations" do
|
8
8
|
let(:datamodel_file) do
|
@@ -266,7 +266,7 @@ ISO_123_DATED = <<~XML.freeze
|
|
266
266
|
</bibdata>
|
267
267
|
XML
|
268
268
|
|
269
|
-
RSpec.describe
|
269
|
+
RSpec.describe Metanorma::Standoc do
|
270
270
|
it "does not activate biblio caches if isobib disabled" do
|
271
271
|
FileUtils.rm_rf File.expand_path("~/.relaton-bib.pstore1")
|
272
272
|
FileUtils.mv(File.expand_path("~/.relaton/cache"),
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe
|
3
|
+
RSpec.describe Metanorma::Standoc do
|
4
4
|
it "processes the PlantUML macro" do
|
5
5
|
input = <<~INPUT
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -383,14 +383,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
383
383
|
private
|
384
384
|
|
385
385
|
def mock_plantuml_disabled
|
386
|
-
expect(
|
386
|
+
expect(Metanorma::Standoc::PlantUMLBlockMacroBackend)
|
387
387
|
.to receive(:plantuml_installed?) do
|
388
388
|
raise "PlantUML not installed"
|
389
389
|
end
|
390
390
|
end
|
391
391
|
|
392
392
|
def mock_localdir_unwritable
|
393
|
-
expect(
|
393
|
+
expect(Metanorma::Standoc::Utils).to receive(:localdir) do
|
394
394
|
"/"
|
395
395
|
end.exactly(2).times
|
396
396
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe
|
4
|
-
it "processes the
|
3
|
+
RSpec.describe Metanorma::Standoc do
|
4
|
+
it "processes the Metanorma::Standoc inline macros" do
|
5
5
|
input = <<~INPUT
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
preferred:[term0]
|
@@ -55,7 +55,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
55
55
|
.to be_equivalent_to xmlpp(output)
|
56
56
|
end
|
57
57
|
|
58
|
-
it "processes the
|
58
|
+
it "processes the Metanorma::Standoc index macros" do
|
59
59
|
input = <<~INPUT
|
60
60
|
#{ASCIIDOC_BLANK_HDR}
|
61
61
|
index:also[]
|
@@ -127,7 +127,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
127
127
|
.to be_equivalent_to xmlpp(output)
|
128
128
|
end
|
129
129
|
|
130
|
-
it "processes the
|
130
|
+
it "processes the Metanorma::Standoc variant macros" do
|
131
131
|
input = <<~INPUT
|
132
132
|
#{ASCIIDOC_BLANK_HDR}
|
133
133
|
== lang:en[English] lang:fr-Latn[Français]
|
@@ -163,7 +163,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
163
163
|
.to be_equivalent_to xmlpp(output)
|
164
164
|
end
|
165
165
|
|
166
|
-
it "processes the
|
166
|
+
it "processes the Metanorma::Standoc concept and related macros" do
|
167
167
|
input = <<~INPUT
|
168
168
|
#{ASCIIDOC_BLANK_HDR}
|
169
169
|
|
@@ -332,7 +332,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
332
332
|
.to be_equivalent_to xmlpp(output)
|
333
333
|
end
|
334
334
|
|
335
|
-
it "processes the
|
335
|
+
it "processes the Metanorma::Standoc concept macros for acronyms" do
|
336
336
|
input = <<~INPUT
|
337
337
|
#{ASCIIDOC_BLANK_HDR}
|
338
338
|
|
File without changes
|