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.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/html/htmlstyle.css +1 -1
  3. data/lib/metanorma/standoc/base.rb +4 -5
  4. data/lib/metanorma/standoc/basicdoc.rng +0 -27
  5. data/lib/metanorma/standoc/biblio-standoc.rng +164 -0
  6. data/lib/metanorma/standoc/biblio.rng +50 -18
  7. data/lib/metanorma/standoc/cleanup.rb +18 -17
  8. data/lib/metanorma/standoc/cleanup_amend.rb +2 -2
  9. data/lib/metanorma/standoc/cleanup_asciibib.rb +110 -0
  10. data/lib/metanorma/standoc/cleanup_biblio.rb +7 -112
  11. data/lib/metanorma/standoc/cleanup_block.rb +7 -6
  12. data/lib/metanorma/standoc/cleanup_boilerplate.rb +6 -6
  13. data/lib/metanorma/standoc/cleanup_inline.rb +2 -2
  14. data/lib/metanorma/standoc/cleanup_maths.rb +12 -4
  15. data/lib/metanorma/standoc/cleanup_section.rb +19 -9
  16. data/lib/metanorma/standoc/cleanup_symbols.rb +14 -7
  17. data/lib/metanorma/standoc/cleanup_text.rb +19 -6
  18. data/lib/metanorma/standoc/cleanup_toc.rb +1 -2
  19. data/lib/metanorma/standoc/cleanup_xref.rb +55 -14
  20. data/lib/metanorma/standoc/inline.rb +29 -12
  21. data/lib/metanorma/standoc/isodoc-compile.rng +7 -0
  22. data/lib/metanorma/standoc/isodoc.rng +69 -207
  23. data/lib/metanorma/standoc/ref_utility.rb +1 -0
  24. data/lib/metanorma/standoc/render.rb +10 -1
  25. data/lib/metanorma/standoc/section.rb +10 -3
  26. data/lib/metanorma/standoc/utils.rb +6 -1
  27. data/lib/metanorma/standoc/validate.rb +9 -9
  28. data/lib/metanorma/standoc/version.rb +1 -1
  29. data/metanorma-standoc.gemspec +5 -3
  30. metadata +7 -141
  31. data/.github/workflows/rake.yml +0 -15
  32. data/.github/workflows/release.yml +0 -24
  33. data/Rakefile +0 -8
  34. data/bin/rspec +0 -18
  35. data/spec/assets/a1.adoc +0 -8
  36. data/spec/assets/a2.adoc +0 -10
  37. data/spec/assets/a3.adoc +0 -9
  38. data/spec/assets/a3a.adoc +0 -7
  39. data/spec/assets/a4.adoc +0 -4
  40. data/spec/assets/boilerplate.xml +0 -4
  41. data/spec/assets/codes.yml +0 -695
  42. data/spec/assets/correct.png +0 -0
  43. data/spec/assets/corrupt.png +0 -0
  44. data/spec/assets/header.html +0 -7
  45. data/spec/assets/html-override.css +0 -1
  46. data/spec/assets/html.scss +0 -13
  47. data/spec/assets/htmlcover.html +0 -4
  48. data/spec/assets/htmlintro.html +0 -5
  49. data/spec/assets/i18n.yaml +0 -17
  50. data/spec/assets/iso.adoc +0 -10
  51. data/spec/assets/iso.headless.html +0 -33
  52. data/spec/assets/iso.xml +0 -8
  53. data/spec/assets/iso123.rxl +0 -107
  54. data/spec/assets/rice_image1.png +0 -0
  55. data/spec/assets/scripts.html +0 -3
  56. data/spec/assets/std.css +0 -2
  57. data/spec/assets/word-override.css +0 -1
  58. data/spec/assets/word.scss +0 -13
  59. data/spec/assets/wordcover.html +0 -3
  60. data/spec/assets/wordintro.html +0 -4
  61. data/spec/assets/xref_error.adoc +0 -8
  62. data/spec/examples/103_01_02.html +0 -247
  63. data/spec/examples/codes_table.html +0 -3174
  64. data/spec/examples/datamodel/address_class_profile.adoc +0 -5
  65. data/spec/examples/datamodel/address_class_profile.presentation.xml +0 -14
  66. data/spec/examples/datamodel/address_component_profile.adoc +0 -5
  67. data/spec/examples/datamodel/blank_definition_profile.adoc +0 -5
  68. data/spec/examples/datamodel/common_models_diagram.adoc +0 -5
  69. data/spec/examples/datamodel/models/models/AddressClassProfile.yml +0 -90
  70. data/spec/examples/datamodel/models/models/AddressComponentProfile.yml +0 -63
  71. data/spec/examples/datamodel/models/models/AddressComponentSpecification.yml +0 -15
  72. data/spec/examples/datamodel/models/models/AddressProfile.yml +0 -36
  73. data/spec/examples/datamodel/models/models/AttributeProfile.yml +0 -32
  74. data/spec/examples/datamodel/models/models/InterchangeAddressClassProfile.yml +0 -79
  75. data/spec/examples/datamodel/models/models/Localization copy.yml +0 -23
  76. data/spec/examples/datamodel/models/models/Localization.yml +0 -23
  77. data/spec/examples/datamodel/models/models/ProfileCompliantAddress.yml +0 -36
  78. data/spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml +0 -15
  79. data/spec/examples/datamodel/models/models/Signature.yml +0 -20
  80. data/spec/examples/datamodel/models/models/SignatureBlankDefinition.yml +0 -20
  81. data/spec/examples/datamodel/models/models/TextDirectionCode copy.yml +0 -16
  82. data/spec/examples/datamodel/models/models/TextDirectionCode.yml +0 -16
  83. data/spec/examples/datamodel/models/models/Validity.yml +0 -14
  84. data/spec/examples/datamodel/models/models/iso19160-1/Address.yml +0 -22
  85. data/spec/examples/datamodel/models/models/iso19160-1/AddressComponent.yml +0 -2
  86. data/spec/examples/datamodel/models/style.uml.inc +0 -37
  87. data/spec/examples/datamodel/models/views/CommonModels.yml +0 -9
  88. data/spec/examples/datamodel/models/views/TopDown.yml +0 -62
  89. data/spec/examples/datamodel/top_down_diagram.adoc +0 -5
  90. data/spec/examples/english.yaml +0 -69
  91. data/spec/examples/iso_123_.xml +0 -46
  92. data/spec/examples/iso_123_all_parts.xml +0 -46
  93. data/spec/examples/iso_123_no_year_note.xml +0 -47
  94. data/spec/examples/iso_124_.xml +0 -42
  95. data/spec/examples/iso_216_.xml +0 -48
  96. data/spec/examples/iso_iec_12382_.xml +0 -49
  97. data/spec/examples/rice.adoc +0 -715
  98. data/spec/examples/rice.preview.html +0 -1877
  99. data/spec/examples/rice.sh +0 -4
  100. data/spec/examples/rice_images/rice_image1.png +0 -0
  101. data/spec/examples/rice_images/rice_image2.png +0 -0
  102. data/spec/examples/rice_images/rice_image3_1.png +0 -0
  103. data/spec/examples/rice_images/rice_image3_2.png +0 -0
  104. data/spec/examples/rice_images/rice_image3_3.png +0 -0
  105. data/spec/fixtures/action_schemaexpg1.svg +0 -122
  106. data/spec/fixtures/datamodel_description_sections_tree.xml +0 -327
  107. data/spec/fixtures/diagram_definitions.lutaml +0 -22
  108. data/spec/fixtures/macros_datamodel/address_class_profile.xml +0 -149
  109. data/spec/fixtures/macros_datamodel/address_component_profile.xml +0 -71
  110. data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +0 -51
  111. data/spec/fixtures/macros_datamodel/common_models_diagram.xml +0 -7
  112. data/spec/fixtures/macros_datamodel/top_down_diagram.xml +0 -7
  113. data/spec/fixtures/test.exp +0 -121
  114. data/spec/fixtures/test.xmi +0 -9250
  115. data/spec/metanorma/base_spec.rb +0 -1125
  116. data/spec/metanorma/biblio_spec.rb +0 -1004
  117. data/spec/metanorma/blank_spec.rb +0 -37
  118. data/spec/metanorma/blocks_spec.rb +0 -1784
  119. data/spec/metanorma/cleanup_blocks_spec.rb +0 -1099
  120. data/spec/metanorma/cleanup_sections_spec.rb +0 -1850
  121. data/spec/metanorma/cleanup_spec.rb +0 -1920
  122. data/spec/metanorma/cleanup_terms_spec.rb +0 -1543
  123. data/spec/metanorma/datamodel/attributes_table_preprocessor_spec.rb +0 -111
  124. data/spec/metanorma/datamodel/diagram_preprocessor_spec.rb +0 -72
  125. data/spec/metanorma/inline_spec.rb +0 -724
  126. data/spec/metanorma/isobib_cache_spec.rb +0 -742
  127. data/spec/metanorma/lists_spec.rb +0 -232
  128. data/spec/metanorma/macros_concept_spec.rb +0 -1052
  129. data/spec/metanorma/macros_json2text_spec.rb +0 -10
  130. data/spec/metanorma/macros_plantuml_spec.rb +0 -402
  131. data/spec/metanorma/macros_spec.rb +0 -1183
  132. data/spec/metanorma/macros_yaml2text_spec.rb +0 -10
  133. data/spec/metanorma/processor_spec.rb +0 -96
  134. data/spec/metanorma/refs_spec.rb +0 -2807
  135. data/spec/metanorma/reqt_spec.rb +0 -130
  136. data/spec/metanorma/section_spec.rb +0 -1325
  137. data/spec/metanorma/table_spec.rb +0 -474
  138. data/spec/metanorma/validate_spec.rb +0 -886
  139. data/spec/spec_helper.rb +0 -290
  140. data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +0 -781
  141. data/spec/vcr_cassettes/bsi16341.yml +0 -488
  142. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +0 -611
  143. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +0 -149
  144. data/spec/vcr_cassettes/hide_refs.yml +0 -587
  145. data/spec/vcr_cassettes/isobib_get_123.yml +0 -149
  146. data/spec/vcr_cassettes/isobib_get_123_1.yml +0 -295
  147. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +0 -385
  148. data/spec/vcr_cassettes/isobib_get_123_2.yml +0 -295
  149. data/spec/vcr_cassettes/isobib_get_123_2001.yml +0 -149
  150. data/spec/vcr_cassettes/isobib_get_124.yml +0 -149
  151. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +0 -351
  152. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +0 -560
  153. data/spec/vcr_cassettes/std-link.yml +0 -149
