metanorma-iso 1.5.14 → 1.7.2
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/.github/workflows/rake.yml +17 -0
- data/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +13 -13
- data/lib/asciidoctor/iso/basicdoc.rng +20 -3
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/front.rb +5 -5
- data/lib/asciidoctor/iso/isodoc.rng +118 -4
- data/lib/asciidoctor/iso/isostandard-amd.rng +11 -4
- data/lib/asciidoctor/iso/isostandard.rng +22 -10
- data/lib/asciidoctor/iso/validate.rb +78 -0
- data/lib/asciidoctor/iso/validate_section.rb +12 -9
- data/lib/isodoc/iso/html/header.html +12 -12
- data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html_convert.rb +2 -2
- data/lib/isodoc/iso/i18n-en.yaml +2 -0
- data/lib/isodoc/iso/i18n-fr.yaml +1 -1
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +451 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +451 -208
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/isodoc/iso/word_convert.rb +2 -2
- data/lib/isodoc/iso/xref.rb +28 -12
- data/lib/metanorma/iso/processor.rb +11 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -2
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +449 -458
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +814 -699
- data/spec/asciidoctor-iso/inline_spec.rb +116 -91
- data/spec/asciidoctor-iso/lists_spec.rb +128 -121
- data/spec/asciidoctor-iso/refs_spec.rb +308 -250
- data/spec/asciidoctor-iso/section_spec.rb +273 -242
- data/spec/asciidoctor-iso/table_spec.rb +258 -242
- data/spec/asciidoctor-iso/validate_spec.rb +1223 -919
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +340 -316
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +834 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +608 -525
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +184 -189
- metadata +7 -10
- data/.rubocop.ribose.yml +0 -66
- data/lib/metanorma/iso/fonts_manifest.yaml +0 -6
- data/spec/assets/xref_error.adoc +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69530242f8dcfcd209289f65397818d2d73e69920a2588b1bfa4c30b712ada50
|
4
|
+
data.tar.gz: 72261437fe21d308b4c01e4ba3ce7f9fe15a5c3a35dce4828dc7b04e2c941df4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a01d3c261513bddc48ce11f6b331ab025939d41e234a02e6e63cd39ef15c865af2a7f086768a38cbbecbec8aac76fabbb1ea5febcb3f4fb0852aab58ba7b794
|
7
|
+
data.tar.gz: d83d323c7e9ca83dc5afaead3e837da9bc952074a4f913f5eb28dce637d98ffce6f4e6206b96ff8ef3a05a585b8a75c2de215fae8a36dfae325c1b632a0cb68a
|
data/.github/workflows/rake.yml
CHANGED
@@ -36,6 +36,9 @@ jobs:
|
|
36
36
|
with:
|
37
37
|
ruby-version: ${{ matrix.ruby }}
|
38
38
|
|
39
|
+
- if: matrix.os == 'macos-latest'
|
40
|
+
run: brew install autoconf automake libtool
|
41
|
+
|
39
42
|
- uses: actions/cache@v2
|
40
43
|
with:
|
41
44
|
path: vendor/bundle
|
@@ -64,3 +67,17 @@ jobs:
|
|
64
67
|
run: cinst -y plantuml
|
65
68
|
|
66
69
|
- run: bundle exec rake
|
70
|
+
|
71
|
+
tests-passed:
|
72
|
+
needs: rake
|
73
|
+
runs-on: ubuntu-latest
|
74
|
+
continue-on-error: true
|
75
|
+
steps:
|
76
|
+
- name: Trigger tests passed event
|
77
|
+
uses: Sibz/github-status-action@v1
|
78
|
+
with:
|
79
|
+
authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
80
|
+
context: 'tests-passed-successfully'
|
81
|
+
description: 'Tests passed successfully'
|
82
|
+
state: 'success'
|
83
|
+
sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
data/.rubocop.yml
CHANGED
data/lib/asciidoctor/iso/base.rb
CHANGED
@@ -44,23 +44,23 @@ module Asciidoctor
|
|
44
44
|
@amd = %w(amendment technical-corrigendum).include? doctype(node)
|
45
45
|
end
|
46
46
|
|
47
|
-
|
47
|
+
def ol_attrs(node)
|
48
48
|
attr_code(keep_attrs(node).
|
49
|
-
merge(id: ::
|
49
|
+
merge(id: ::Metanorma::Utils::anchor_or_uuid(node)))
|
50
50
|
end
|
51
51
|
|
52
52
|
def outputs(node, ret)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
53
|
+
File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
|
54
|
+
presentation_xml_converter(node).convert(@filename + ".xml")
|
55
|
+
html_converter_alt(node).convert(@filename + ".presentation.xml",
|
56
|
+
nil, false, "#{@filename}_alt.html")
|
57
|
+
html_converter(node).convert(@filename + ".presentation.xml",
|
58
|
+
nil, false, "#{@filename}.html")
|
59
|
+
doc_converter(node).convert(@filename + ".presentation.xml",
|
60
|
+
nil, false, "#{@filename}.doc")
|
61
|
+
pdf_converter(node)&.convert(@filename + ".presentation.xml",
|
62
|
+
nil, false, "#{@filename}.pdf")
|
63
|
+
#sts_converter(node)&.convert(@filename + ".xml")
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -729,12 +729,29 @@
|
|
729
729
|
</define>
|
730
730
|
<define name="index">
|
731
731
|
<element name="index">
|
732
|
-
<attribute name="primary"/>
|
733
732
|
<optional>
|
734
|
-
<attribute name="
|
733
|
+
<attribute name="to">
|
734
|
+
<data type="IDREF"/>
|
735
|
+
</attribute>
|
736
|
+
</optional>
|
737
|
+
<element name="primary">
|
738
|
+
<oneOrMore>
|
739
|
+
<ref name="PureTextElement"/>
|
740
|
+
</oneOrMore>
|
741
|
+
</element>
|
742
|
+
<optional>
|
743
|
+
<element name="secondary">
|
744
|
+
<oneOrMore>
|
745
|
+
<ref name="PureTextElement"/>
|
746
|
+
</oneOrMore>
|
747
|
+
</element>
|
735
748
|
</optional>
|
736
749
|
<optional>
|
737
|
-
<
|
750
|
+
<element name="tertiary">
|
751
|
+
<oneOrMore>
|
752
|
+
<ref name="PureTextElement"/>
|
753
|
+
</oneOrMore>
|
754
|
+
</element>
|
738
755
|
</optional>
|
739
756
|
</element>
|
740
757
|
</define>
|
@@ -85,27 +85,27 @@ module Asciidoctor
|
|
85
85
|
def title_intro(node, t, lang, at)
|
86
86
|
return unless node.attr("title-intro-#{lang}")
|
87
87
|
t.title(**attr_code(at.merge(type: "title-intro"))) do |t1|
|
88
|
-
t1 <<
|
88
|
+
t1 << Metanorma::Utils::asciidoc_sub(node.attr("title-intro-#{lang}"))
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
92
|
def title_main(node, t, lang, at)
|
93
93
|
t.title **attr_code(at.merge(type: "title-main")) do |t1|
|
94
|
-
t1 <<
|
94
|
+
t1 << Metanorma::Utils::asciidoc_sub(node.attr("title-main-#{lang}"))
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
98
|
def title_part(node, t, lang, at)
|
99
99
|
return unless node.attr("title-part-#{lang}")
|
100
100
|
t.title(**attr_code(at.merge(type: "title-part"))) do |t1|
|
101
|
-
t1 <<
|
101
|
+
t1 << Metanorma::Utils::asciidoc_sub(node.attr("title-part-#{lang}"))
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
105
|
def title_amd(node, t, lang, at)
|
106
106
|
return unless node.attr("title-amendment-#{lang}")
|
107
107
|
t.title(**attr_code(at.merge(type: "title-amd"))) do |t1|
|
108
|
-
t1 <<
|
108
|
+
t1 << Metanorma::Utils::asciidoc_sub(node.attr("title-amendment-#{lang}"))
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
@@ -118,7 +118,7 @@ module Asciidoctor
|
|
118
118
|
title = "#{title} -- #{part}" if part
|
119
119
|
title = "#{title} -- #{amd}" if amd && @amd
|
120
120
|
t.title **attr_code(at.merge(type: "main")) do |t1|
|
121
|
-
t1 <<
|
121
|
+
t1 << Metanorma::Utils::asciidoc_sub(title)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
@@ -55,6 +55,13 @@
|
|
55
55
|
<param name="pattern">\i\c*|\c+#\c+</param>
|
56
56
|
</data>
|
57
57
|
</attribute>
|
58
|
+
<optional>
|
59
|
+
<attribute name="to">
|
60
|
+
<data type="string">
|
61
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
62
|
+
</data>
|
63
|
+
</attribute>
|
64
|
+
</optional>
|
58
65
|
<optional>
|
59
66
|
<attribute name="type">
|
60
67
|
<ref name="ReferenceFormat"/>
|
@@ -246,6 +253,9 @@
|
|
246
253
|
<data type="boolean"/>
|
247
254
|
</attribute>
|
248
255
|
</optional>
|
256
|
+
<optional>
|
257
|
+
<attribute name="width"/>
|
258
|
+
</optional>
|
249
259
|
<optional>
|
250
260
|
<ref name="colgroup"/>
|
251
261
|
</optional>
|
@@ -779,6 +789,9 @@
|
|
779
789
|
<attribute name="width"/>
|
780
790
|
</element>
|
781
791
|
</define>
|
792
|
+
<define name="BibItemType" combine="choice">
|
793
|
+
<value>internal</value>
|
794
|
+
</define>
|
782
795
|
<define name="TextElement" combine="choice">
|
783
796
|
<ref name="concept"/>
|
784
797
|
</define>
|
@@ -799,6 +812,8 @@
|
|
799
812
|
<ref name="requirement"/>
|
800
813
|
<ref name="recommendation"/>
|
801
814
|
<ref name="permission"/>
|
815
|
+
<ref name="imagemap"/>
|
816
|
+
<ref name="svgmap"/>
|
802
817
|
</choice>
|
803
818
|
</define>
|
804
819
|
<define name="bibliography">
|
@@ -829,6 +844,9 @@
|
|
829
844
|
<data type="boolean"/>
|
830
845
|
</attribute>
|
831
846
|
</optional>
|
847
|
+
<optional>
|
848
|
+
<attribute name="number"/>
|
849
|
+
</optional>
|
832
850
|
<optional>
|
833
851
|
<attribute name="obligation">
|
834
852
|
<choice>
|
@@ -884,9 +902,11 @@
|
|
884
902
|
<element name="code">
|
885
903
|
<text/>
|
886
904
|
</element>
|
887
|
-
<
|
888
|
-
<text
|
889
|
-
|
905
|
+
<optional>
|
906
|
+
<element name="text">
|
907
|
+
<text/>
|
908
|
+
</element>
|
909
|
+
</optional>
|
890
910
|
</element>
|
891
911
|
</define>
|
892
912
|
<define name="standard-document">
|
@@ -899,6 +919,9 @@
|
|
899
919
|
</choice>
|
900
920
|
</attribute>
|
901
921
|
<ref name="bibdata"/>
|
922
|
+
<optional>
|
923
|
+
<ref name="misccontainer"/>
|
924
|
+
</optional>
|
902
925
|
<optional>
|
903
926
|
<ref name="boilerplate"/>
|
904
927
|
</optional>
|
@@ -909,11 +932,21 @@
|
|
909
932
|
<zeroOrMore>
|
910
933
|
<ref name="annex"/>
|
911
934
|
</zeroOrMore>
|
935
|
+
<optional>
|
936
|
+
<ref name="bibliography"/>
|
937
|
+
</optional>
|
912
938
|
<zeroOrMore>
|
913
|
-
<ref name="
|
939
|
+
<ref name="indexsect"/>
|
914
940
|
</zeroOrMore>
|
915
941
|
</element>
|
916
942
|
</define>
|
943
|
+
<define name="misccontainer">
|
944
|
+
<element name="misc-container">
|
945
|
+
<oneOrMore>
|
946
|
+
<ref name="AnyElement"/>
|
947
|
+
</oneOrMore>
|
948
|
+
</element>
|
949
|
+
</define>
|
917
950
|
<define name="preface">
|
918
951
|
<element name="preface">
|
919
952
|
<oneOrMore>
|
@@ -937,6 +970,11 @@
|
|
937
970
|
<ref name="Content-Section"/>
|
938
971
|
</element>
|
939
972
|
</define>
|
973
|
+
<define name="indexsect">
|
974
|
+
<element name="indexsect">
|
975
|
+
<ref name="Content-Section"/>
|
976
|
+
</element>
|
977
|
+
</define>
|
940
978
|
<define name="boilerplate">
|
941
979
|
<element name="boilerplate">
|
942
980
|
<optional>
|
@@ -1056,6 +1094,9 @@
|
|
1056
1094
|
</choice>
|
1057
1095
|
</attribute>
|
1058
1096
|
</optional>
|
1097
|
+
<optional>
|
1098
|
+
<attribute name="number"/>
|
1099
|
+
</optional>
|
1059
1100
|
<optional>
|
1060
1101
|
<attribute name="type"/>
|
1061
1102
|
</optional>
|
@@ -1109,6 +1150,9 @@
|
|
1109
1150
|
<optional>
|
1110
1151
|
<attribute name="type"/>
|
1111
1152
|
</optional>
|
1153
|
+
<optional>
|
1154
|
+
<attribute name="number"/>
|
1155
|
+
</optional>
|
1112
1156
|
<optional>
|
1113
1157
|
<ref name="section-title"/>
|
1114
1158
|
</optional>
|
@@ -1211,6 +1255,9 @@
|
|
1211
1255
|
<optional>
|
1212
1256
|
<attribute name="type"/>
|
1213
1257
|
</optional>
|
1258
|
+
<optional>
|
1259
|
+
<attribute name="number"/>
|
1260
|
+
</optional>
|
1214
1261
|
<optional>
|
1215
1262
|
<attribute name="obligation">
|
1216
1263
|
<choice>
|
@@ -1539,6 +1586,7 @@
|
|
1539
1586
|
<value>add</value>
|
1540
1587
|
<value>modify</value>
|
1541
1588
|
<value>delete</value>
|
1589
|
+
<value>replace</value>
|
1542
1590
|
</choice>
|
1543
1591
|
</attribute>
|
1544
1592
|
<optional>
|
@@ -1569,6 +1617,11 @@
|
|
1569
1617
|
</optional>
|
1570
1618
|
<optional>
|
1571
1619
|
<element name="newcontent">
|
1620
|
+
<optional>
|
1621
|
+
<attribute name="id">
|
1622
|
+
<data type="ID"/>
|
1623
|
+
</attribute>
|
1624
|
+
</optional>
|
1572
1625
|
<zeroOrMore>
|
1573
1626
|
<ref name="BasicBlock"/>
|
1574
1627
|
</zeroOrMore>
|
@@ -1602,4 +1655,65 @@
|
|
1602
1655
|
<text/>
|
1603
1656
|
</element>
|
1604
1657
|
</define>
|
1658
|
+
<define name="imagemap">
|
1659
|
+
<element name="imagemap">
|
1660
|
+
<ref name="figure"/>
|
1661
|
+
<zeroOrMore>
|
1662
|
+
<element name="area">
|
1663
|
+
<attribute name="type">
|
1664
|
+
<choice>
|
1665
|
+
<value>rect</value>
|
1666
|
+
<value>circle</value>
|
1667
|
+
<value>ellipse</value>
|
1668
|
+
<value>poly</value>
|
1669
|
+
</choice>
|
1670
|
+
</attribute>
|
1671
|
+
<choice>
|
1672
|
+
<ref name="xref"/>
|
1673
|
+
<ref name="hyperlink"/>
|
1674
|
+
<ref name="eref"/>
|
1675
|
+
</choice>
|
1676
|
+
<oneOrMore>
|
1677
|
+
<element name="coords">
|
1678
|
+
<attribute name="x">
|
1679
|
+
<data type="float"/>
|
1680
|
+
</attribute>
|
1681
|
+
<attribute name="y">
|
1682
|
+
<data type="float"/>
|
1683
|
+
</attribute>
|
1684
|
+
</element>
|
1685
|
+
</oneOrMore>
|
1686
|
+
<optional>
|
1687
|
+
<element name="radius">
|
1688
|
+
<attribute name="x">
|
1689
|
+
<data type="float"/>
|
1690
|
+
</attribute>
|
1691
|
+
<optional>
|
1692
|
+
<attribute name="y">
|
1693
|
+
<data type="float"/>
|
1694
|
+
</attribute>
|
1695
|
+
</optional>
|
1696
|
+
</element>
|
1697
|
+
</optional>
|
1698
|
+
</element>
|
1699
|
+
</zeroOrMore>
|
1700
|
+
</element>
|
1701
|
+
</define>
|
1702
|
+
<define name="svgmap">
|
1703
|
+
<element name="svgmap">
|
1704
|
+
<ref name="figure"/>
|
1705
|
+
<zeroOrMore>
|
1706
|
+
<element name="target">
|
1707
|
+
<attribute name="href">
|
1708
|
+
<data type="anyURI"/>
|
1709
|
+
</attribute>
|
1710
|
+
<choice>
|
1711
|
+
<ref name="xref"/>
|
1712
|
+
<ref name="hyperlink"/>
|
1713
|
+
<ref name="eref"/>
|
1714
|
+
</choice>
|
1715
|
+
</element>
|
1716
|
+
</zeroOrMore>
|
1717
|
+
</element>
|
1718
|
+
</define>
|
1605
1719
|
</grammar>
|
@@ -14,9 +14,6 @@
|
|
14
14
|
</define>
|
15
15
|
<define name="clause">
|
16
16
|
<element name="clause">
|
17
|
-
<optional>
|
18
|
-
<attribute name="type"/>
|
19
|
-
</optional>
|
20
17
|
<optional>
|
21
18
|
<attribute name="change">
|
22
19
|
<choice>
|
@@ -34,7 +31,17 @@
|
|
34
31
|
</define>
|
35
32
|
<define name="iso-standard">
|
36
33
|
<element name="iso-standard">
|
34
|
+
<attribute name="version"/>
|
35
|
+
<attribute name="type">
|
36
|
+
<choice>
|
37
|
+
<value>semantic</value>
|
38
|
+
<value>presentation</value>
|
39
|
+
</choice>
|
40
|
+
</attribute>
|
37
41
|
<ref name="bibdata"/>
|
42
|
+
<optional>
|
43
|
+
<ref name="misccontainer"/>
|
44
|
+
</optional>
|
38
45
|
<optional>
|
39
46
|
<ref name="boilerplate"/>
|
40
47
|
</optional>
|
@@ -68,7 +75,7 @@
|
|
68
75
|
</optional>
|
69
76
|
<optional>
|
70
77
|
<attribute name="origyr">
|
71
|
-
<
|
78
|
+
<ref name="ISO8601Date"/>
|
72
79
|
</attribute>
|
73
80
|
</optional>
|
74
81
|
<text/>
|
@@ -140,22 +140,28 @@
|
|
140
140
|
</choice>
|
141
141
|
</attribute>
|
142
142
|
</optional>
|
143
|
+
<optional>
|
144
|
+
<attribute name="type"/>
|
145
|
+
</optional>
|
143
146
|
<optional>
|
144
147
|
<ref name="section-title"/>
|
145
148
|
</optional>
|
146
|
-
<
|
147
|
-
<
|
148
|
-
<
|
149
|
-
<
|
150
|
-
|
151
|
-
|
152
|
-
<
|
153
|
-
|
154
|
-
|
149
|
+
<group>
|
150
|
+
<choice>
|
151
|
+
<group>
|
152
|
+
<oneOrMore>
|
153
|
+
<ref name="BasicBlock"/>
|
154
|
+
</oneOrMore>
|
155
|
+
<zeroOrMore>
|
156
|
+
<ref name="note"/>
|
157
|
+
</zeroOrMore>
|
158
|
+
</group>
|
159
|
+
<ref name="amend"/>
|
160
|
+
</choice>
|
155
161
|
<oneOrMore>
|
156
162
|
<ref name="clause-subsection"/>
|
157
163
|
</oneOrMore>
|
158
|
-
</
|
164
|
+
</group>
|
159
165
|
</define>
|
160
166
|
<define name="term">
|
161
167
|
<element name="term">
|
@@ -422,6 +428,9 @@
|
|
422
428
|
<zeroOrMore>
|
423
429
|
<ref name="termdocsource"/>
|
424
430
|
</zeroOrMore>
|
431
|
+
<optional>
|
432
|
+
<ref name="misccontainer"/>
|
433
|
+
</optional>
|
425
434
|
<optional>
|
426
435
|
<ref name="boilerplate"/>
|
427
436
|
</optional>
|
@@ -433,6 +442,9 @@
|
|
433
442
|
<ref name="annex"/>
|
434
443
|
</zeroOrMore>
|
435
444
|
<ref name="bibliography"/>
|
445
|
+
<zeroOrMore>
|
446
|
+
<ref name="indexsect"/>
|
447
|
+
</zeroOrMore>
|
436
448
|
</element>
|
437
449
|
</define>
|
438
450
|
<define name="horizontal">
|