metanorma-standoc 1.11.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -31
  3. data/.gitignore +23 -0
  4. data/Gemfile +2 -0
  5. data/lib/asciidoctor/standoc/base.rb +2 -241
  6. data/lib/asciidoctor/standoc/blocks.rb +2 -238
  7. data/lib/asciidoctor/standoc/blocks_notes.rb +2 -100
  8. data/lib/asciidoctor/standoc/cleanup.rb +2 -207
  9. data/lib/asciidoctor/standoc/cleanup_amend.rb +2 -53
  10. data/lib/asciidoctor/standoc/cleanup_block.rb +2 -173
  11. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -204
  12. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +2 -108
  13. data/lib/asciidoctor/standoc/cleanup_image.rb +2 -69
  14. data/lib/asciidoctor/standoc/cleanup_inline.rb +2 -179
  15. data/lib/asciidoctor/standoc/cleanup_maths.rb +2 -221
  16. data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -169
  17. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +2 -93
  18. data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -110
  19. data/lib/asciidoctor/standoc/cleanup_section.rb +2 -184
  20. data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -91
  21. data/lib/asciidoctor/standoc/cleanup_symbols.rb +2 -47
  22. data/lib/asciidoctor/standoc/cleanup_table.rb +2 -67
  23. data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -113
  24. data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +2 -161
  25. data/lib/asciidoctor/standoc/cleanup_text.rb +2 -95
  26. data/lib/asciidoctor/standoc/cleanup_toc.rb +3 -0
  27. data/lib/asciidoctor/standoc/cleanup_xref.rb +2 -106
  28. data/lib/asciidoctor/standoc/converter.rb +2 -123
  29. data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +2 -56
  30. data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +2 -102
  31. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +3 -404
  32. data/lib/asciidoctor/standoc/deprecated.rb +5 -0
  33. data/lib/asciidoctor/standoc/front.rb +2 -219
  34. data/lib/asciidoctor/standoc/front_contributor.rb +2 -191
  35. data/lib/asciidoctor/standoc/inline.rb +2 -229
  36. data/lib/asciidoctor/standoc/lists.rb +2 -119
  37. data/lib/asciidoctor/standoc/macros.rb +2 -203
  38. data/lib/asciidoctor/standoc/macros_form.rb +2 -62
  39. data/lib/asciidoctor/standoc/macros_note.rb +2 -44
  40. data/lib/asciidoctor/standoc/macros_plantuml.rb +2 -112
  41. data/lib/asciidoctor/standoc/macros_terms.rb +2 -180
  42. data/lib/asciidoctor/standoc/ref.rb +2 -225
  43. data/lib/asciidoctor/standoc/ref_sect.rb +2 -143
  44. data/lib/asciidoctor/standoc/ref_utility.rb +2 -0
  45. data/lib/asciidoctor/standoc/render.rb +3 -0
  46. data/lib/asciidoctor/standoc/reqt.rb +2 -89
  47. data/lib/asciidoctor/standoc/section.rb +2 -190
  48. data/lib/asciidoctor/standoc/table.rb +2 -84
  49. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +2 -178
  50. data/lib/asciidoctor/standoc/terms.rb +2 -153
  51. data/lib/asciidoctor/standoc/utils.rb +2 -116
  52. data/lib/asciidoctor/standoc/validate.rb +2 -157
  53. data/lib/asciidoctor/standoc/validate_section.rb +2 -54
  54. data/lib/isodoc/html/htmlstyle.css +20 -11
  55. data/lib/isodoc/html/htmlstyle.scss +11 -11
  56. data/lib/metanorma/standoc/base.rb +149 -0
  57. data/lib/{asciidoctor → metanorma}/standoc/basicdoc.rng +0 -0
  58. data/lib/{asciidoctor → metanorma}/standoc/biblio.rng +0 -0
  59. data/lib/metanorma/standoc/blocks.rb +239 -0
  60. data/lib/metanorma/standoc/blocks_notes.rb +101 -0
  61. data/lib/metanorma/standoc/cleanup.rb +146 -0
  62. data/lib/metanorma/standoc/cleanup_amend.rb +54 -0
  63. data/lib/metanorma/standoc/cleanup_block.rb +173 -0
  64. data/lib/metanorma/standoc/cleanup_boilerplate.rb +213 -0
  65. data/lib/metanorma/standoc/cleanup_footnotes.rb +109 -0
  66. data/lib/metanorma/standoc/cleanup_image.rb +70 -0
  67. data/lib/metanorma/standoc/cleanup_inline.rb +190 -0
  68. data/lib/metanorma/standoc/cleanup_maths.rb +222 -0
  69. data/lib/metanorma/standoc/cleanup_ref.rb +170 -0
  70. data/lib/metanorma/standoc/cleanup_ref_dl.rb +104 -0
  71. data/lib/metanorma/standoc/cleanup_reqt.rb +111 -0
  72. data/lib/metanorma/standoc/cleanup_section.rb +212 -0
  73. data/lib/metanorma/standoc/cleanup_section_names.rb +92 -0
  74. data/lib/metanorma/standoc/cleanup_symbols.rb +48 -0
  75. data/lib/metanorma/standoc/cleanup_table.rb +68 -0
  76. data/lib/metanorma/standoc/cleanup_terms.rb +140 -0
  77. data/lib/metanorma/standoc/cleanup_terms_designations.rb +199 -0
  78. data/lib/metanorma/standoc/cleanup_text.rb +96 -0
  79. data/lib/metanorma/standoc/cleanup_toc.rb +98 -0
  80. data/lib/metanorma/standoc/cleanup_xref.rb +107 -0
  81. data/lib/metanorma/standoc/converter.rb +124 -0
  82. data/lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb +57 -0
  83. data/lib/metanorma/standoc/datamodel/diagram_preprocessor.rb +103 -0
  84. data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +409 -0
  85. data/lib/metanorma/standoc/front.rb +224 -0
  86. data/lib/metanorma/standoc/front_contributor.rb +192 -0
  87. data/lib/metanorma/standoc/inline.rb +232 -0
  88. data/lib/{asciidoctor → metanorma}/standoc/isodoc.rng +90 -18
  89. data/lib/metanorma/standoc/lists.rb +120 -0
  90. data/lib/metanorma/standoc/macros.rb +204 -0
  91. data/lib/metanorma/standoc/macros_form.rb +63 -0
  92. data/lib/metanorma/standoc/macros_note.rb +45 -0
  93. data/lib/metanorma/standoc/macros_plantuml.rb +113 -0
  94. data/lib/metanorma/standoc/macros_terms.rb +181 -0
  95. data/lib/metanorma/standoc/ref.rb +243 -0
  96. data/lib/metanorma/standoc/ref_sect.rb +153 -0
  97. data/lib/metanorma/standoc/ref_utility.rb +129 -0
  98. data/lib/metanorma/standoc/render.rb +115 -0
  99. data/lib/metanorma/standoc/reqt.rb +90 -0
  100. data/lib/{asciidoctor → metanorma}/standoc/reqt.rng +0 -0
  101. data/lib/metanorma/standoc/section.rb +209 -0
  102. data/lib/metanorma/standoc/table.rb +85 -0
  103. data/lib/metanorma/standoc/term_lookup_cleanup.rb +179 -0
  104. data/lib/metanorma/standoc/terms.rb +160 -0
  105. data/lib/metanorma/standoc/utils.rb +101 -0
  106. data/lib/metanorma/standoc/validate.rb +158 -0
  107. data/lib/metanorma/standoc/validate_section.rb +55 -0
  108. data/lib/metanorma/standoc/version.rb +1 -1
  109. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/model_representation.adoc.erb +0 -0
  110. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/plantuml_representation.adoc.erb +0 -0
  111. data/lib/metanorma-standoc.rb +1 -1
  112. data/metanorma-standoc.gemspec +4 -4
  113. data/spec/{asciidoctor → metanorma}/base_spec.rb +73 -8
  114. data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
  115. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +49 -20
  116. data/spec/{asciidoctor → metanorma}/cleanup_blocks_spec.rb +25 -1
  117. data/spec/{asciidoctor → metanorma}/cleanup_sections_spec.rb +2 -2
  118. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +9 -9
  119. data/spec/{asciidoctor → metanorma}/cleanup_terms_spec.rb +528 -91
  120. data/spec/{asciidoctor → metanorma}/datamodel/attributes_table_preprocessor_spec.rb +22 -22
  121. data/spec/{asciidoctor → metanorma}/datamodel/diagram_preprocessor_spec.rb +17 -17
  122. data/spec/{asciidoctor → metanorma}/inline_spec.rb +175 -6
  123. data/spec/{asciidoctor → metanorma}/isobib_cache_spec.rb +5 -9
  124. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  125. data/spec/{asciidoctor → metanorma}/macros_json2text_spec.rb +0 -0
  126. data/spec/{asciidoctor → metanorma}/macros_plantuml_spec.rb +3 -3
  127. data/spec/{asciidoctor → metanorma}/macros_spec.rb +8 -8
  128. data/spec/{asciidoctor → metanorma}/macros_yaml2text_spec.rb +0 -0
  129. data/spec/metanorma/refs_dl_spec.rb +863 -0
  130. data/spec/{asciidoctor → metanorma}/refs_spec.rb +1277 -687
  131. data/spec/{asciidoctor → metanorma}/section_spec.rb +90 -3
  132. data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
  133. data/spec/{asciidoctor → metanorma}/validate_spec.rb +2 -2
  134. data/spec/spec_helper.rb +0 -1
  135. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +179 -179
  136. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
  137. data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
  138. data/spec/vcr_cassettes/isobib_get_123_1.yml +98 -98
  139. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +111 -111
  140. data/spec/vcr_cassettes/isobib_get_123_2001.yml +13 -13
  141. data/spec/vcr_cassettes/isobib_get_124.yml +14 -14
  142. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  143. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
  144. metadata +89 -38
  145. data/lib/asciidoctor/standoc/ref_date_id.rb +0 -62
  146. data/spec/asciidoctor/refs_dl_spec.rb +0 -864
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
28
28
 