@@ -17,21 +17,9 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <grammar ns="https://www.metanorma.org/ns/standoc" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
20
+ <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
21
  <include href="reqt.rng"/>
22
- <!-- include "biblio.rnc" { } -->
23
22
  <include href="basicdoc.rng">
24
- <start>
25
- <ref name="standard-document"/>
26
- </start>
27
- <define name="doctype">
28
- <element name="doctype">
29
- <optional>
30
- <attribute name="abbreviation"/>
31
- </optional>
32
- <ref name="DocumentType"/>
33
- </element>
34
- </define>
35
23
  <define name="admonition">
36
24
  <element name="admonition">
37
25
  <attribute name="type">
@@ -117,24 +105,6 @@
117
105
  </optional>
118
106
  </element>
119
107
  </define>
120
- <define name="bibitem">
121
- <element name="bibitem">
122
- <attribute name="id">
123
- <data type="ID"/>
124
- </attribute>
125
- <optional>
126
- <attribute name="hidden">
127
- <data type="boolean"/>
128
- </attribute>
129
- </optional>
130
- <optional>
131
- <attribute name="suppress_identifier">
132
- <data type="boolean"/>
133
- </attribute>
134
- </optional>
135
- <ref name="BibliographicItem"/>
136
- </element>
137
- </define>
138
108
  <define name="section-title">
