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.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -31
  3. data/.gitignore +23 -0
  4. data/lib/asciidoctor/standoc/base.rb +2 -145
  5. data/lib/asciidoctor/standoc/blocks.rb +2 -238
  6. data/lib/asciidoctor/standoc/blocks_notes.rb +2 -100
  7. data/lib/asciidoctor/standoc/cleanup.rb +2 -208
  8. data/lib/asciidoctor/standoc/cleanup_amend.rb +2 -53
  9. data/lib/asciidoctor/standoc/cleanup_block.rb +2 -172
  10. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -212
  11. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +2 -108
  12. data/lib/asciidoctor/standoc/cleanup_image.rb +2 -69
  13. data/lib/asciidoctor/standoc/cleanup_inline.rb +2 -189
  14. data/lib/asciidoctor/standoc/cleanup_maths.rb +2 -221
  15. data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -169
  16. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +2 -103
  17. data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -110
  18. data/lib/asciidoctor/standoc/cleanup_section.rb +2 -184
  19. data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -91
  20. data/lib/asciidoctor/standoc/cleanup_symbols.rb +2 -47
  21. data/lib/asciidoctor/standoc/cleanup_table.rb +2 -67
  22. data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -139
  23. data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +2 -198
  24. data/lib/asciidoctor/standoc/cleanup_text.rb +2 -95
  25. data/lib/asciidoctor/standoc/cleanup_toc.rb +3 -0
  26. data/lib/asciidoctor/standoc/cleanup_xref.rb +2 -106
  27. data/lib/asciidoctor/standoc/converter.rb +2 -123
  28. data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +2 -56
  29. data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +2 -102
  30. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +3 -404
  31. data/lib/asciidoctor/standoc/deprecated.rb +5 -0
  32. data/lib/asciidoctor/standoc/front.rb +2 -223
  33. data/lib/asciidoctor/standoc/front_contributor.rb +2 -191
  34. data/lib/asciidoctor/standoc/inline.rb +2 -231
  35. data/lib/asciidoctor/standoc/lists.rb +2 -119
  36. data/lib/asciidoctor/standoc/macros.rb +2 -203
  37. data/lib/asciidoctor/standoc/macros_form.rb +2 -62
  38. data/lib/asciidoctor/standoc/macros_note.rb +2 -44
  39. data/lib/asciidoctor/standoc/macros_plantuml.rb +2 -112
  40. data/lib/asciidoctor/standoc/macros_terms.rb +2 -180
  41. data/lib/asciidoctor/standoc/ref.rb +2 -251
  42. data/lib/asciidoctor/standoc/ref_sect.rb +2 -153
  43. data/lib/asciidoctor/standoc/ref_utility.rb +2 -0
  44. data/lib/asciidoctor/standoc/render.rb +2 -114
  45. data/lib/asciidoctor/standoc/reqt.rb +2 -89
  46. data/lib/asciidoctor/standoc/section.rb +2 -207
  47. data/lib/asciidoctor/standoc/table.rb +2 -84
  48. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +2 -178
  49. data/lib/asciidoctor/standoc/terms.rb +2 -159
  50. data/lib/asciidoctor/standoc/utils.rb +2 -100
  51. data/lib/asciidoctor/standoc/validate.rb +2 -157
  52. data/lib/asciidoctor/standoc/validate_section.rb +2 -54
  53. data/lib/metanorma/standoc/base.rb +149 -0
  54. data/lib/{asciidoctor → metanorma}/standoc/basicdoc.rng +0 -0
  55. data/lib/{asciidoctor → metanorma}/standoc/biblio.rng +0 -0
  56. data/lib/metanorma/standoc/blocks.rb +239 -0
  57. data/lib/metanorma/standoc/blocks_notes.rb +101 -0
  58. data/lib/metanorma/standoc/cleanup.rb +146 -0
  59. data/lib/metanorma/standoc/cleanup_amend.rb +54 -0
  60. data/lib/metanorma/standoc/cleanup_block.rb +173 -0
  61. data/lib/metanorma/standoc/cleanup_boilerplate.rb +213 -0
  62. data/lib/metanorma/standoc/cleanup_footnotes.rb +109 -0
  63. data/lib/metanorma/standoc/cleanup_image.rb +70 -0
  64. data/lib/metanorma/standoc/cleanup_inline.rb +190 -0
  65. data/lib/metanorma/standoc/cleanup_maths.rb +222 -0
  66. data/lib/metanorma/standoc/cleanup_ref.rb +170 -0
  67. data/lib/metanorma/standoc/cleanup_ref_dl.rb +104 -0
  68. data/lib/metanorma/standoc/cleanup_reqt.rb +111 -0
  69. data/lib/metanorma/standoc/cleanup_section.rb +212 -0
  70. data/lib/metanorma/standoc/cleanup_section_names.rb +92 -0
  71. data/lib/metanorma/standoc/cleanup_symbols.rb +48 -0
  72. data/lib/metanorma/standoc/cleanup_table.rb +68 -0
  73. data/lib/metanorma/standoc/cleanup_terms.rb +140 -0
  74. data/lib/metanorma/standoc/cleanup_terms_designations.rb +199 -0
  75. data/lib/metanorma/standoc/cleanup_text.rb +96 -0
  76. data/lib/metanorma/standoc/cleanup_toc.rb +98 -0
  77. data/lib/metanorma/standoc/cleanup_xref.rb +107 -0
  78. data/lib/metanorma/standoc/converter.rb +124 -0
  79. data/lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb +57 -0
  80. data/lib/metanorma/standoc/datamodel/diagram_preprocessor.rb +103 -0
  81. data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +409 -0
  82. data/lib/metanorma/standoc/front.rb +224 -0
  83. data/lib/metanorma/standoc/front_contributor.rb +192 -0
  84. data/lib/metanorma/standoc/inline.rb +232 -0
  85. data/lib/{asciidoctor → metanorma}/standoc/isodoc.rng +29 -0
  86. data/lib/metanorma/standoc/lists.rb +120 -0
  87. data/lib/metanorma/standoc/macros.rb +204 -0
  88. data/lib/metanorma/standoc/macros_form.rb +63 -0
  89. data/lib/metanorma/standoc/macros_note.rb +45 -0
  90. data/lib/metanorma/standoc/macros_plantuml.rb +113 -0
  91. data/lib/metanorma/standoc/macros_terms.rb +181 -0
  92. data/lib/metanorma/standoc/ref.rb +243 -0
  93. data/lib/metanorma/standoc/ref_sect.rb +153 -0
  94. data/lib/{asciidoctor/standoc/ref_date_id.rb → metanorma/standoc/ref_utility.rb} +43 -5
  95. data/lib/metanorma/standoc/render.rb +115 -0
  96. data/lib/metanorma/standoc/reqt.rb +90 -0
  97. data/lib/{asciidoctor → metanorma}/standoc/reqt.rng +0 -0
  98. data/lib/metanorma/standoc/section.rb +209 -0
  99. data/lib/metanorma/standoc/table.rb +85 -0
  100. data/lib/metanorma/standoc/term_lookup_cleanup.rb +179 -0
  101. data/lib/metanorma/standoc/terms.rb +160 -0
  102. data/lib/metanorma/standoc/utils.rb +101 -0
  103. data/lib/metanorma/standoc/validate.rb +158 -0
  104. data/lib/metanorma/standoc/validate_section.rb +55 -0
  105. data/lib/metanorma/standoc/version.rb +1 -1
  106. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/model_representation.adoc.erb +0 -0
  107. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/plantuml_representation.adoc.erb +0 -0
  108. data/lib/metanorma-standoc.rb +1 -1
  109. data/metanorma-standoc.gemspec +1 -1
  110. data/spec/{asciidoctor → metanorma}/base_spec.rb +27 -10
  111. data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
  112. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
  113. data/spec/{asciidoctor → metanorma}/cleanup_blocks_spec.rb +1 -1
  114. data/spec/{asciidoctor → metanorma}/cleanup_sections_spec.rb +1 -1
  115. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +5 -5
  116. data/spec/{asciidoctor → metanorma}/cleanup_terms_spec.rb +2 -2
  117. data/spec/{asciidoctor → metanorma}/datamodel/attributes_table_preprocessor_spec.rb +1 -1
  118. data/spec/{asciidoctor → metanorma}/datamodel/diagram_preprocessor_spec.rb +1 -1
  119. data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
  120. data/spec/{asciidoctor → metanorma}/isobib_cache_spec.rb +1 -1
  121. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  122. data/spec/{asciidoctor → metanorma}/macros_json2text_spec.rb +0 -0
  123. data/spec/{asciidoctor → metanorma}/macros_plantuml_spec.rb +3 -3
  124. data/spec/{asciidoctor → metanorma}/macros_spec.rb +6 -6
  125. data/spec/{asciidoctor → metanorma}/macros_yaml2text_spec.rb +0 -0
  126. data/spec/metanorma/refs_dl_spec.rb +863 -0
  127. data/spec/{asciidoctor → metanorma}/refs_spec.rb +399 -25
  128. data/spec/{asciidoctor → metanorma}/section_spec.rb +42 -17
  129. data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
  130. data/spec/{asciidoctor → metanorma}/validate_spec.rb +2 -2
  131. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +42 -42
  132. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +11 -11
  133. data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
  134. data/spec/vcr_cassettes/isobib_get_123_1.yml +21 -21
  135. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +81 -81
  136. data/spec/vcr_cassettes/isobib_get_123_2001.yml +10 -10
  137. data/spec/vcr_cassettes/isobib_get_124.yml +11 -11
  138. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +13 -13
  139. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
  140. metadata +82 -32
  141. 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 Asciidoctor::Standoc do
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(Asciidoctor::Standoc::Converter.new(nil, *OPTIONS)
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(Asciidoctor::Standoc::Converter.new(nil, *OPTIONS)
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>2021</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(::Asciidoctor::Standoc::Cleanup)
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 Asciidoctor::Standoc do
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>2021</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 Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
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 Asciidoctor::Standoc::Datamodel::DiagramPreprocessor do
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
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::Standoc do
3
+ RSpec.describe Metanorma::Standoc do
4
4
  it "handles spacing around markup" do
5
5
  input = <<~INPUT
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -266,7 +266,7 @@ ISO_123_DATED = <<~XML.freeze
266
266
  </bibdata>
267
267
  XML
268
268
 
269
- RSpec.describe Asciidoctor::Standoc do
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"),
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::Standoc do
3
+ RSpec.describe Metanorma::Standoc do
4
4
  it "processes simple lists" do
5
5
  output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::Standoc do
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(Asciidoctor::Standoc::PlantUMLBlockMacroBackend)
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(Asciidoctor::Standoc::Utils).to receive(:localdir) do
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 Asciidoctor::Standoc do
4
- it "processes the Asciidoctor::Standoc inline macros" do
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 Asciidoctor::Standoc index macros" do
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 Asciidoctor::Standoc variant macros" do
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 Asciidoctor::Standoc concept and related macros" do
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 Asciidoctor::Standoc concept macros for acronyms" do
335
+ it "processes the Metanorma::Standoc concept macros for acronyms" do
336
336
  input = <<~INPUT
337
337
  #{ASCIIDOC_BLANK_HDR}
338
338