29
29
  spec.add_dependency "asciidoctor", "~> 2.0.0"
30
- spec.add_dependency "iev", "~> 0.2.1"
31
- spec.add_dependency "isodoc", "~> 1.8.0"
30
+ spec.add_dependency "iev", "~> 0.3.0"
31
+ spec.add_dependency "isodoc", "~> 2.0.0"
32
32
  spec.add_dependency "metanorma-plugin-datastruct"
33
33
  spec.add_dependency "metanorma-plugin-lutaml"
34
34
  spec.add_dependency "ruby-jing"
@@ -37,12 +37,12 @@ Gem::Specification.new do |spec|
37
37
  spec.add_dependency "concurrent-ruby"
38
38
  spec.add_dependency "latexmath"
39
39
  spec.add_dependency "mathml2asciimath"
40
- spec.add_dependency "metanorma-utils", "~> 1.2.0"
40
+ spec.add_dependency "metanorma-utils", "~> 1.2.8"
41
41
  spec.add_dependency "relaton-cli", "~> 1.9.0"
42
42
  spec.add_dependency "relaton-iev", "~> 1.1.0"
43
43
  spec.add_dependency "unicode2latex", "~> 0.0.1"
44
44
 
45
- spec.add_development_dependency "byebug"
45
+ spec.add_development_dependency "debug"
46
46
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
47
47
  spec.add_development_dependency "guard", "~> 2.14"