139
109
  <element name="title">
140
110
  <zeroOrMore>
@@ -207,11 +177,7 @@
207
177
  </optional>
208
178
  <optional>
209
179
  <attribute name="style">
210
- <choice>
211
- <value>basic</value>
212
- <value>full</value>
213
- <value>short</value>
214
- </choice>
180
+ <ref name="XrefStyleType"/>
215
181
  </attribute>
216
182
  </optional>
217
183
  <ref name="XrefBody"/>
@@ -248,42 +214,6 @@
248
214
  <ref name="PureTextElement"/>
249
215
  </oneOrMore>
250
216
  </define>
251
- <define name="localityStack">
252
- <element name="localityStack">
253
- <optional>
254
- <attribute name="connective">
255
- <choice>
256
- <value>and</value>
257
- <value>or</value>
258
- <value>from</value>
259
- <value>to</value>
260
- <value/>
261
- </choice>
262
- </attribute>
263
- </optional>
264
- <zeroOrMore>
265
- <ref name="locality"/>
266
- </zeroOrMore>
267
- </element>
268
- </define>
269
- <define name="sourceLocalityStack">
270
- <element name="sourceLocalityStack">
271
- <optional>
272
- <attribute name="connective">
273
- <choice>
274
- <value>and</value>
275
- <value>or</value>
276
- <value>from</value>
277
- <value>to</value>
278
- <value/>
279
- </choice>
280
- </attribute>
281
- </optional>
282
- <zeroOrMore>
283
- <ref name="sourceLocality"/>
284
- </zeroOrMore>
285
- </element>
286
- </define>
287
217
  <define name="ul">
