metanorma-standoc 2.1.2 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/biblio.rng +102 -5
- data/lib/metanorma/standoc/blocks.rb +3 -6
- data/lib/metanorma/standoc/blocks_notes.rb +1 -1
- data/lib/metanorma/standoc/cleanup.rb +3 -1
- data/lib/metanorma/standoc/cleanup_block.rb +41 -1
- data/lib/metanorma/standoc/cleanup_footnotes.rb +19 -17
- data/lib/metanorma/standoc/cleanup_ref.rb +16 -0
- data/lib/metanorma/standoc/cleanup_section.rb +6 -0
- data/lib/metanorma/standoc/cleanup_terms.rb +6 -2
- data/lib/metanorma/standoc/cleanup_xref.rb +2 -1
- data/lib/metanorma/standoc/converter.rb +2 -0
- data/lib/metanorma/standoc/isodoc.rng +33 -0
- data/lib/metanorma/standoc/macros_note.rb +26 -0
- data/lib/metanorma/standoc/ref.rb +3 -1
- data/lib/metanorma/standoc/ref_sect.rb +5 -2
- data/lib/metanorma/standoc/ref_utility.rb +20 -6
- data/lib/metanorma/standoc/section.rb +3 -1
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +1 -1
- data/lib/metanorma/standoc/utils.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/examples/datamodel/address_class_profile.presentation.xml +14 -0
- data/spec/metanorma/blocks_spec.rb +55 -0
- data/spec/metanorma/cleanup_blocks_spec.rb +83 -0
- data/spec/metanorma/cleanup_sections_spec.rb +55 -4
- data/spec/metanorma/cleanup_spec.rb +1 -1
- data/spec/metanorma/isobib_cache_spec.rb +6 -4
- data/spec/metanorma/macros_spec.rb +36 -8
- data/spec/metanorma/refs_dl_spec.rb +18 -7
- data/spec/metanorma/refs_spec.rb +252 -281
- data/spec/metanorma/validate_spec.rb +60 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/vcr_cassettes/bsi16341.yml +58 -72
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +98 -98
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +14 -14
- data/spec/vcr_cassettes/hide_refs.yml +57 -57
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -27
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +36 -36
- data/spec/vcr_cassettes/isobib_get_123_2.yml +295 -0
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +228 -52
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- data/spec/vcr_cassettes/std-link.yml +13 -71
- metadata +7 -5
@@ -60,7 +60,7 @@ module Metanorma
|
|
60
60
|
"[not(ancestor::boilerplate)]".freeze
|
61
61
|
|
62
62
|
def isodoc(lang, script, i18nyaml = nil)
|
63
|
-
conv =
|
63
|
+
conv = presentation_xml_converter(EmptyAttr.new)
|
64
64
|
i18n = conv.i18n_init(lang, script, i18nyaml)
|
65
65
|
conv.metadata_init(lang, script, i18n)
|
66
66
|
conv
|
data/metanorma-standoc.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_dependency "latexmath"
|
39
39
|
spec.add_dependency "mathml2asciimath"
|
40
40
|
spec.add_dependency "metanorma-utils", "~> 1.2.8"
|
41
|
-
spec.add_dependency "relaton-cli", "~> 1.
|
41
|
+
spec.add_dependency "relaton-cli", "~> 1.12.0"
|
42
42
|
spec.add_dependency "relaton-iev", "~> 1.1.0"
|
43
43
|
spec.add_dependency "unicode2latex", "~> 0.0.1"
|
44
44
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="presentation" version="2.0.4">
|
3
|
+
<bibdata type="standard">
|
4
|
+
<title language="en" format="text/plain">Document title</title>
|
5
|
+
<language current="true">en</language><script current="true">Latn</script><status><stage language="">published</stage></status><copyright><from>2022</from></copyright><ext><doctype language="">article</doctype></ext></bibdata><localized-strings><localized-string key="scope" language="en">Scope</localized-string><localized-string key="symbolsabbrev" language="en">Symbols and abbreviated terms</localized-string><localized-string key="abbrev" language="en">Abbreviated terms</localized-string><localized-string key="symbols" language="en">Symbols</localized-string><localized-string key="table_of_contents" language="en">Table of contents</localized-string><localized-string key="introduction" language="en">Introduction</localized-string><localized-string key="foreword" language="en">Foreword</localized-string><localized-string key="abstract" language="en">Abstract</localized-string><localized-string key="acknowledgements" language="en">Acknowledgements</localized-string><localized-string key="termsdef" language="en">Terms and definitions</localized-string><localized-string key="termsdefsymbolsabbrev" language="en">Terms, definitions, symbols and abbreviated terms</localized-string><localized-string key="termsdefsymbols" language="en">Terms, definitions and symbols</localized-string><localized-string key="termsdefabbrev" language="en">Terms, definitions and abbreviated terms</localized-string><localized-string key="normref" language="en">Normative references</localized-string><localized-string key="bibliography" language="en">Bibliography</localized-string><localized-string key="preface" language="en">Preface</localized-string><localized-string key="clause" language="en">Clause</localized-string><localized-string key="annex" language="en">Annex</localized-string><localized-string key="appendix" language="en">Appendix</localized-string><localized-string key="no_terms_boilerplate" language="en"><p>No terms and definitions are listed in this document.</p>
|
6
|
+
</localized-string><localized-string key="internal_terms_boilerplate" language="en"><p>For the purposes of this document,
|
7
|
+
the following terms and definitions apply.</p>
|
8
|
+
</localized-string><localized-string key="norm_with_refs_pref" language="en">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</localized-string><localized-string key="norm_empty_pref" language="en">There are no normative references in this document.</localized-string><localized-string key="external_terms_boilerplate" language="en"><p>For the purposes of this document,
|
9
|
+
the terms and definitions given in % apply.</p>
|
10
|
+
</localized-string><localized-string key="internal_external_terms_boilerplate" language="en"><p>For the purposes of this document, the terms and definitions
|
11
|
+
given in % and the following apply.</p>
|
12
|
+
</localized-string><localized-string key="term_defined_in" language="en">[term defined in %]</localized-string><localized-string key="binary_and" language="en">%1 and %2</localized-string><localized-string key="multiple_and" language="en">%1, and %2</localized-string><localized-string key="binary_or" language="en">%1 or %2</localized-string><localized-string key="multiple_or" language="en">%1, or %2</localized-string><localized-string key="chain_and" language="en">%1 and %2</localized-string><localized-string key="chain_or" language="en">%1 or %2</localized-string><localized-string key="chain_from" language="en">%1 from %2</localized-string><localized-string key="chain_to" language="en">%1 to %2</localized-string><localized-string key="note" language="en">NOTE</localized-string><localized-string key="note_xref" language="en">Note</localized-string><localized-string key="termnote" language="en">Note % to entry</localized-string><localized-string key="list" language="en">List</localized-string><localized-string key="deflist" language="en">Definition List</localized-string><localized-string key="figure" language="en">Figure</localized-string><localized-string key="formula" language="en">Formula</localized-string><localized-string key="inequality" language="en">Formula</localized-string><localized-string key="table" language="en">Table</localized-string><localized-string key="requirement" language="en">Requirement</localized-string><localized-string key="recommendation" language="en">Recommendation</localized-string><localized-string key="permission" language="en">Permission</localized-string><localized-string key="key" language="en">Key</localized-string><localized-string key="example" language="en">EXAMPLE</localized-string><localized-string key="example_xref" language="en">Example</localized-string><localized-string key="where" language="en">where</localized-string><localized-string key="wholeoftext" language="en">Whole of text</localized-string><localized-string key="draft_label" language="en">draft</localized-string><localized-string key="inform_annex" language="en">informative</localized-string><localized-string key="norm_annex" language="en">normative</localized-string><localized-string key="modified" language="en">modified</localized-string><localized-string key="deprecated" language="en">DEPRECATED</localized-string><localized-string key="source" language="en">SOURCE</localized-string><localized-string key="and" language="en">and</localized-string><localized-string key="all_parts" language="en">All Parts</localized-string><localized-string key="toc_figures" language="en">List of figures</localized-string><localized-string key="toc_tables" language="en">List of tables</localized-string><localized-string key="toc_recommendations" language="en">List of recommendations</localized-string><localized-string key="month_january" language="en">January</localized-string><localized-string key="month_february" language="en">February</localized-string><localized-string key="month_march" language="en">March</localized-string><localized-string key="month_april" language="en">April</localized-string><localized-string key="month_may" language="en">May</localized-string><localized-string key="month_june" language="en">June</localized-string><localized-string key="month_july" language="en">July</localized-string><localized-string key="month_august" language="en">August</localized-string><localized-string key="month_september" language="en">September</localized-string><localized-string key="month_october" language="en">October</localized-string><localized-string key="month_november" language="en">November</localized-string><localized-string key="month_december" language="en">December</localized-string><localized-string key="obligation" language="en">Obligation</localized-string><localized-string key="subject" language="en">Subject</localized-string><localized-string key="inherits" language="en">Inherits</localized-string><localized-string key="admonition.danger" language="en">Danger</localized-string><localized-string key="admonition.warning" language="en">Warning</localized-string><localized-string key="admonition.caution" language="en">Caution</localized-string><localized-string key="admonition.important" language="en">Important</localized-string><localized-string key="admonition.safety_precautions" language="en">Safety Precautions</localized-string><localized-string key="locality.section" language="en">Section</localized-string><localized-string key="locality.clause" language="en">Clause</localized-string><localized-string key="locality.part" language="en">Part</localized-string><localized-string key="locality.paragraph" language="en">Paragraph</localized-string><localized-string key="locality.chapter" language="en">Chapter</localized-string><localized-string key="locality.page" language="en">Page</localized-string><localized-string key="locality.table" language="en">Table</localized-string><localized-string key="locality.annex" language="en">Annex</localized-string><localized-string key="locality.figure" language="en">Figure</localized-string><localized-string key="locality.example" language="en">Example</localized-string><localized-string key="locality.note" language="en">Note</localized-string><localized-string key="locality.formula" language="en">Formula</localized-string><localized-string key="grammar_abbrevs.masculine" language="en">m</localized-string><localized-string key="grammar_abbrevs.feminine" language="en">f</localized-string><localized-string key="grammar_abbrevs.neuter" language="en">n</localized-string><localized-string key="grammar_abbrevs.common" language="en">common</localized-string><localized-string key="grammar_abbrevs.singular" language="en">sg</localized-string><localized-string key="grammar_abbrevs.dual" language="en">dual</localized-string><localized-string key="grammar_abbrevs.pl" language="en">pl</localized-string><localized-string key="grammar_abbrevs.isPreposition" language="en">prep</localized-string><localized-string key="grammar_abbrevs.isParticiple" language="en">part</localized-string><localized-string key="grammar_abbrevs.isAdjective" language="en">adj</localized-string><localized-string key="grammar_abbrevs.isAdverb" language="en">adv</localized-string><localized-string key="grammar_abbrevs.isNoun" language="en">noun</localized-string><localized-string key="grammar_abbrevs.isVerb" language="en">verb</localized-string><localized-string key="relatedterms.deprecates" language="en">deprecates</localized-string><localized-string key="relatedterms.supersedes" language="en">supersedes</localized-string><localized-string key="relatedterms.narrower" language="en">narrower</localized-string><localized-string key="relatedterms.broader" language="en">broader</localized-string><localized-string key="relatedterms.equivalent" language="en">equivalent</localized-string><localized-string key="relatedterms.compare" language="en">compare</localized-string><localized-string key="relatedterms.contrast" language="en">contrast</localized-string><localized-string key="relatedterms.see" language="en">see</localized-string><localized-string key="Clause.sg" language="en">Clause</localized-string><localized-string key="Clause.pl" language="en">Clauses</localized-string><localized-string key="Annex.sg" language="en">Annex</localized-string><localized-string key="Annex.pl" language="en">Annexes</localized-string><localized-string key="Appendix.sg" language="en">Appendix</localized-string><localized-string key="Appendix.pl" language="en">Appendixes</localized-string><localized-string key="Note.sg" language="en">Note</localized-string><localized-string key="Note.pl" language="en">Notes</localized-string><localized-string key="Note_%_to_entry.sg" language="en">Note % to entry</localized-string><localized-string key="Note_%_to_entry.pl" language="en">Notes % to entry</localized-string><localized-string key="List.sg" language="en">List</localized-string><localized-string key="List.pl" language="en">Lists</localized-string><localized-string key="Figure.sg" language="en">Figure</localized-string><localized-string key="Figure.pl" language="en">Figures</localized-string><localized-string key="Formula.sg" language="en">Formula</localized-string><localized-string key="Formula.pl" language="en">Formulas</localized-string><localized-string key="Table.sg" language="en">Table</localized-string><localized-string key="Table.pl" language="en">Tables</localized-string><localized-string key="Requirement.sg" language="en">Requirement</localized-string><localized-string key="Requirement.pl" language="en">Requirements</localized-string><localized-string key="Recommendation.sg" language="en">Recommendation</localized-string><localized-string key="Recommendation.pl" language="en">Recommendations</localized-string><localized-string key="Permission.sg" language="en">Permission</localized-string><localized-string key="Permission.pl" language="en">Permissions</localized-string><localized-string key="Example.sg" language="en">Example</localized-string><localized-string key="Example.pl" language="en">Examples</localized-string><localized-string key="Part.sg" language="en">Part</localized-string><localized-string key="Part.pl" language="en">Parts</localized-string><localized-string key="Section.sg" language="en">Section</localized-string><localized-string key="Section.pl" language="en">Sections</localized-string><localized-string key="Paragraph.sg" language="en">Paragraph</localized-string><localized-string key="Paragraph.pl" language="en">Paragraphs</localized-string><localized-string key="Chapter.sg" language="en">Chapter</localized-string><localized-string key="Chapter.pl" language="en">Chapters</localized-string><localized-string key="Page.sg" language="en">Page</localized-string><localized-string key="Page.pl" language="en">Pages</localized-string><localized-string key="language" language="en">en</localized-string><localized-string key="script" language="en">Latn</localized-string></localized-strings>
|
13
|
+
<sections> </sections>
|
14
|
+
</standard-document>
|
@@ -412,6 +412,8 @@ RSpec.describe Metanorma::Standoc do
|
|
412
412
|
|
413
413
|
NOTE: This is a note
|
414
414
|
|
415
|
+
WARNING: This is not a note
|
416
|
+
|
415
417
|
[NOTE,keep-separate=true,tag=X,multilingual-rendering=common]
|
416
418
|
====
|
417
419
|
XYZ
|
@@ -428,6 +430,9 @@ RSpec.describe Metanorma::Standoc do
|
|
428
430
|
<termnote id="_">
|
429
431
|
<p id="_">This is a note</p>
|
430
432
|
</termnote>
|
433
|
+
<admonition id='_' type='warning'>
|
434
|
+
<p id='_'>This is not a note</p>
|
435
|
+
</admonition>
|
431
436
|
<termnote id='_' tag='X' multilingual-rendering='common'>
|
432
437
|
<p id='_'>XYZ</p>
|
433
438
|
</termnote>
|
@@ -1065,6 +1070,56 @@ RSpec.describe Metanorma::Standoc do
|
|
1065
1070
|
.to be_equivalent_to xmlpp(output)
|
1066
1071
|
end
|
1067
1072
|
|
1073
|
+
it "ignores index terms when processing figures marked up as examples" do
|
1074
|
+
input = <<~INPUT
|
1075
|
+
#{ASCIIDOC_BLANK_HDR}
|
1076
|
+
|
1077
|
+
====
|
1078
|
+
image::spec/examples/rice_images/rice_image3_1.png[]
|
1079
|
+
====
|
1080
|
+
|
1081
|
+
====
|
1082
|
+
((indexterm))
|
1083
|
+
|
1084
|
+
image::spec/examples/rice_images/rice_image3_3.png[]
|
1085
|
+
====
|
1086
|
+
|
1087
|
+
====
|
1088
|
+
(((indexterm2)))
|
1089
|
+
|
1090
|
+
image::spec/examples/rice_images/rice_image3_2.png[]
|
1091
|
+
====
|
1092
|
+
INPUT
|
1093
|
+
output = <<~OUTPUT
|
1094
|
+
#{BLANK_HDR}
|
1095
|
+
<sections>
|
1096
|
+
<figure id='_'>
|
1097
|
+
<image src='spec/examples/rice_images/rice_image3_1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1098
|
+
</figure>
|
1099
|
+
<example id='_'>
|
1100
|
+
<p id='_'>
|
1101
|
+
indexterm
|
1102
|
+
<index>
|
1103
|
+
<primary>indexterm</primary>
|
1104
|
+
</index>
|
1105
|
+
</p>
|
1106
|
+
<figure id='_'>
|
1107
|
+
<image src='spec/examples/rice_images/rice_image3_3.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1108
|
+
</figure>
|
1109
|
+
</example>
|
1110
|
+
<figure id='_'>
|
1111
|
+
<index>
|
1112
|
+
<primary>indexterm2</primary>
|
1113
|
+
</index>
|
1114
|
+
<image src='spec/examples/rice_images/rice_image3_2.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1115
|
+
</figure>
|
1116
|
+
</sections>
|
1117
|
+
</standard-document>
|
1118
|
+
OUTPUT
|
1119
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1120
|
+
.to be_equivalent_to xmlpp(output)
|
1121
|
+
end
|
1122
|
+
|
1068
1123
|
it "processes images" do
|
1069
1124
|
input = <<~INPUT
|
1070
1125
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1184,4 +1184,87 @@ RSpec.describe Metanorma::Standoc do
|
|
1184
1184
|
.gsub(%r{<style.*?</style>}m, "<style/>")))
|
1185
1185
|
.to be_equivalent_to xmlpp(output)
|
1186
1186
|
end
|
1187
|
+
|
1188
|
+
it "removes paras with indexterms" do
|
1189
|
+
input = <<~INPUT
|
1190
|
+
#{ASCIIDOC_BLANK_HDR}
|
1191
|
+
|
1192
|
+
== Clause 1
|
1193
|
+
|
1194
|
+
Paragraph
|
1195
|
+
|
1196
|
+
(((index)))
|
1197
|
+
|
1198
|
+
[NOTE]
|
1199
|
+
--
|
1200
|
+
|
1201
|
+
(((index)))
|
1202
|
+
|
1203
|
+
Note
|
1204
|
+
--
|
1205
|
+
|
1206
|
+
[NOTE]
|
1207
|
+
--
|
1208
|
+
|
1209
|
+
(((index)))
|
1210
|
+
|
1211
|
+
--
|
1212
|
+
|
1213
|
+
== Clause 2
|
1214
|
+
|
1215
|
+
Paragraph
|
1216
|
+
|
1217
|
+
((index))
|
1218
|
+
|
1219
|
+
INPUT
|
1220
|
+
|
1221
|
+
output = <<~OUTPUT
|
1222
|
+
#{BLANK_HDR}
|
1223
|
+
<sections>
|
1224
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1225
|
+
<title>Clause 1</title>
|
1226
|
+
<p id='_'>
|
1227
|
+
Paragraph
|
1228
|
+
<index>
|
1229
|
+
<primary>index</primary>
|
1230
|
+
</index>
|
1231
|
+
</p>
|
1232
|
+
<note id='_'>
|
1233
|
+
<p id='_'>
|
1234
|
+
<index>
|
1235
|
+
<primary>index</primary>
|
1236
|
+
</index>
|
1237
|
+
Note
|
1238
|
+
</p>
|
1239
|
+
</note>
|
1240
|
+
<note id='_'>
|
1241
|
+
<p id='_'>
|
1242
|
+
<index>
|
1243
|
+
<primary>index</primary>
|
1244
|
+
</index>
|
1245
|
+
</p>
|
1246
|
+
</note>
|
1247
|
+
</clause>
|
1248
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1249
|
+
<title>Clause 2</title>
|
1250
|
+
<p id='_'>Paragraph</p>
|
1251
|
+
<p id='_'>
|
1252
|
+
index
|
1253
|
+
<index>
|
1254
|
+
<primary>index</primary>
|
1255
|
+
</index>
|
1256
|
+
</p>
|
1257
|
+
</clause>
|
1258
|
+
</sections>
|
1259
|
+
</standard-document>
|
1260
|
+
OUTPUT
|
1261
|
+
xml = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
1262
|
+
xml.xpath("//*[local-name() = 'image']").each do |x|
|
1263
|
+
x.replace("<image/>")
|
1264
|
+
end
|
1265
|
+
expect(xmlpp(strip_guid(xml.to_xml)
|
1266
|
+
.gsub(%r{<style.*?</style>}m, "<style/>")))
|
1267
|
+
.to be_equivalent_to xmlpp(output)
|
1268
|
+
end
|
1269
|
+
|
1187
1270
|
end
|
@@ -1713,7 +1713,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1713
1713
|
<li>
|
1714
1714
|
<p id='_'>
|
1715
1715
|
<xref target='cl2'>
|
1716
|
-
Clause
|
1716
|
+
Clause#{' '}
|
1717
1717
|
<em>A</em>
|
1718
1718
|
<stem type='MathML'>
|
1719
1719
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
@@ -1726,7 +1726,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1726
1726
|
<li>
|
1727
1727
|
<p id='_'>
|
1728
1728
|
<xref target='a1'>
|
1729
|
-
Clause
|
1729
|
+
Clause#{' '}
|
1730
1730
|
<em>A</em>
|
1731
1731
|
<stem type='MathML'>
|
1732
1732
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
@@ -1766,7 +1766,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1766
1766
|
<title>Clause2</title>
|
1767
1767
|
<variant-title type='sub'>“A” ‘B’</variant-title>
|
1768
1768
|
<variant-title type='toc'>
|
1769
|
-
Clause
|
1769
|
+
Clause#{' '}
|
1770
1770
|
<em>A</em>
|
1771
1771
|
<stem type='MathML'>
|
1772
1772
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
@@ -1780,7 +1780,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1780
1780
|
<annex id='a1' inline-header='false' obligation='normative'>
|
1781
1781
|
<title>Clause</title>
|
1782
1782
|
<variant-title type='toc'>
|
1783
|
-
Clause
|
1783
|
+
Clause#{' '}
|
1784
1784
|
<em>A</em>
|
1785
1785
|
<stem type='MathML'>
|
1786
1786
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
@@ -1795,4 +1795,55 @@ RSpec.describe Metanorma::Standoc do
|
|
1795
1795
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1796
1796
|
.to be_equivalent_to xmlpp(output)
|
1797
1797
|
end
|
1798
|
+
|
1799
|
+
it "processes bibliography annex" do
|
1800
|
+
input = <<~INPUT
|
1801
|
+
#{ASCIIDOC_BLANK_HDR}
|
1802
|
+
|
1803
|
+
[appendix]
|
1804
|
+
== Bibliography
|
1805
|
+
|
1806
|
+
[bibliography]
|
1807
|
+
=== Bibliography
|
1808
|
+
INPUT
|
1809
|
+
output = <<~OUTPUT
|
1810
|
+
<annex id='_' obligation='' language='' script=''>
|
1811
|
+
<title>Bibliography</title>
|
1812
|
+
<references id='_' normative='false' obligation='informative'>
|
1813
|
+
<title>Bibliography</title>
|
1814
|
+
</references>
|
1815
|
+
</annex>
|
1816
|
+
OUTPUT
|
1817
|
+
ret = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
1818
|
+
expect(xmlpp(strip_guid(ret.at("//xmlns:annex").to_xml)))
|
1819
|
+
.to be_equivalent_to(output)
|
1820
|
+
end
|
1821
|
+
|
1822
|
+
it "processes terms annex" do
|
1823
|
+
input = <<~INPUT
|
1824
|
+
#{ASCIIDOC_BLANK_HDR}
|
1825
|
+
|
1826
|
+
[appendix]
|
1827
|
+
== Terms and definitions
|
1828
|
+
|
1829
|
+
=== Terms and definitions
|
1830
|
+
INPUT
|
1831
|
+
output = <<~OUTPUT
|
1832
|
+
<annex id='_' obligation='' language='' script=''>
|
1833
|
+
<terms id='_' obligation='normative'>
|
1834
|
+
<title>Terms and definitions</title>
|
1835
|
+
<term id='term-Terms-and-definitions'>
|
1836
|
+
<preferred>
|
1837
|
+
<expression>
|
1838
|
+
<name>Terms and definitions</name>
|
1839
|
+
</expression>
|
1840
|
+
</preferred>
|
1841
|
+
</term>
|
1842
|
+
</terms>
|
1843
|
+
</annex>
|
1844
|
+
OUTPUT
|
1845
|
+
ret = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
1846
|
+
expect(xmlpp(strip_guid(ret.at("//xmlns:annex").to_xml)))
|
1847
|
+
.to be_equivalent_to(output)
|
1848
|
+
end
|
1798
1849
|
end
|
@@ -1299,7 +1299,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1299
1299
|
<sourcecode id='L__xf6_we'>
|
1300
1300
|
<name>
|
1301
1301
|
See
|
1302
|
-
<eref type='inline' bibitemid='L__xf6_wner2016' citeas='
|
1302
|
+
<eref type='inline' bibitemid='L__xf6_wner2016' citeas='Löwner et al. 2016'/>
|
1303
1303
|
</name>
|
1304
1304
|
ABC
|
1305
1305
|
</sourcecode>
|
@@ -50,7 +50,7 @@ ISO_124_DATED = <<~XML.freeze
|
|
50
50
|
<uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
|
51
51
|
<uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
|
52
52
|
<docidentifier type="ISO" primary="true">ISO 124:2014</docidentifier>
|
53
|
-
<docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7
|
53
|
+
<docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7</docidentifier>
|
54
54
|
<docnumber>124</docnumber>
|
55
55
|
<date type="published">
|
56
56
|
<on>2014-03</on>
|
@@ -82,6 +82,7 @@ ISO_124_DATED = <<~XML.freeze
|
|
82
82
|
<relation type="obsoletes">
|
83
83
|
<bibitem type="standard">
|
84
84
|
<formattedref format="text/plain">ISO 124:2011</formattedref>
|
85
|
+
<docidentifier type='ISO' primary='true'>ISO 124:2011</docidentifier>
|
85
86
|
</bibitem>
|
86
87
|
</relation>
|
87
88
|
<place>Geneva</place>
|
@@ -95,7 +96,7 @@ ISO_124_DATED = <<~XML.freeze
|
|
95
96
|
<text>Latex and raw rubber</text>
|
96
97
|
</ics>
|
97
98
|
<structuredidentifier type="ISO">
|
98
|
-
<project-number
|
99
|
+
<project-number>ISO 124</project-number>
|
99
100
|
</structuredidentifier>
|
100
101
|
</ext>
|
101
102
|
</bibdata>
|
@@ -209,7 +210,7 @@ ISO_123_DATED = <<~XML.freeze
|
|
209
210
|
<uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
|
210
211
|
<uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
|
211
212
|
<docidentifier type="ISO" primary="true">ISO 123:2001</docidentifier>
|
212
|
-
<docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3
|
213
|
+
<docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3</docidentifier>
|
213
214
|
<docnumber>123</docnumber>
|
214
215
|
<date type="published">
|
215
216
|
<on>2001-05</on>
|
@@ -247,6 +248,7 @@ ISO_123_DATED = <<~XML.freeze
|
|
247
248
|
<relation type="obsoletes">
|
248
249
|
<bibitem type="standard">
|
249
250
|
<formattedref format="text/plain">ISO 123:1985</formattedref>
|
251
|
+
<docidentifier type='ISO' primary='true'>ISO 123:1985</docidentifier>
|
250
252
|
</bibitem>
|
251
253
|
</relation>
|
252
254
|
<place>Geneva</place>
|
@@ -260,7 +262,7 @@ ISO_123_DATED = <<~XML.freeze
|
|
260
262
|
<text>Latex and raw rubber</text>
|
261
263
|
</ics>
|
262
264
|
<structuredidentifier type="ISO">
|
263
|
-
<project-number
|
265
|
+
<project-number>ISO 123</project-number>
|
264
266
|
</structuredidentifier>
|
265
267
|
</ext>
|
266
268
|
</bibdata>
|
@@ -167,6 +167,38 @@ RSpec.describe Metanorma::Standoc do
|
|
167
167
|
.to be_equivalent_to xmlpp(output)
|
168
168
|
end
|
169
169
|
|
170
|
+
it "processes the macro for editorial notes" do
|
171
|
+
input = <<~INPUT
|
172
|
+
#{ASCIIDOC_BLANK_HDR}
|
173
|
+
EDITOR: Note1
|
174
|
+
|
175
|
+
[EDITOR]
|
176
|
+
====
|
177
|
+
Note2
|
178
|
+
====
|
179
|
+
|
180
|
+
[EDITOR]
|
181
|
+
Note3
|
182
|
+
INPUT
|
183
|
+
output = <<~OUTPUT
|
184
|
+
#{BLANK_HDR}
|
185
|
+
<sections>
|
186
|
+
<admonition id='_' type='editorial'>
|
187
|
+
<p id='_'>Note1</p>
|
188
|
+
</admonition>
|
189
|
+
<admonition id='_' type='editorial'>
|
190
|
+
<p id='_'>Note2</p>
|
191
|
+
</admonition>
|
192
|
+
<admonition id='_' type='editorial'>
|
193
|
+
<p id='_'>Note3</p>
|
194
|
+
</admonition>
|
195
|
+
</sections>
|
196
|
+
</standard-document>
|
197
|
+
OUTPUT
|
198
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
199
|
+
.to be_equivalent_to xmlpp(output)
|
200
|
+
end
|
201
|
+
|
170
202
|
it "processes the Metanorma::Standoc concept and related macros" do
|
171
203
|
input = <<~INPUT
|
172
204
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1612,15 +1644,9 @@ RSpec.describe Metanorma::Standoc do
|
|
1612
1644
|
<doctype>standard</doctype>
|
1613
1645
|
<editorialgroup>
|
1614
1646
|
<agency>ISO</agency>
|
1615
|
-
<technical-committee/>
|
1616
|
-
<subcommittee/>
|
1617
|
-
<workgroup/>
|
1618
1647
|
</editorialgroup>
|
1619
1648
|
<approvalgroup>
|
1620
1649
|
<agency>ISO</agency>
|
1621
|
-
<technical-committee/>
|
1622
|
-
<subcommittee/>
|
1623
|
-
<workgroup/>
|
1624
1650
|
</approvalgroup>
|
1625
1651
|
<stagename>International standard</stagename>
|
1626
1652
|
</ext>
|
@@ -1680,7 +1706,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1680
1706
|
<uri type='src'>https://www.iso.org/standard/3944.html</uri>
|
1681
1707
|
<uri type='rss'>https://www.iso.org/contents/data/standard/00/39/3944.detail.rss</uri>
|
1682
1708
|
<docidentifier type='ISO' primary='true'>ISO 131</docidentifier>
|
1683
|
-
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1
|
1709
|
+
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1</docidentifier>
|
1684
1710
|
<docnumber>131</docnumber>
|
1685
1711
|
<contributor>
|
1686
1712
|
<role type='publisher'/>
|
@@ -1708,6 +1734,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1708
1734
|
<relation type='obsoletes'>
|
1709
1735
|
<bibitem type='standard'>
|
1710
1736
|
<formattedref format='text/plain'>ISO/R 357:1963</formattedref>
|
1737
|
+
<docidentifier type='ISO' primary='true'>ISO/R 357:1963</docidentifier>
|
1711
1738
|
</bibitem>
|
1712
1739
|
</relation>
|
1713
1740
|
<relation type='instance'>
|
@@ -1722,7 +1749,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1722
1749
|
<uri type='src'>https://www.iso.org/standard/3944.html</uri>
|
1723
1750
|
<uri type='rss'>https://www.iso.org/contents/data/standard/00/39/3944.detail.rss</uri>
|
1724
1751
|
<docidentifier type='ISO' primary='true'>ISO 131:1979</docidentifier>
|
1725
|
-
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1
|
1752
|
+
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1</docidentifier>
|
1726
1753
|
<docnumber>131</docnumber>
|
1727
1754
|
<date type='published'>
|
1728
1755
|
<on>1979-11</on>
|
@@ -1753,6 +1780,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1753
1780
|
<relation type='obsoletes'>
|
1754
1781
|
<bibitem type='standard'>
|
1755
1782
|
<formattedref format='text/plain'>ISO/R 357:1963</formattedref>
|
1783
|
+
<docidentifier type='ISO' primary='true'>ISO/R 357:1963</docidentifier>
|
1756
1784
|
</bibitem>
|
1757
1785
|
</relation>
|
1758
1786
|
<place>Geneva</place>
|
@@ -43,7 +43,6 @@ RSpec.describe Metanorma::Standoc do
|
|
43
43
|
<title>Normative references</title>
|
44
44
|
#{NORM_REF_BOILERPLATE}
|
45
45
|
<bibitem id="iso123" type="standard">
|
46
|
-
<fetched/>
|
47
46
|
<title type='title-main' format='text/plain'>Standard</title>
|
48
47
|
<title type='main' format='text/plain'>Standard</title>
|
49
48
|
<docidentifier type="ISO">ISO 123</docidentifier>
|
@@ -102,6 +101,7 @@ RSpec.describe Metanorma::Standoc do
|
|
102
101
|
docid::
|
103
102
|
type::: ISO
|
104
103
|
id::: TC211
|
104
|
+
primary::: true
|
105
105
|
docnumber:: 211
|
106
106
|
edition:: 1
|
107
107
|
language::
|
@@ -256,6 +256,7 @@ RSpec.describe Metanorma::Standoc do
|
|
256
256
|
==== Relation
|
257
257
|
type:: updates
|
258
258
|
bibitem::
|
259
|
+
title::: Geographic information
|
259
260
|
formattedref::: ISO 19115:2003
|
260
261
|
bib_locality:::
|
261
262
|
type:::: page
|
@@ -267,6 +268,7 @@ RSpec.describe Metanorma::Standoc do
|
|
267
268
|
bibitem::
|
268
269
|
type::: standard
|
269
270
|
formattedref::: ISO 19115:2003/Cor 1:2006
|
271
|
+
title::: Geographic information
|
270
272
|
|
271
273
|
==== Series
|
272
274
|
type:: main
|
@@ -289,6 +291,7 @@ RSpec.describe Metanorma::Standoc do
|
|
289
291
|
|
290
292
|
==== Series
|
291
293
|
type:: alt
|
294
|
+
title:: seriestitle
|
292
295
|
formattedref::
|
293
296
|
content::: serieref
|
294
297
|
language::: en
|
@@ -317,7 +320,7 @@ RSpec.describe Metanorma::Standoc do
|
|
317
320
|
<uri type="src">https://www.iso.org/standard/53798.html</uri>
|
318
321
|
<uri type="obp">https://www.iso.org/obp/ui/#!iso:std:53798:en</uri>
|
319
322
|
<uri type="rss">https://www.iso.org/contents/data/standard/05/37/53798.detail.rss</uri>
|
320
|
-
<docidentifier type=
|
323
|
+
<docidentifier type='ISO' primary='true'>TC211</docidentifier>
|
321
324
|
<docnumber>211</docnumber>
|
322
325
|
<date type="issued">
|
323
326
|
<on>2014</on>
|
@@ -417,12 +420,14 @@ RSpec.describe Metanorma::Standoc do
|
|
417
420
|
</copyright>
|
418
421
|
<relation type="updates">
|
419
422
|
<bibitem>
|
420
|
-
<
|
423
|
+
<title type='title-main' format='text/plain'>Geographic information</title>
|
424
|
+
<title type='main' format='text/plain'>Geographic information</title>
|
421
425
|
</bibitem>
|
422
426
|
</relation>
|
423
427
|
<relation type="updates">
|
424
428
|
<bibitem type="standard">
|
425
|
-
|
429
|
+
<title type='title-main' format='text/plain'>Geographic information</title>
|
430
|
+
<title type='main' format='text/plain'>Geographic information</title>
|
426
431
|
</bibitem>
|
427
432
|
</relation>
|
428
433
|
<series type="main">
|
@@ -437,6 +442,7 @@ RSpec.describe Metanorma::Standoc do
|
|
437
442
|
</series>
|
438
443
|
<series type="alt">
|
439
444
|
<formattedref format="text/plain" language="en" script="Latn">serieref</formattedref>
|
445
|
+
<title format='text/plain'>seriestitle</title>
|
440
446
|
</series>
|
441
447
|
<medium>
|
442
448
|
<form>medium form</form>
|
@@ -596,6 +602,7 @@ RSpec.describe Metanorma::Standoc do
|
|
596
602
|
contributor.role:: author
|
597
603
|
relation::
|
598
604
|
relation.type:: updates
|
605
|
+
relation.bibitem.title:: Geographic information
|
599
606
|
relation.bibitem.formattedref:: ISO 19115:2003
|
600
607
|
relation.bibitem.bib_locality.type:: page
|
601
608
|
relation.bibitem.bib_locality.reference_from:: 7
|
@@ -603,6 +610,7 @@ RSpec.describe Metanorma::Standoc do
|
|
603
610
|
relation::
|
604
611
|
relation.type:: updates
|
605
612
|
relation.bibitem.type:: standard
|
613
|
+
relation.bibitem.title:: Geographic information
|
606
614
|
relation.bibitem.formattedref:: ISO 19115:2003/Cor 1:2006
|
607
615
|
series::
|
608
616
|
series.type:: main
|
@@ -622,6 +630,7 @@ RSpec.describe Metanorma::Standoc do
|
|
622
630
|
series.partnumber:: part5678
|
623
631
|
series::
|
624
632
|
series.type:: alt
|
633
|
+
series.title:: seriestitle
|
625
634
|
series.formattedref.content:: serieref
|
626
635
|
series.formattedref.language:: en
|
627
636
|
series.formattedref.script:: Latn
|
@@ -740,12 +749,14 @@ RSpec.describe Metanorma::Standoc do
|
|
740
749
|
</copyright>
|
741
750
|
<relation type="updates">
|
742
751
|
<bibitem>
|
743
|
-
<
|
752
|
+
<title type='title-main' format='text/plain'>Geographic information</title>
|
753
|
+
<title type='main' format='text/plain'>Geographic information</title>
|
744
754
|
</bibitem>
|
745
755
|
</relation>
|
746
756
|
<relation type="updates">
|
747
757
|
<bibitem type="standard">
|
748
|
-
|
758
|
+
<title type='title-main' format='text/plain'>Geographic information</title>
|
759
|
+
<title type='main' format='text/plain'>Geographic information</title>
|
749
760
|
</bibitem>
|
750
761
|
</relation>
|
751
762
|
<series type="main">
|
@@ -760,6 +771,7 @@ RSpec.describe Metanorma::Standoc do
|
|
760
771
|
</series>
|
761
772
|
<series type="alt">
|
762
773
|
<formattedref format="text/plain" language="en" script="Latn">serieref</formattedref>
|
774
|
+
<title format='text/plain'>seriestitle</title>
|
763
775
|
</series>
|
764
776
|
<medium>
|
765
777
|
<form>medium form</form>
|
@@ -842,7 +854,6 @@ RSpec.describe Metanorma::Standoc do
|
|
842
854
|
<docidentifier>B</docidentifier>
|
843
855
|
</bibitem>
|
844
856
|
<bibitem id='iso123' type='standard'>
|
845
|
-
<fetched/>
|
846
857
|
<title type='title-main' format='text/plain'>Standard</title>
|
847
858
|
<title type='main' format='text/plain'>Standard</title>
|
848
859
|
<docidentifier type='ISO'>ISO 123</docidentifier>
|