48
48
  spec.add_development_dependency "guard-rspec", "~> 4.7"
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
- RSpec.describe Asciidoctor::Standoc do
4
+ RSpec.describe Metanorma::Standoc do
5
5
  it "has a version number" do
6
6
  expect(Metanorma::Standoc::VERSION).not_to be nil
7
7
  end
@@ -26,7 +26,7 @@ RSpec.describe Asciidoctor::Standoc do
26
26
  <stage>published</stage>
27
27
  </status>
28
28
  <copyright>
29
- <from>2021</from>
29
+ <from>#{Time.now.year}</from>
30
30
  </copyright>
31
31
  <ext>
32
32
  <doctype>article</doctype>
@@ -222,6 +222,9 @@ RSpec.describe Asciidoctor::Standoc do
222
222
  :isbn: ISBN-13
223
223
  :isbn10: ISBN-10
224
224
  :classification: a:b, c
225
+ :toclevels: 2
226
+ :doctoclevels: 3
227
+ :htmltoclevels: 4
225
228
  INPUT
226
229
  output = <<~OUTPUT
227
230
  <?xml version="1.0" encoding="UTF-8"?>
@@ -481,6 +484,20 @@ RSpec.describe Asciidoctor::Standoc do
481
484
  </ics>
482
485
  </ext>