288
218
  <element name="ul">
289
219
  <attribute name="id">
@@ -827,21 +757,6 @@
827
757
  </zeroOrMore>
828
758
  </element>
829
759
  </define>
830
- <define name="BibDataExtensionType">
831
- <ref name="doctype"/>
832
- <optional>
833
- <ref name="docsubtype"/>
834
- </optional>
835
- <optional>
836
- <ref name="editorialgroup"/>
837
- </optional>
838
- <zeroOrMore>
839
- <ref name="ics"/>
840
- </zeroOrMore>
841
- <zeroOrMore>
842
- <ref name="structuredidentifier"/>
843
- </zeroOrMore>
844
- </define>
845
760
  <!-- TitleType = text -->
846
761
  <define name="sections">
847
762
  <element name="sections">
@@ -881,7 +796,7 @@
881
796
  <ref name="BasicBlock"/>
882
797
  </zeroOrMore>
883
798
  <zeroOrMore>
884
- <ref name="bibitem"/>
799
+ <ref name="doc_bibitem"/>
885
800
  <zeroOrMore>
886
801
  <ref name="note"/>
887
802
  </zeroOrMore>
@@ -1112,6 +1027,7 @@
1112
1027
  <ref name="stem"/>
1113
1028
  <ref name="index"/>
1114
1029
  <ref name="eref"/>
1030
+ <ref name="erefstack"/>
1115
1031
  <ref name="xref"/>
1116
1032
  <ref name="hyperlink"/>
1117
1033
  </choice>
@@ -1126,6 +1042,7 @@
1126
1042
  <ref name="stem"/>
1127
1043
  <ref name="index"/>
1128
1044
  <ref name="eref"/>
1045
+ <ref name="erefstack"/>
1129
1046
  <ref name="xref"/>
1130
1047
  <ref name="hyperlink"/>
1131
1048
  </choice>
@@ -1139,6 +1056,7 @@
1139
1056
  <ref name="PureTextElement"/>
1140
1057
  <ref name="index"/>
1141
1058
  <ref name="eref"/>
1059
+ <ref name="erefstack"/>
1142
1060
  <ref name="xref"/>
1143
1061
  <ref name="hyperlink"/>
1144
1062
  </choice>
@@ -1219,6 +1137,24 @@
1219
1137
  </define>
1220
1138
  </include>
1221
1139
  <!-- end overrides -->
1140
+ <define name="doc_bibitem">
1141
+ <element name="bibitem">
1142
+ <attribute name="id">
1143
+ <data type="ID"/>
1144
+ </attribute>
1145
+ <optional>
1146
+ <attribute name="hidden">
1147
+ <data type="boolean"/>
1148
+ </attribute>
1149
+ </optional>
1150
+ <optional>
1151
+ <attribute name="suppress_identifier">
1152
+ <data type="boolean"/>
1153
+ </attribute>
1154
+ </optional>
1155
+ <ref name="BibliographicItem"/>
1156
+ </element>
1157
+ </define>
1222
1158
  <define name="image" combine="choice">
1223
1159
  <element name="svg">
1224
1160
  <oneOrMore>
@@ -1237,14 +1173,6 @@
1237
1173
  <value>tag</value>
1238
1174
  </choice>
1239
1175
  </define>
1240
- <define name="docsubtype">
1241
- <element name="subdoctype">
1242
- <ref name="DocumentSubtype"/>
1243
- </element>
1244
- </define>
1245
- <define name="DocumentSubtype">
1246
- <text/>
1247
- </define>
1248
1176
  <define name="colgroup">
