isodoc 2.0.8 → 2.0.8.1
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/isodoc/convert.rb +12 -4
- data/lib/isodoc/function/references.rb +2 -2
- data/lib/isodoc/presentation_function/bibdata.rb +20 -0
- data/lib/isodoc/presentation_function/section.rb +2 -2
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_counter.rb +1 -1
- data/spec/isodoc/blocks_spec.rb +0 -1
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/presentation_xml_spec.rb +107 -0
- data/spec/isodoc/ref_spec.rb +96 -0
- data/spec/isodoc/xref_spec.rb +106 -106
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a736ad455159e993e2c100d8ac3cd67a09c07705dad2fab7f30c8995636a55d8
|
4
|
+
data.tar.gz: b600c452fe5bac0622c27ab05ca4156c46caaea6f56d0cebc2d76b9377c3ae2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e534774023bcb0212a72808f5167633ecce14af71aaa506388385c5e458fd41a87bb927d87546a3b3a709021d41d1592c99cd008caab5f652023543820137ad
|
7
|
+
data.tar.gz: 9b8dfa80516811e6aa87d0cfc80ac3ad79c26eaf61edf6366b12a89c30b429d0b96e15fc7970c0ada89ce8d94ebbc08a330af41dcb5185baa7245a05f1f1a8d7
|
data/lib/isodoc/convert.rb
CHANGED
@@ -43,6 +43,8 @@ module IsoDoc
|
|
43
43
|
# tocfigures: add ToC for figures
|
44
44
|
# toctables: add ToC for tables
|
45
45
|
# tocrecommendations: add ToC for rcommendations
|
46
|
+
# fonts: fontist fonts to install
|
47
|
+
# fontlicenseagreement: fontist font license agreement
|
46
48
|
def initialize(options)
|
47
49
|
@libdir ||= File.dirname(__FILE__) # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
|
48
50
|
options.merge!(default_fonts(options)) do |_, old, new|
|
@@ -57,10 +59,7 @@ module IsoDoc
|
|
57
59
|
init_stylesheets(options)
|
58
60
|
init_covers(options)
|
59
61
|
init_toc(options)
|
60
|
-
|
61
|
-
@smallerfontsize = options[:smallerfontsize]
|
62
|
-
@monospacefontsize = options[:monospacefontsize]
|
63
|
-
@footnotefontsize = options[:footnotefontsize]
|
62
|
+
init_fonts(options)
|
64
63
|
@i18nyaml = options[:i18nyaml]
|
65
64
|
@ulstyle = options[:ulstyle]
|
66
65
|
@olstyle = options[:olstyle]
|
@@ -96,6 +95,15 @@ module IsoDoc
|
|
96
95
|
@tmpfilesdir_suffix = tmpfilesdir_suffix
|
97
96
|
end
|
98
97
|
|
98
|
+
def init_fonts(options)
|
99
|
+
@normalfontsize = options[:normalfontsize]
|
100
|
+
@smallerfontsize = options[:smallerfontsize]
|
101
|
+
@monospacefontsize = options[:monospacefontsize]
|
102
|
+
@footnotefontsize = options[:footnotefontsize]
|
103
|
+
@fontist_fonts = options[:fonts]
|
104
|
+
@fontlicenseagreement = options[:fontlicenseagreement]
|
105
|
+
end
|
106
|
+
|
99
107
|
def init_covers(options)
|
100
108
|
@header = options[:header]
|
101
109
|
@htmlcoverpage = options[:htmlcoverpage]
|
@@ -171,7 +171,7 @@ module IsoDoc
|
|
171
171
|
if b.name == "bibitem"
|
172
172
|
next if implicit_reference(b)
|
173
173
|
|
174
|
-
i += 1
|
174
|
+
i += 1 unless b["hidden"]
|
175
175
|
if standard?(b) then std_bibitem_entry(div, b, i, biblio)
|
176
176
|
else nonstd_bibitem(div, b, i, biblio)
|
177
177
|
end
|
@@ -190,7 +190,7 @@ module IsoDoc
|
|
190
190
|
(f = isoxml.at(ns(norm_ref_xpath)) and f["hidden"] != "true") or
|
191
191
|
return num
|
192
192
|
out.div do |div|
|
193
|
-
num
|
193
|
+
num += 1
|
194
194
|
clause_name(num, f.at(ns("./title")), div, nil)
|
195
195
|
if f.name == "clause"
|
196
196
|
f.elements.each { |e| parse(e, div) unless e.name == "title" }
|
@@ -1,7 +1,10 @@
|
|
1
|
+
require "csv"
|
2
|
+
|
1
3
|
module IsoDoc
|
2
4
|
class PresentationXMLConvert < ::IsoDoc::Convert
|
3
5
|
def bibdata(docxml)
|
4
6
|
toc_metadata(docxml)
|
7
|
+
fonts_metadata(docxml)
|
5
8
|
docid_prefixes(docxml)
|
6
9
|
a = bibdata_current(docxml) or return
|
7
10
|
address_precompose(a)
|
@@ -34,6 +37,23 @@ module IsoDoc
|
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
40
|
+
def fonts_metadata(xmldoc)
|
41
|
+
return unless @fontist_fonts
|
42
|
+
|
43
|
+
ins = xmldoc.at(ns("//presentation-metadata")) ||
|
44
|
+
xmldoc.at(ns("//misc-container")) || xmldoc.at(ns("//bibdata"))
|
45
|
+
CSV.parse_line(@fontist_fonts, col_sep: ";").map(&:strip).each do |f|
|
46
|
+
ins.next = presmeta("fonts", f)
|
47
|
+
end
|
48
|
+
@fontlicenseagreement and
|
49
|
+
ins.next = presmeta("font-license-agreement", @fontlicenseagreement)
|
50
|
+
end
|
51
|
+
|
52
|
+
def presmeta(name, value)
|
53
|
+
"<presentation-metadata><name>#{name}</name><value>#{value}</value>"\
|
54
|
+
"</presentation-metadata>"
|
55
|
+
end
|
56
|
+
|
37
57
|
def address_precompose1(addr)
|
38
58
|
ret = []
|
39
59
|
addr.xpath(ns("./street")).each { |s| ret << s.children.to_xml }
|
@@ -69,8 +69,8 @@ module IsoDoc
|
|
69
69
|
def bibliography_bibitem_number_skip(bibitem)
|
70
70
|
@xrefs.klass.implicit_reference(bibitem) ||
|
71
71
|
bibitem.at(ns(".//docidentifier[@type = 'metanorma']")) ||
|
72
|
-
bibitem.at(ns(".//docidentifier[@type = 'metanorma-ordinal']"))
|
73
|
-
|
72
|
+
bibitem.at(ns(".//docidentifier[@type = 'metanorma-ordinal']")) ||
|
73
|
+
bibitem["hidden"] == "true" || bibitem.parent["hidden"] == "true"
|
74
74
|
end
|
75
75
|
|
76
76
|
def bibliography_bibitem_number(docxml)
|
data/lib/isodoc/version.rb
CHANGED
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -2497,7 +2497,6 @@ RSpec.describe IsoDoc do
|
|
2497
2497
|
<bibliography>
|
2498
2498
|
<references hidden='true' normative='false' displayorder="1">
|
2499
2499
|
<bibitem id='express_action_schema' type='internal'>
|
2500
|
-
<docidentifier type='metanorma-ordinal'>[1]</docidentifier>
|
2501
2500
|
<docidentifier type='repository'>express/action_schema</docidentifier>
|
2502
2501
|
</bibitem>
|
2503
2502
|
</references>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -1603,7 +1603,7 @@ RSpec.describe IsoDoc do
|
|
1603
1603
|
<bibliography>
|
1604
1604
|
<references id='_normative_references' obligation='informative' normative='true' displayorder='2' hidden="true">
|
1605
1605
|
<title depth='1'>
|
1606
|
-
|
1606
|
+
0.
|
1607
1607
|
<tab/>
|
1608
1608
|
Normative References
|
1609
1609
|
</title>
|
@@ -1709,7 +1709,7 @@ RSpec.describe IsoDoc do
|
|
1709
1709
|
OUTPUT
|
1710
1710
|
|
1711
1711
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1712
|
-
|
1712
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1713
1713
|
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1714
1714
|
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1715
1715
|
expect(xmlpp(IsoDoc::WordConvert.new({})
|
@@ -1360,6 +1360,113 @@ RSpec.describe IsoDoc do
|
|
1360
1360
|
.to be_equivalent_to xmlpp(presxml)
|
1361
1361
|
end
|
1362
1362
|
|
1363
|
+
it "passes font names to Presentation XML" do
|
1364
|
+
input = <<~INPUT
|
1365
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1366
|
+
<bibdata/>
|
1367
|
+
<sections>
|
1368
|
+
<clause id="A" inline-header="false" obligation="normative">
|
1369
|
+
<title>Section</title>
|
1370
|
+
<figure id="B1">
|
1371
|
+
<name>First</name>
|
1372
|
+
</figure>
|
1373
|
+
</clause>
|
1374
|
+
</sections>
|
1375
|
+
</iso-standard>
|
1376
|
+
INPUT
|
1377
|
+
presxml = <<~OUTPUT
|
1378
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1379
|
+
<bibdata/>
|
1380
|
+
<presentation-metadata>
|
1381
|
+
<name>font-license-agreement</name>
|
1382
|
+
<value>no-install-fonts</value>
|
1383
|
+
</presentation-metadata>
|
1384
|
+
<presentation-metadata>
|
1385
|
+
<name>fonts</name>
|
1386
|
+
<value>font2</value>
|
1387
|
+
</presentation-metadata>
|
1388
|
+
<presentation-metadata>
|
1389
|
+
<name>fonts</name>
|
1390
|
+
<value>font1</value>
|
1391
|
+
</presentation-metadata>
|
1392
|
+
<sections>
|
1393
|
+
<clause id='A' inline-header='false' obligation='normative' displayorder='1'>
|
1394
|
+
<title depth='1'>
|
1395
|
+
1.
|
1396
|
+
<tab/>
|
1397
|
+
Section
|
1398
|
+
</title>
|
1399
|
+
<figure id='B1'>
|
1400
|
+
<name>Figure 1 — First</name>
|
1401
|
+
</figure>
|
1402
|
+
</clause>
|
1403
|
+
</sections>
|
1404
|
+
</iso-standard>
|
1405
|
+
OUTPUT
|
1406
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
1407
|
+
.new({ fonts: "font1; font2", fontlicenseagreement: "no-install-fonts" })
|
1408
|
+
.convert("test", input, true))
|
1409
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
1410
|
+
.to be_equivalent_to xmlpp(presxml)
|
1411
|
+
end
|
1412
|
+
|
1413
|
+
it "skips numbering of hidden sections" do
|
1414
|
+
input = <<~INPUT
|
1415
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic">
|
1416
|
+
<bibdata/>
|
1417
|
+
<sections><clause id="_scope" type="scope" inline-header="false" obligation="normative">
|
1418
|
+
<title>Scope</title>
|
1419
|
+
<p id="_8d98c053-85d7-e8cc-75bb-183a14209d61">A</p>
|
1420
|
+
|
1421
|
+
<p id="_2141c040-93a4-785a-73f0-ffad4fa1779f"><eref type="inline" bibitemid="_607373b1-0cc4-fcdb-c482-fd86ae572bd1" citeas="ISO 639-2"/></p>
|
1422
|
+
</clause>
|
1423
|
+
|
1424
|
+
<terms id="_terms_and_definitions" obligation="normative">
|
1425
|
+
<title>Terms and definitions</title><p id="_36938d4b-05e5-bd0f-a082-0415db50e8f7">No terms and definitions are listed in this document.</p>
|
1426
|
+
|
1427
|
+
</terms>
|
1428
|
+
</sections><bibliography><references hidden="true" normative="true">
|
1429
|
+
<title>Normative references</title>
|
1430
|
+
</references>
|
1431
|
+
</bibliography></standard-document>
|
1432
|
+
INPUT
|
1433
|
+
presxml = <<~OUTPUT
|
1434
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="presentation">
|
1435
|
+
<bibdata/>
|
1436
|
+
<sections>
|
1437
|
+
<clause id='_scope' type='scope' inline-header='false' obligation='normative' displayorder='1'>
|
1438
|
+
<title depth='1'>
|
1439
|
+
1.
|
1440
|
+
<tab/>
|
1441
|
+
Scope
|
1442
|
+
</title>
|
1443
|
+
<p id='_8d98c053-85d7-e8cc-75bb-183a14209d61'>A</p>
|
1444
|
+
<p id='_2141c040-93a4-785a-73f0-ffad4fa1779f'>
|
1445
|
+
<eref type='inline' bibitemid='_607373b1-0cc4-fcdb-c482-fd86ae572bd1' citeas='ISO 639-2'>ISO 639-2</eref>
|
1446
|
+
</p>
|
1447
|
+
</clause>
|
1448
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder='3'>
|
1449
|
+
<title depth='1'>
|
1450
|
+
2.
|
1451
|
+
<tab/>
|
1452
|
+
Terms and definitions
|
1453
|
+
</title>
|
1454
|
+
<p id='_36938d4b-05e5-bd0f-a082-0415db50e8f7'>No terms and definitions are listed in this document.</p>
|
1455
|
+
</terms>
|
1456
|
+
</sections>
|
1457
|
+
<bibliography>
|
1458
|
+
<references hidden='true' normative='true' displayorder='2'>
|
1459
|
+
<title depth='1'>Normative references</title>
|
1460
|
+
</references>
|
1461
|
+
</bibliography>
|
1462
|
+
</standard-document>
|
1463
|
+
OUTPUT
|
1464
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1465
|
+
.convert("test", input, true))
|
1466
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
1467
|
+
.to be_equivalent_to xmlpp(presxml)
|
1468
|
+
end
|
1469
|
+
|
1363
1470
|
private
|
1364
1471
|
|
1365
1472
|
def mock_symbols
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -902,4 +902,100 @@ RSpec.describe IsoDoc do
|
|
902
902
|
).at("//xmlns:bibliography").to_xml))
|
903
903
|
.to be_equivalent_to xmlpp(presxml)
|
904
904
|
end
|
905
|
+
|
906
|
+
it "enforces consistent references numbering with hidden items: metanorma identifiers" do
|
907
|
+
input = <<~INPUT
|
908
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
909
|
+
<bibdata>
|
910
|
+
<language>en</language>
|
911
|
+
</bibdata>
|
912
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="false"><title>Bibliography</title>
|
913
|
+
<bibitem id="ref1" type="standard">
|
914
|
+
<title format="text/plain">Cereals or cereal products</title>
|
915
|
+
<docidentifier type="metanorma">[1]</docidentifier>
|
916
|
+
</bibitem>
|
917
|
+
<bibitem id="ref2" type="standard" hidden="true">
|
918
|
+
<title format="text/plain">Cereals or cereal products</title>
|
919
|
+
<docidentifier type="metanorma">[2]</docidentifier>
|
920
|
+
</bibitem>
|
921
|
+
<bibitem id="ref3" type="standard">
|
922
|
+
<title format="text/plain">Cereals or cereal products</title>
|
923
|
+
<docidentifier type="metanorma">[3]</docidentifier>
|
924
|
+
</bibitem>
|
925
|
+
</references></bibliography></iso-standard>
|
926
|
+
INPUT
|
927
|
+
presxml = <<~PRESXML
|
928
|
+
<bibliography>
|
929
|
+
<references id='_normative_references' obligation='informative' normative='false' displayorder='1'>
|
930
|
+
<title depth='1'>Bibliography</title>
|
931
|
+
<bibitem id='ref1' type='standard'>
|
932
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
933
|
+
<docidentifier type='metanorma'>[1]</docidentifier>
|
934
|
+
</bibitem>
|
935
|
+
<bibitem id='ref2' type='standard' hidden='true'>
|
936
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
937
|
+
<docidentifier type='metanorma'>[2]</docidentifier>
|
938
|
+
</bibitem>
|
939
|
+
<bibitem id='ref3' type='standard'>
|
940
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
941
|
+
<docidentifier type='metanorma'>[3]</docidentifier>
|
942
|
+
</bibitem>
|
943
|
+
</references>
|
944
|
+
</bibliography>
|
945
|
+
PRESXML
|
946
|
+
expect(xmlpp(Nokogiri::XML(
|
947
|
+
IsoDoc::PresentationXMLConvert.new({})
|
948
|
+
.convert("test", input, true),
|
949
|
+
).at("//xmlns:bibliography").to_xml))
|
950
|
+
.to be_equivalent_to xmlpp(presxml)
|
951
|
+
end
|
952
|
+
|
953
|
+
it "enforces consistent references numbering with hidden items: metanorma-ordinal identifiers" do
|
954
|
+
input = <<~INPUT
|
955
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
956
|
+
<bibdata>
|
957
|
+
<language>en</language>
|
958
|
+
</bibdata>
|
959
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="false"><title>Bibliography</title>
|
960
|
+
<bibitem id="ref1" type="standard">
|
961
|
+
<title format="text/plain">Cereals or cereal products</title>
|
962
|
+
<docidentifier>ABC</docidentifier>
|
963
|
+
</bibitem>
|
964
|
+
<bibitem id="ref2" type="standard" hidden="true">
|
965
|
+
<title format="text/plain">Cereals or cereal products</title>
|
966
|
+
<docidentifier>ABD</docidentifier>
|
967
|
+
</bibitem>
|
968
|
+
<bibitem id="ref3" type="standard">
|
969
|
+
<title format="text/plain">Cereals or cereal products</title>
|
970
|
+
<docidentifier>ABE</docidentifier>
|
971
|
+
</bibitem>
|
972
|
+
</references></bibliography></iso-standard>
|
973
|
+
INPUT
|
974
|
+
presxml = <<~PRESXML
|
975
|
+
<bibliography>
|
976
|
+
<references id='_normative_references' obligation='informative' normative='false' displayorder='1'>
|
977
|
+
<title depth='1'>Bibliography</title>
|
978
|
+
<bibitem id='ref1' type='standard'>
|
979
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
980
|
+
<docidentifier type='metanorma-ordinal'>[1]</docidentifier>
|
981
|
+
<docidentifier>ABC</docidentifier>
|
982
|
+
</bibitem>
|
983
|
+
<bibitem id='ref2' type='standard' hidden='true'>
|
984
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
985
|
+
<docidentifier>ABD</docidentifier>
|
986
|
+
</bibitem>
|
987
|
+
<bibitem id='ref3' type='standard'>
|
988
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
989
|
+
<docidentifier type='metanorma-ordinal'>[2]</docidentifier>
|
990
|
+
<docidentifier>ABE</docidentifier>
|
991
|
+
</bibitem>
|
992
|
+
</references>
|
993
|
+
</bibliography>
|
994
|
+
PRESXML
|
995
|
+
expect(xmlpp(Nokogiri::XML(
|
996
|
+
IsoDoc::PresentationXMLConvert.new({})
|
997
|
+
.convert("test", input, true),
|
998
|
+
).at("//xmlns:bibliography").to_xml))
|
999
|
+
.to be_equivalent_to xmlpp(presxml)
|
1000
|
+
end
|
905
1001
|
end
|
data/spec/isodoc/xref_spec.rb
CHANGED
@@ -262,22 +262,22 @@ RSpec.describe IsoDoc do
|
|
262
262
|
</iso-standard>
|
263
263
|
INPUT
|
264
264
|
output = <<~OUTPUT
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
265
|
+
<foreword id='fwd' displayorder="1">
|
266
|
+
<p>
|
267
|
+
<xref target='N1'>Figure 1</xref>
|
268
|
+
<xref target='N2'>Figure (??)</xref>
|
269
|
+
<xref target='N'>Figure 2</xref>
|
270
|
+
<xref target='note1'>Figure 3</xref>
|
271
|
+
<xref target='note3'>Figure 4</xref>
|
272
|
+
<xref target='note4'>Figure 5</xref>
|
273
|
+
<xref target='note2'>Figure 6</xref>
|
274
|
+
<xref target='note51'>[note51]</xref>
|
275
|
+
<xref target='AN'>Figure A.1</xref>
|
276
|
+
<xref target='Anote1'>Figure (??)</xref>
|
277
|
+
<xref target='Anote2'>Figure A.2</xref>
|
278
|
+
<xref target='Anote3'>Figure A.3</xref>
|
279
|
+
</p>
|
280
|
+
</foreword>
|
281
281
|
OUTPUT
|
282
282
|
expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
|
283
283
|
.convert("test", input, true))
|
@@ -824,20 +824,20 @@ RSpec.describe IsoDoc do
|
|
824
824
|
</iso-standard>
|
825
825
|
INPUT
|
826
826
|
output = <<~OUTPUT
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
827
|
+
<foreword displayorder='1'>
|
828
|
+
<p>
|
829
|
+
<xref target='N1'>Clause 1, Permission 1</xref>
|
830
|
+
<xref target='N2'>Clause 1, Permission 1-1</xref>
|
831
|
+
<xref target='N'>Clause 1, Permission 1-1-1</xref>
|
832
|
+
<xref target='Q1'>Clause 1, Requirement 1-1</xref>
|
833
|
+
<xref target='R1'>Clause 1, Recommendation 1-1</xref>
|
834
|
+
<xref target='AN1'>Permission A.1</xref>
|
835
|
+
<xref target='AN2'>Permission A.1-1</xref>
|
836
|
+
<xref target='AN'>Permission A.1-1-1</xref>
|
837
|
+
<xref target='AQ1'>Requirement A.1-1</xref>
|
838
|
+
<xref target='AR1'>Recommendation A.1-1</xref>
|
839
|
+
</p>
|
840
|
+
</foreword>
|
841
841
|
OUTPUT
|
842
842
|
expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
|
843
843
|
.convert("test", input, true))
|
@@ -966,18 +966,18 @@ RSpec.describe IsoDoc do
|
|
966
966
|
</iso-standard>
|
967
967
|
INPUT
|
968
968
|
output = <<~OUTPUT
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
969
|
+
<foreword displayorder='1'>
|
970
|
+
<p>
|
971
|
+
<xref target='N1'>Table 1</xref>
|
972
|
+
<xref target='N2'>Table (??)</xref>
|
973
|
+
<xref target='N'>Table 2</xref>
|
974
|
+
<xref target='note1'>Table 3</xref>
|
975
|
+
<xref target='note2'>Table 4</xref>
|
976
|
+
<xref target='AN'>Table A.1</xref>
|
977
|
+
<xref target='Anote1'>Table (??)</xref>
|
978
|
+
<xref target='Anote2'>Table A.2</xref>
|
979
|
+
</p>
|
980
|
+
</foreword>
|
981
981
|
OUTPUT
|
982
982
|
expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
|
983
983
|
.convert("test", input, true))
|
@@ -1061,13 +1061,13 @@ RSpec.describe IsoDoc do
|
|
1061
1061
|
</iso-standard>
|
1062
1062
|
INPUT
|
1063
1063
|
output = <<~OUTPUT
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1064
|
+
<foreword displayorder='1'>
|
1065
|
+
<p>
|
1066
|
+
<xref target='note1'>Clause 2.1, Note 1</xref>
|
1067
|
+
<xref target='note2'>Clause 2.1.1, Note 1</xref>
|
1068
|
+
<xref target='note3'>Clause 2.1.1, Note 2</xref>
|
1069
|
+
</p>
|
1070
|
+
</foreword>
|
1071
1071
|
OUTPUT
|
1072
1072
|
expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
|
1073
1073
|
.convert("test", input, true))
|
@@ -1151,13 +1151,13 @@ RSpec.describe IsoDoc do
|
|
1151
1151
|
</iso-standard>
|
1152
1152
|
INPUT
|
1153
1153
|
output = <<~OUTPUT
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1154
|
+
<foreword displayorder='1'>
|
1155
|
+
<p>
|
1156
|
+
<xref target='note1'>Clause 2.1, Example</xref>
|
1157
|
+
<xref target='note2'>Clause 2.1.1, Example 1</xref>
|
1158
|
+
<xref target='note3'>Clause 2.1.1, Example 2</xref>
|
1159
|
+
</p>
|
1160
|
+
</foreword>
|
1161
1161
|
OUTPUT
|
1162
1162
|
expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
|
1163
1163
|
.convert("test", input, true))
|
@@ -1255,31 +1255,31 @@ RSpec.describe IsoDoc do
|
|
1255
1255
|
</iso-standard>
|
1256
1256
|
INPUT
|
1257
1257
|
output = <<~OUTPUT
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1258
|
+
<foreword obligation='informative' displayorder='1'>
|
1259
|
+
<title>Foreword</title>
|
1260
|
+
<p id='A'>
|
1261
|
+
This is a preamble
|
1262
|
+
<xref target='C'>Introduction Subsection</xref>
|
1263
|
+
<xref target='C1'>Introduction, 2</xref>
|
1264
|
+
<xref target='D'>Clause 1</xref>
|
1265
|
+
<xref target='H'>Clause 3</xref>
|
1266
|
+
<xref target='I'>Clause 3.1</xref>
|
1267
|
+
<xref target='J'>Clause 3.1.1</xref>
|
1268
|
+
<xref target='K'>Clause 3.2</xref>
|
1269
|
+
<xref target='L'>Clause 4</xref>
|
1270
|
+
<xref target='M'>Clause 5</xref>
|
1271
|
+
<xref target='N'>Clause 5.1</xref>
|
1272
|
+
<xref target='O'>Clause 5.2</xref>
|
1273
|
+
<xref target='P'>Annex A</xref>
|
1274
|
+
<xref target='Q'>Annex A.1</xref>
|
1275
|
+
<xref target='Q1'>Annex A.1.1</xref>
|
1276
|
+
<xref target='QQ'>Annex B</xref>
|
1277
|
+
<xref target='QQ1'>Annex B</xref>
|
1278
|
+
<xref target='QQ2'>Annex B.1</xref>
|
1279
|
+
<xref target='R'>Clause 2</xref>
|
1280
|
+
<xref target='S'>Bibliography</xref>
|
1281
|
+
</p>
|
1282
|
+
</foreword>
|
1283
1283
|
OUTPUT
|
1284
1284
|
expect(xmlpp(Nokogiri.XML(IsoDoc::PresentationXMLConvert.new({})
|
1285
1285
|
.convert("test", input, true))
|
@@ -1720,31 +1720,31 @@ RSpec.describe IsoDoc do
|
|
1720
1720
|
</iso-standard>
|
1721
1721
|
INPUT
|
1722
1722
|
output = <<~OUTPUT
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1723
|
+
<foreword displayorder='1'>
|
1724
|
+
<p>
|
1725
|
+
<xref target='N1'>
|
1726
|
+
Introduction, Definition List:
|
1727
|
+
<stem type='MathML'>
|
1728
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1729
|
+
<msub>
|
1730
|
+
<mrow>
|
1731
|
+
<mover accent='true'>
|
1732
|
+
<mrow>
|
1733
|
+
<mi>e</mi>
|
1734
|
+
</mrow>
|
1735
|
+
<mo>^</mo>
|
1736
|
+
</mover>
|
1737
|
+
</mrow>
|
1738
|
+
<mrow>
|
1739
|
+
<mi>r</mi>
|
1740
|
+
</mrow>
|
1741
|
+
</msub>
|
1742
|
+
</math>
|
1743
|
+
<!-- (hat e)_((r)) -->
|
1744
|
+
</stem>
|
1745
|
+
</xref>
|
1746
|
+
</p>
|
1747
|
+
</foreword>
|
1748
1748
|
OUTPUT
|
1749
1749
|
expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
|
1750
1750
|
.convert("test", input, true))
|