483
486
  </bibdata>
487
+ <misc-container>
488
+ <presentation-metadata>
489
+ <name>TOC Heading Levels</name>
490
+ <value>2</value>
491
+ </presentation-metadata>
492
+ <presentation-metadata>
493
+ <name>TOC Heading Levels</name>
494
+ <value>2</value>
495
+ </presentation-metadata>
496
+ <presentation-metadata>
497
+ <name>TOC Heading Levels</name>
498
+ <value>2</value>
499
+ </presentation-metadata>
500
+ </misc-container>
484
501
  <sections/>
485
502
  </standard-document>
486
503
  OUTPUT
@@ -742,7 +759,7 @@ RSpec.describe Asciidoctor::Standoc do
742
759
  <stage>published</stage>
743
760
  </status>
744
761
  <copyright>
745
- <from>2021</from>
762
+ <from>#{Time.now.year}</from>
746
763
  </copyright>
747
764
  <ext>
748
765
  <doctype>article</doctype>
@@ -849,6 +866,47 @@ RSpec.describe Asciidoctor::Standoc do
849
866
  .to be_equivalent_to xmlpp(output)
850
867
  end
851
868
 
869
+ it "processes document relations by description" do
870
+ mock_relaton_relation_descriptions
871
+ input = <<~INPUT
872
+ = Document title
873
+ Author
874
+ :docfile: test.adoc
875
+ :nodoc:
876
+ :novalid:
877
+ :normatively-cited-in: ABC
878
+
879
+ INPUT
880
+ output = <<~OUTPUT
881
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
882
+ <bibdata type='standard'>
883
+ <title language='en' format='text/plain'>Document title</title>
884
+ <language>en</language>
885
+ <script>Latn</script>
886
+ <status>
887
+ <stage>published</stage>
888
+ </status>
889
+ <copyright>
890
+ <from>#{Time.now.year}</from>
891
+ </copyright>
892
+ <relation type='isCitedIn'>
893
+ <description>normatively cited in</description>
894
+ <bibitem>
895
+ <title>--</title>
896
+ <docidentifier>ABC</docidentifier>
897
+ </bibitem>
898
+ </relation>
899
+ <ext>
900
+ <doctype>article</doctype>
901
+ </ext>
902
+ </bibdata>
903
+ <sections> </sections>
904
+ </standard-document>
905
+ OUTPUT
906
+ expect(xmlpp(Asciidoctor.convert(input, *OPTIONS)))
907
+ .to be_equivalent_to xmlpp(output)
908
+ end
909
+
852
910
  it "reads scripts into blank HTML document" do
853
911
  FileUtils.rm_f "test.html"