1249
1177
  <element name="colgroup">
1250
1178
  <oneOrMore>
@@ -1266,6 +1194,7 @@
1266
1194
  <ref name="add"/>
1267
1195
  <ref name="del"/>
1268
1196
  <ref name="span"/>
1197
+ <ref name="erefstack"/>
1269
1198
  </choice>
1270
1199
  </define>
1271
1200
  <define name="add">
@@ -1273,6 +1202,7 @@
1273
1202
  <choice>
1274
1203
  <ref name="PureTextElement"/>
1275
1204
  <ref name="eref"/>
1205
+ <ref name="erefstack"/>
1276
1206
  <ref name="stem"/>
1277
1207
  <ref name="keyword"/>
1278
1208
  <ref name="xref"/>
@@ -1285,6 +1215,7 @@
1285
1215
  <choice>
1286
1216
  <ref name="PureTextElement"/>
1287
1217
  <ref name="eref"/>
1218
+ <ref name="erefstack"/>
1288
1219
  <ref name="stem"/>
1289
1220
  <ref name="keyword"/>
1290
1221
  <ref name="xref"/>
@@ -1349,6 +1280,7 @@
1349
1280
  </optional>
1350
1281
  <choice>
1351
1282
  <ref name="eref"/>
1283
+ <ref name="erefstack"/>
1352
1284
  <ref name="xref"/>
1353
1285
  <ref name="termref"/>
1354
1286
  </choice>
@@ -1606,45 +1538,6 @@
1606
1538
  </choice>
1607
1539
  </element>
1608
1540
  </define>
1609
- <define name="editorialgroup">
1610
- <element name="editorialgroup">
1611
- <oneOrMore>
1612
- <ref name="technical-committee"/>
1613
- </oneOrMore>
1614
- </element>
1615
- </define>
1616
- <define name="technical-committee">
1617
- <element name="technical-committee">
1618
- <ref name="IsoWorkgroup"/>
1619
- </element>
1620
- </define>
1621
- <define name="IsoWorkgroup">
1622
- <optional>
1623
- <attribute name="number"/>
1624
- </optional>
1625
- <optional>
1626
- <attribute name="type"/>
1627
- </optional>
1628
- <optional>
1629
- <attribute name="identifier"/>
1630
- </optional>
1631
- <optional>
1632
- <attribute name="prefix"/>
1633
- </optional>
1634
- <text/>
1635
- </define>
1636
- <define name="ics">
1637
- <element name="ics">
1638
- <element name="code">
1639
- <text/>
1640
- </element>
1641
- <optional>
1642
- <element name="text">
1643
- <text/>
1644
- </element>
1645
- </optional>
1646
- </element>
1647
- </define>
1648
1541
  <define name="standard-document">
1649
1542
  <element name="standard-document">
1650
1543
  <attribute name="version"/>
@@ -2080,6 +1973,7 @@
2080
1973
  </element>
2081
1974
  <choice>
2082
1975
  <ref name="eref"/>
1976
+ <ref name="erefstack"/>
2083
1977
  <ref name="xref"/>
2084
1978
  <ref name="termref"/>
2085
1979
  </choice>
@@ -2475,71 +2369,6 @@
2475
2369
  </optional>
2476
2370
  </element>
2477
2371
  </define>
2478
- <define name="structuredidentifier">
2479
- <element name="structuredidentifier">
2480
- <optional>
2481
- <attribute name="type"/>
2482
- </optional>
2483
- <oneOrMore>
2484
- <element name="agency">
2485
- <text/>
2486
- </element>
2487
- </oneOrMore>
2488
- <optional>
2489
- <element name="class">
2490
- <text/>
2491
- </element>
2492
- </optional>
2493
- <element name="docnumber">
2494
- <text/>
2495
- </element>
2496
- <optional>
2497
- <element name="partnumber">
2498
- <text/>
2499
- </element>
2500
- </optional>
2501
- <optional>
2502
- <element name="edition">
2503
- <text/>
2504
- </element>
2505
- </optional>
2506
- <optional>
2507
- <element name="version">
2508
- <text/>
2509
- </element>
2510
- </optional>
2511
- <optional>
2512
- <element name="supplementtype">
2513
- <text/>
2514
- </element>
2515
- </optional>
2516
- <optional>
2517
- <element name="supplementnumber">
2518
- <text/>
2519
- </element>
2520
- </optional>
2521
- <optional>
2522
- <element name="amendment">
2523
- <text/>
2524
- </element>
2525
- </optional>
2526
- <optional>
2527
- <element name="corrigendum">
2528
- <text/>
2529
- </element>
2530
- </optional>
2531
- <optional>
2532
- <element name="language">
2533
- <text/>
2534
- </element>
2535
- </optional>
2536
- <optional>
2537
- <element name="year">
2538
- <text/>
2539
- </element>
2540
- </optional>
2541
- </element>
2542
- </define>
2543
2372
  <define name="term-clause">
2544
2373
  <element name="clause">
2545
2374
  <optional>
@@ -2700,6 +2529,7 @@
2700
2529
  <ref name="xref"/>
2701
2530
  <ref name="hyperlink"/>
2702
2531
  <ref name="eref"/>
2532
+ <ref name="erefstack"/>
2703
2533
  </choice>
2704
2534
  <oneOrMore>
2705
2535
  <element name="coords">
@@ -2747,6 +2577,7 @@
2747
2577
  <ref name="xref"/>
2748
2578
  <ref name="hyperlink"/>
2749
2579
  <ref name="eref"/>
2580
+ <ref name="erefstack"/>
2750
2581
  </choice>
2751
2582
  </element>
2752
2583
  </zeroOrMore>
@@ -2795,6 +2626,15 @@
2795
2626
  <ref name="PureTextElement"/>
2796
2627
  </oneOrMore>
2797
2628
  </define>
2629
+ <define name="XrefConnectiveType">
2630
+ <choice>
2631
+ <value>and</value>
2632
+ <value>or</value>
2633
+ <value>from</value>
2634
+ <value>to</value>
2635
+ <value/>
2636
+ </choice>
2637
+ </define>
2798
2638
  <define name="XrefTarget">
2799
2639
  <element name="location">
2800
2640
  <attribute name="target">
@@ -2803,14 +2643,36 @@
2803
2643
  </data>
2804
2644
  </attribute>
2805
2645
  <attribute name="connective">
2806
- <choice>
2807
- <value>and</value>
2808
- <value>or</value>
2809
- <value>from</value>
2810
- <value>to</value>
2811
- <value/>
2812
- </choice>
2646
+ <ref name="XrefConnectiveType"/>
2813
2647
  </attribute>
2814
2648
  </element>
2815
2649
  </define>
2650
+ <define name="XrefStyleType">
2651
+ <choice>
2652
+ <value>basic</value>
2653
+ <value>full</value>
2654
+ <value>short</value>
2655
+ <value>id</value>
2656
+ </choice>
2657
+ </define>
2658
+ <define name="erefTypeWithConnective">
2659
+ <optional>
2660
+ <attribute name="connective">
2661
+ <ref name="XrefConnectiveType"/>
2662
+ </attribute>
2663
+ </optional>
2664
+ <ref name="erefType"/>
2665
+ </define>
2666
+ <define name="erefstack">
2667
+ <element name="erefstack">
2668
+ <oneOrMore>
2669
+ <element name="eref">
2670
+ <ref name="erefTypeWithConnective"/>
2671
+ </element>
2672
+ </oneOrMore>
2673
+ </element>
2674
+ </define>
2675
+ <start>
2676
+ <ref name="standard-document"/>
2677
+ </start>
2816
2678
  </grammar>
@@ -139,6 +139,7 @@ module Metanorma
139
139
 
140
140
  def ref_normalise_no_format(ref)
141
141
  ref.gsub(/&amp;amp;/, "&amp;")
142
+ .gsub(/>\n/, "> \n")
142
143
  end
143
144
  end
144
145
  end
@@ -31,6 +31,7 @@ module Metanorma
31
31
  fonts: node.attr("fonts"),
32
32
  fontlicenseagreement: node.attr("font-license-agreement"),
33
33
  localizenumber: node.attr("localize-number"),
34
+ modspecidentifierbase: node.attr("modspec-identifier-base"),
34
35
  }
35
36
  end
36
37
 
@@ -82,7 +83,7 @@ module Metanorma
82
83
  end
83
84
 
84
85
  def pdf_extract_attributes(node)