854
912
  Asciidoctor.convert(<<~"INPUT", *OPTIONS)
@@ -959,21 +1017,21 @@ QU1FOiB0ZXN0Cgo=
959
1017
 
960
1018
  it "process mn2pdf attributes" do
961
1019
  node = Nokogiri::XML("<fake/>").at("fake")
962
- node[Asciidoctor::Standoc::Base::FONTS_MANIFEST] =
1020
+ node[Metanorma::Standoc::Base::FONTS_MANIFEST] =
963
1021
  "passed/as/font/manifest/to/mn2pdf.jar"
964
1022
 
965
- options = Asciidoctor::Standoc::Converter
1023
+ options = Metanorma::Standoc::Converter
966
1024
  .new(:standoc, header_footer: true)
967
1025
  .doc_extract_attributes(node)
968
1026
 
969
1027
  expect(options.dig(:mn2pdf, :font_manifest))
970
- .to eq(node[Asciidoctor::Standoc::Base::FONTS_MANIFEST])
1028
+ .to eq(node[Metanorma::Standoc::Base::FONTS_MANIFEST])
971
1029
  end
972
1030
 
973
1031
  private
974
1032
 
975
1033
  def mock_org_abbrevs
976
- allow_any_instance_of(::Asciidoctor::Standoc::Front)
1034
+ allow_any_instance_of(::Metanorma::Standoc::Front)
977
1035
  .to receive(:org_abbrev).and_return(
978
1036
  { "International Standards Organization" => "ISO",
979
1037
  "International Electrotechnical Commission" => "IEC" },
@@ -981,9 +1039,16 @@ QU1FOiB0ZXN0Cgo=
981
1039
  end
982
1040
 
983
1041
  def mock_default_publisher
984
- allow_any_instance_of(::Asciidoctor::Standoc::Front)
1042
+ allow_any_instance_of(::Metanorma::Standoc::Front)
985
1043
  .to receive(:default_publisher).and_return(
986
1044
  "International Standards Organization",
987
1045
  )
988
1046
  end
1047
+
1048
+ def mock_relaton_relation_descriptions
1049
+ allow_any_instance_of(::Metanorma::Standoc::Front)
1050
+ .to receive(:relaton_relation_descriptions).and_return(
1051
+ "normatively-cited-in" => "isCitedIn",
1052
+ )
1053
+ end
989
1054
  end
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
- RSpec.describe Asciidoctor::Standoc do
4
+ RSpec.describe Metanorma::Standoc do
5
5
  it "processes a blank document" do
6
6
  input = <<~INPUT
7
7
  #{ASCIIDOC_BLANK_HDR}
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require "open3"
3
3
 
4
- RSpec.describe Asciidoctor::Standoc do
4
+ RSpec.describe Metanorma::Standoc do
5
5
  it "processes format-specific pass blocks" do
6
6
  input = <<~INPUT
7
7
  #{ASCIIDOC_BLANK_HDR}
@@ -355,7 +355,7 @@ RSpec.describe Asciidoctor::Standoc do
355
355
  <term id='term-term1'>
356
356
  <preferred><expression><name>Term1</name></expression></preferred>
357
357
  <definition>
358
- <verbaldefinition>
358
+ <verbal-definition>
359
359
  <p id='_'>first definition</p>
360
360
  <termsource status='identical' type="authoritative">
361
361
  <origin bibitemid='ISO2191' type='inline' citeas=''>
@@ -366,10 +366,10 @@ RSpec.describe Asciidoctor::Standoc do
366
366
  </localityStack>
367
367
  </origin>
368
368
  </termsource>
369
- </verbaldefinition>
369
+ </verbal-definition>
370
370
  </definition>
371
371
  <definition>
372
- <verbaldefinition>
372
+ <verbal-definition>
373
373
  <p id='_'>second definition</p>
374
374
  <termsource status='identical' type="authoritative">
375
375
  <origin bibitemid='ISO2191' type='inline' citeas=''>
@@ -380,7 +380,7 @@ RSpec.describe Asciidoctor::Standoc do
380
380
  </localityStack>
381
381
  </origin>
382
382
  </termsource>
383
- </verbaldefinition>
383
+ </verbal-definition>
384
384
  </definition>
385
385
  <termnote id='_'>
386
386
  <p id='_'>This is a note</p>
@@ -550,9 +550,9 @@ RSpec.describe Asciidoctor::Standoc do
550
550
  </expression>
551
551
  </preferred>
552
552
  <definition>
553
- <verbaldefinition>
553
+ <verbal-definition>
554
554
  <p id='_'>definition2</p>
555
- </verbaldefinition>
555
+ </verbal-definition>
556
556
  </definition>
557
557
  <termnote id='_'>
558
558
  <p id='_'>Note 2</p>
@@ -1254,7 +1254,7 @@ RSpec.describe Asciidoctor::Standoc do
1254
1254
  the following terms and definitions apply.</p>
1255
1255
  <term id="term-term1">
1256
1256
  <preferred><expression><name>Term1</name></expression></preferred>
1257
- <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1257
+ <definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
1258
1258
  <termsource status="identical" type="authoritative">
1259
1259
  <origin bibitemid="ISO2191" type="inline" citeas="">
1260
1260
  <localityStack>
@@ -1273,9 +1273,9 @@ RSpec.describe Asciidoctor::Standoc do
1273
1273
  <term id='term-term2'>
1274
1274
  <preferred><expression><name>Term2</name></expression></preferred>
1275
1275
  <definition>
1276
- <verbaldefinition>
1276
+ <verbal-definition>
1277
1277
  <p id='_'>Definition</p>
1278
- </verbaldefinition>
1278
+ </verbal-definition>
1279
1279
  </definition>
1280
1280
  <termsource status='identical' type="authoritative">
1281
1281
  <origin citeas=''>
@@ -1329,7 +1329,7 @@ RSpec.describe Asciidoctor::Standoc do
1329
1329
  the following terms and definitions apply.</p>
1330
1330
  <term id="term-term1">
1331
1331
  <preferred><expression><name>Term1</name></expression></preferred>
1332
- <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1332
+ <definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
1333
1333
  <termsource status="modified" type="authoritative">
1334
1334
  <origin bibitemid="ISO2191" type="inline" citeas="">
1335
1335
  <localityStack>
@@ -1343,9 +1343,9 @@ RSpec.describe Asciidoctor::Standoc do
1343
1343
  </term>
1344
1344
  <term id='term-term2'>
1345
1345
  <preferred><expression><name>Term2</name></expression></preferred>
1346
- <definition><verbaldefinition>
1346
+ <definition><verbal-definition>
1347
1347
  <p id='_'>Definition</p>
1348
- </verbaldefinition></definition>
1348
+ </verbal-definition></definition>
1349
1349
  <termsource status='modified' type="authoritative">
1350
1350
  <origin citeas=''>
1351
1351
  <termref base='IEV' target='xyz'/>
@@ -1395,7 +1395,7 @@ RSpec.describe Asciidoctor::Standoc do
1395
1395
  <name>Term1</name>
1396
1396
  </expression>
1397
1397
  </preferred>
1398
- <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1398
+ <definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
1399
1399
  <termsource status='generalisation' type='authoritative'>
1400
1400
  <origin bibitemid='ISO2191' type='inline' citeas=''>
1401
1401
  <localityStack>
@@ -1415,9 +1415,9 @@ RSpec.describe Asciidoctor::Standoc do
1415
1415
  <name>Term2</name>
1416
1416
  </expression>
1417
1417
  </preferred>
1418
- <definition><verbaldefinition>
1418
+ <definition><verbal-definition>
1419
1419
  <p id='_'>Definition</p>
1420
- </verbaldefinition></definition>
1420
+ </verbal-definition></definition>
1421
1421
  <termsource status='modified' type='lineage'>
1422
1422
  <origin citeas=''>
1423
1423
  <termref base='IEV' target='xyz'/>
@@ -1444,7 +1444,7 @@ OUTPUT
1444
1444
  ====
1445
1445
  INPUT
1446
1446
  output = <<~"OUTPUT"
1447
- #{BLANK_HDR}
1447
+ #{BLANK_HDR}
1448
1448
  <sections>
1449
1449
  <recommendation id="_" unnumbered="true" type="verification" model="ogc" tag='X' multilingual-rendering='common'>
1450
1450
  <label>/ogc/recommendation/wfs/2</label>
@@ -1452,7 +1452,8 @@ OUTPUT
1452
1452
  <subject>developer, implementer</subject>
1453
1453
  <inherit>/ss/584/2015/level/1</inherit>
1454
1454
  <inherit>/ss/584/2015/level/2</inherit>
1455
- <description><p id="_">I recommend this</p></description>
1455
+ <description><p id="_">I recommend this</p>
1456
+ </description>
1456
1457
  </recommendation>
1457
1458
  </sections>
1458
1459
  </standard-document>
@@ -1470,6 +1471,9 @@ OUTPUT
1470
1471
  .Title
1471
1472
  ====
1472
1473
  I recommend this
1474
+
1475
+ . http://www.example.com[]
1476
+ . <<ABC>>
1473
1477
  ====
1474
1478
  INPUT
1475
1479
  output = <<~OUTPUT
@@ -1478,7 +1482,20 @@ OUTPUT
1478
1482
  <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1479
1483
  <title>Title</title>
1480
1484
  <inherit>/ss/584/2015/level/1 &amp; /ss/584/2015/level/2</inherit>
1481
- <description><p id="_">I recommend this</p></description>
1485
+ <description><p id="_">I recommend this</p>
1486
+ <ol id='_' type='arabic'>
1487
+ <li>
1488
+ <p id='_'>
1489
+ <link target='http://www.example.com'/>
1490
+ </p>
1491
+ </li>
1492
+ <li>
1493
+ <p id='_'>
1494
+ <xref target='ABC'/>
1495
+ </p>
1496
+ </li>
1497
+ </ol>
1498
+ </description>
1482
1499
  </requirement>
1483
1500
  </sections>
1484
1501
  </standard-document>
@@ -1526,6 +1543,9 @@ OUTPUT
1526
1543
  [.permission]
1527
1544
  =====
1528
1545
  I also permit this
1546
+
1547
+ . List
1548
+ . List
1529
1549
  =====
1530
1550
 
1531
1551
  [requirement,type="general",label="/req/core/quantities-uom"]
@@ -1541,7 +1561,16 @@ OUTPUT
1541
1561
  <p id="_">Example 2</p>
1542
1562
  </example></description>
1543
1563
  <permission id="_">
1544
- <description><p id="_">I also permit this</p></description>
1564
+ <description><p id="_">I also permit this</p>
1565
+ <ol id='_' type='arabic'>
1566
+ <li>
1567
+ <p id='_'>List</p>
1568
+ </li>
1569
+ <li>
1570
+ <p id='_'>List</p>
1571
+ </li>
1572
+ </ol>
1573
+ </description>
1545
1574
  </permission>
1546
1575
  <requirement id='_' type='general'>
1547
1576
  <label>/req/core/quantities-uom</label>
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
- RSpec.describe Asciidoctor::Standoc do
4
+ RSpec.describe Metanorma::Standoc do
5
5
  it "processes svgmap" do
6
6
  FileUtils.cp "spec/fixtures/action_schemaexpg1.svg",
7
7
  "action_schemaexpg1.svg"
@@ -1015,4 +1015,28 @@ RSpec.describe Asciidoctor::Standoc do
1015
1015
  expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1016
1016
  .to be_equivalent_to xmlpp(output)
1017
1017
  end
1018
+
1019
+ it "updates anchor reference along with anchor to match content" do
1020
+ input = <<~INPUT
1021
+ #{ASCIIDOC_BLANK_HDR}
1022
+
1023
+ [[samplecode]]
1024
+ .Sample Code
1025
+ ====
1026
+
1027
+ [source,ruby]
1028
+ --
1029
+ puts "Hello, world."
1030
+ %w{a b c}.each do |x| <1>
1031
+ puts x
1032
+ end
1033
+ --
1034
+ <1> This is an annotation
1035
+ ====
1036
+ INPUT
1037
+ output = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
1038
+ callout_id = output.at("//xmlns:callout/@target").text
1039
+ annotation_id = output.at("//xmlns:annotation/@id").text
1040
+ expect(callout_id).to eq(annotation_id)
1041
+ end
1018
1042
  end
@@ -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 "appends any initial user-supplied text to boilerplate in terms and definitions" do
7
7
  input = <<~INPUT
8
8
  #{ASCIIDOC_BLANK_HDR}
@@ -29,7 +29,7 @@ RSpec.describe Asciidoctor::Standoc do
29
29
  </ul>
30
30
  <term id="term-time">
31
31
  <preferred><expression><name>Time</name></expression></preferred>
32
- <definition><verbaldefinition><p id="_">This paragraph is extraneous</p></verbaldefinition></definition>
32
+ <definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
33
33
  </term></terms>
34
34
  </sections>
35
35
  </standard-document>
@@ -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}
@@ -426,7 +426,7 @@ RSpec.describe Asciidoctor::Standoc do
426
426
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
427
427
  <term id="term-term1">