85
- %w(pdf-encrypt pdf-encryption-length pdf-user-password
86
+ pdf_options = %w(pdf-encrypt pdf-encryption-length pdf-user-password
86
87
  pdf-owner-password pdf-allow-copy-content pdf-allow-edit-content
87
88
  pdf-allow-assemble-document pdf-allow-edit-annotations
88
89
  pdf-allow-print pdf-allow-print-hq pdf-allow-fill-in-forms
@@ -91,6 +92,8 @@ module Metanorma
91
92
  .each_with_object({}) do |x, m|
92
93
  m[x.gsub(/-/, "").to_i] = node.attr(x)
93
94
  end
95
+
96
+ pdf_options.merge(fonts_manifest_option(node) || {})
94
97
  end
95
98
 
96
99
  def doc_converter(node)
@@ -120,6 +123,12 @@ module Metanorma
120
123
  pdf_converter(node)&.convert("#{@filename}.presentation.xml",
121
124
  nil, false, "#{@filename}.pdf")
122
125
  end
126
+
127
+ def fonts_manifest_option(node)
128
+ if node.attr(FONTS_MANIFEST)
129
+ { mn2pdf: { font_manifest: node.attr(FONTS_MANIFEST) } }
130
+ end
131
+ end
123
132
  end
124
133
  end
125
134
  end
@@ -52,8 +52,8 @@ module Metanorma
52
52
  end
53
53
  end
54
54
 
55
- PREFACE_CLAUSE_NAMES = %w(abstract foreword introduction
56
- acknowledgements).freeze
55
+ PREFACE_CLAUSE_NAMES =
56
+ %w(abstract foreword introduction misc-container acknowledgements).freeze
57
57
 
58
58
  MAIN_CLAUSE_NAMES =
59
59
  ["normative references", "terms and definitions", "scope",
@@ -62,7 +62,7 @@ module Metanorma
62
62
  def start_main_section(ret, node)
63
63
  @preface = false if self.class::MAIN_CLAUSE_NAMES.include?(ret) &&
64
64
  node.role != "preface" && node.attr("style") != "preface"
65
- @preface = false if (self.class::PREFACE_CLAUSE_NAMES)
65
+ @preface = false if self.class::PREFACE_CLAUSE_NAMES
66
66
  .intersection(@seen_headers_canonical + [ret]).empty?
67
67
  end
68
68
 
@@ -106,6 +106,7 @@ module Metanorma
106
106
  a = section_attributes(node)
107
107
  noko do |xml|
108
108
  case sectiontype(node)
109
+ when "misc-container" then misccontainer_parse(a, xml, node)
109
110
  when "introduction" then introduction_parse(a, xml, node)
110
111
  when "foreword" then foreword_parse(a, xml, node)
111
112
  when "scope" then scope_parse(a, xml, node)
@@ -164,6 +165,12 @@ module Metanorma
164
165
  end.join("\n")
165
166
  end
166
167
 
168
+ def misccontainer_parse(_attrs, xml, node)
169
+ xml.send :"misc-container-clause" do |xml_section|
170
+ xml_section << node.content
171
+ end
172
+ end
173
+
167
174
  def indexsect_parse(attrs, xml, node)
168
175
  xml.indexsect **attr_code(attrs) do |xml_section|
169
176
  xml_section.title { |name| name << node.title }
@@ -33,7 +33,12 @@ module Metanorma
33
33
  Metanorma::Utils::wrap_in_para(node, out)
34
34
  end
35
35
 
36
- SUBCLAUSE_XPATH = "//clause[not(parent::sections)]"\
36
+ def to_xml(node)
37
+ node.to_xml(encoding: "UTF-8", indent: 2,
38
+ save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
39
+ end
40
+
41
+ SUBCLAUSE_XPATH = "//clause[not(parent::sections)]" \
37
42
  "[not(ancestor::boilerplate)]".freeze
38
43
 
39
44
  def isodoc(lang, script, locale, i18nyaml = nil)
@@ -9,7 +9,7 @@ require "pngcheck"
9
9
  module Metanorma
10
10
  module Standoc
11
11
  module Validate
12
- SOURCELOCALITY = "./origin//locality[@type = 'clause']/"\
12
+ SOURCELOCALITY = "./origin//locality[@type = 'clause']/" \
13
13
  "referenceFrom".freeze
14
14
 
15
15
  def init_iev
@@ -24,7 +24,7 @@ module Metanorma
24
24
  @iev = init_iev or return
25
25
  xmldoc.xpath("//term").each do |t|
26
26
  t.xpath(".//termsource").each do |src|
27
- (/^IEC 60050-/.match(src&.at("./origin/@citeas")&.text) &&
27
+ (/^IEC 60050-/.match(src.at("./origin/@citeas")&.text) &&
28
28
  loc = src.xpath(SOURCELOCALITY)&.text) or next
29
29
  iev_validate1(t, loc, xmldoc)
30
30
  end
@@ -33,9 +33,9 @@ module Metanorma
33
33
 
34
34
  def iev_validate1(term, loc, xmldoc)
35
35
  iev = @iev.fetch(loc,
36
- xmldoc&.at("//language")&.text || "en") or return
36
+ xmldoc.at("//language")&.text || "en") or return
37
37
  pref = term.xpath("./preferred//name").inject([]) do |m, x|
38
- m << x&.text&.downcase
38
+ m << x.text&.downcase
39
39
  end
40
40
  pref.include?(iev.downcase) or
41
41
  @log.add("Bibliography", term, %(Term "#{pref[0]}" does not match ) +
@@ -97,7 +97,7 @@ module Metanorma
97
97
 
98
98
  def repeat_id_validate1(ids, elem)
99
99
  if ids[elem["id"]]
100
- @log.add("Anchors", elem, "Anchor #{elem['id']} has already been "\
100
+ @log.add("Anchors", elem, "Anchor #{elem['id']} has already been " \
101
101
  "used at line #{ids[elem['id']]}")
102
102
  @fatalerror << "Multiple instances of same ID: #{elem['id']}"
103
103
  else
@@ -124,7 +124,7 @@ module Metanorma
124
124
  end
125
125
 
126
126
  def schema_validate1(file, doc, schema)
127
- file.write(doc.to_xml)
127
+ file.write(to_xml(doc))
128
128
  file.close
129
129
  errors = Jing.new(schema, encoding: "UTF-8").validate(file.path)
130
130
  warn "Syntax Valid!" if errors.none?
@@ -137,8 +137,8 @@ module Metanorma
137
137
  SVG_NS = "http://www.w3.org/2000/svg".freeze
138
138
 
139
139
  WILDCARD_ATTRS =
140
- "//*[@format] | //stem | //bibdata//description | "\
141
- "//formattedref | //bibdata//note | //bibdata/abstract | "\
140
+ "//*[@format] | //stem | //bibdata//description | " \
141
+ "//formattedref | //bibdata//note | //bibdata/abstract | " \
142
142
  "//bibitem/abstract | //bibitem/note | //misc-container".freeze
143
143
 
144
144
  # RelaxNG cannot cope well with wildcard attributes. So we strip
@@ -213,7 +213,7 @@ module Metanorma
213
213
  def validate(doc)
214
214
  content_validate(doc)
215
215
  schema_validate(formattedstr_strip(doc.dup),
216
- File.join(File.dirname(__FILE__), "isodoc.rng"))
216
+ File.join(File.dirname(__FILE__), "isodoc-compile.rng"))
217
217
  end
218
218
  end
219
219
  end
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "2.2.5".freeze
22
+ VERSION = "2.2.7".freeze
23
23
  end
24
24
  end
@@ -22,8 +22,11 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.bindir = "bin"
24
24
  spec.require_paths = ["lib"]
25
- spec.files = `git ls-files`.split("\n")
26
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features|bin|.github)/}) \
27
+ || f.match(%r{Rakefile|bin/rspec})
28
+ end
29
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
30
 
28
31
  spec.add_dependency "asciidoctor", "~> 2.0.0"
29
32
  spec.add_dependency "iev", "~> 0.3.0"
@@ -37,7 +40,6 @@ Gem::Specification.new do |spec|
37
40
  spec.add_dependency "concurrent-ruby"
38
41
  spec.add_dependency "latexmath"
39
42
  spec.add_dependency "mathml2asciimath"
40
- spec.add_dependency "mn-requirements", "~> 0.1.4"
41
43
  spec.add_dependency "pngcheck"
42
44
  spec.add_dependency "relaton-cli", "~> 1.13.0"
43
45
  spec.add_dependency "relaton-iev", "~> 1.1.0"