428
428
  <preferred><expression><name>Term1</name></expression></preferred>
429
- <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
429
+ <definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
430
430
  <termsource status="identical" type="authoritative">
431
431
  <origin bibitemid="ISO2191" type="inline" citeas="">
432
432
  <localityStack>
@@ -545,7 +545,7 @@ RSpec.describe Asciidoctor::Standoc do
545
545
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
546
546
  <term id="term-automation1">
547
547
  <preferred><expression><name>Automation1</name></expression></preferred>
548
- <definition><verbaldefinition><p id='_'>Definition 1</p></verbaldefinition></definition>
548
+ <definition><verbal-definition><p id='_'>Definition 1</p></verbal-definition></definition>
549
549
  <termsource status="identical" type="authoritative">
550
550
  <origin bibitemid="IEC60050-103" type="inline" citeas="IEC 60050-103:2009">
551
551
  <localityStack>
@@ -556,7 +556,7 @@ RSpec.describe Asciidoctor::Standoc do
556
556
  </term>
557
557
  <term id="term-automation2">
558
558
  <preferred><expression><name>Automation2</name></expression></preferred>
559
- <definition><verbaldefinition><p id='_'>Definition 2</p></verbaldefinition></definition>
559
+ <definition><verbal-definition><p id='_'>Definition 2</p></verbal-definition></definition>
560
560
  <termsource status="identical" type="authoritative">
561
561
  <origin bibitemid="IEC60050-102" type="inline" citeas="IEC 60050-102:2007">
562
562
  <localityStack>
@@ -567,7 +567,7 @@ RSpec.describe Asciidoctor::Standoc do
567
567
  </term>
568
568
  <term id="term-automation3">
569
569
  <preferred><expression><name>Automation3</name></expression></preferred>
570
- <definition><verbaldefinition><p id='_'>Definition 3</p></verbaldefinition></definition>
570
+ <definition><verbal-definition><p id='_'>Definition 3</p></verbal-definition></definition>
571
571
  <termsource status="identical" type="authoritative">
572
572
  <origin bibitemid="IEC60050-103" type="inline" citeas="IEC 60050-103:2009">
573
573
  <localityStack>
@@ -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