metanorma-iso 1.10.1 → 1.10.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/.github/workflows/ubuntu.yml +1 -1
- data/Gemfile +1 -1
- data/lib/asciidoctor/iso/base.rb +1 -1
- data/lib/asciidoctor/iso/basicdoc.rng +1 -11
- data/lib/asciidoctor/iso/biblio.rng +0 -2
- data/lib/asciidoctor/iso/front.rb +17 -4
- data/lib/asciidoctor/iso/front_id.rb +20 -17
- data/lib/asciidoctor/iso/isodoc.rng +61 -19
- data/lib/asciidoctor/iso/isostandard-amd.rng +1 -1
- data/lib/asciidoctor/iso/isostandard.rng +15 -3
- data/lib/asciidoctor/iso/reqt.rng +1 -1
- data/lib/asciidoctor/iso/section.rb +1 -1
- data/lib/asciidoctor/iso/validate.rb +1 -1
- data/lib/asciidoctor/iso/validate_image.rb +1 -1
- data/lib/asciidoctor/iso/validate_section.rb +1 -1
- data/lib/isodoc/iso/base_convert.rb +14 -31
- data/lib/isodoc/iso/html/isodoc.css +0 -1
- data/lib/isodoc/iso/html/isodoc.scss +0 -1
- data/lib/isodoc/iso/html/style-human.css +40 -9
- data/lib/isodoc/iso/html/style-human.scss +36 -9
- data/lib/isodoc/iso/html/style-iso.css +35 -6
- data/lib/isodoc/iso/html/style-iso.scss +31 -6
- data/lib/isodoc/iso/html/wordstyle.css +10 -8
- data/lib/isodoc/iso/html/wordstyle.scss +10 -8
- data/lib/isodoc/iso/html_convert.rb +81 -22
- data/lib/isodoc/iso/index.rb +53 -45
- data/lib/isodoc/iso/iso.amendment.xsl +333 -113
- data/lib/isodoc/iso/iso.international-standard.xsl +333 -113
- data/lib/isodoc/iso/isosts_convert.rb +6 -2
- data/lib/isodoc/iso/metadata.rb +27 -22
- data/lib/isodoc/iso/presentation_xml_convert.rb +60 -25
- data/lib/isodoc/iso/sts_convert.rb +3 -2
- data/lib/isodoc/iso/word_convert.rb +0 -2
- data/lib/metanorma/iso/processor.rb +2 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +3 -3
- data/spec/asciidoctor/base_spec.rb +397 -545
- data/spec/asciidoctor/blocks_spec.rb +4 -4
- data/spec/asciidoctor/cleanup_spec.rb +15 -12
- data/spec/asciidoctor/refs_spec.rb +87 -84
- data/spec/isodoc/amd_spec.rb +261 -250
- data/spec/isodoc/i18n_spec.rb +7 -7
- data/spec/isodoc/inline_spec.rb +242 -216
- data/spec/isodoc/iso_spec.rb +3 -1
- data/spec/isodoc/postproc_spec.rb +111 -28
- data/spec/isodoc/section_spec.rb +3 -3
- data/spec/isodoc/terms_spec.rb +34 -41
- data/spec/isodoc/xref_spec.rb +3 -3
- data/spec/metanorma/processor_spec.rb +110 -14
- data/spec/vcr_cassettes/docrels.yml +37 -427
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a8f44a84f1173e2b495a6ccb50683b6b17454ec8408b740a1adb56b3c05e4a2
|
4
|
+
data.tar.gz: 6efb198dffa92685545a865310668345cbc20f6b6a08e79d1b63cbda0961aa27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c848159c457326d7cd76a3000721b063d16febbd3f7db96a673a666c0fe8abddcc0c0ef6bc330a4d0be85a09b101e22dda9d954e9b7ae4c331cd698168c827a6
|
7
|
+
data.tar.gz: d1b9dd77f0e81ec1aa9e0415d83026bab80a59dd205fd0d0cd2349e0e41b5a22078928120f9e373f220391a50d17b10320577d18796a7973792f503f63eca89f
|
data/Gemfile
CHANGED
@@ -4,7 +4,7 @@ Encoding.default_internal = Encoding::UTF_8
|
|
4
4
|
source "https://rubygems.org"
|
5
5
|
git_source(:github) { |repo| "https://github.com/#{repo}" }
|
6
6
|
|
7
|
-
|
7
|
+
gem "relaton", git: "https://github.com/relaton/relaton"
|
8
8
|
|
9
9
|
gemspec
|
10
10
|
|
data/lib/asciidoctor/iso/base.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
2
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<include href="biblio.rng">
|
4
4
|
<start>
|
5
5
|
<ref name="document"/>
|
@@ -19,7 +19,6 @@
|
|
19
19
|
</define>
|
20
20
|
<define name="bibdata">
|
21
21
|
<element name="bibdata">
|
22
|
-
<a:documentation>Document attributes</a:documentation>
|
23
22
|
<ref name="BibData"/>
|
24
23
|
</element>
|
25
24
|
</define>
|
@@ -105,12 +104,10 @@
|
|
105
104
|
</define>
|
106
105
|
<define name="paragraph">
|
107
106
|
<element name="p">
|
108
|
-
<a:documentation>Paragraph</a:documentation>
|
109
107
|
<ref name="ParagraphType"/>
|
110
108
|
</element>
|
111
109
|
</define>
|
112
110
|
<define name="Alignments">
|
113
|
-
<a:documentation>Text alignment</a:documentation>
|
114
111
|
<choice>
|
115
112
|
<value>left</value>
|
116
113
|
<value>right</value>
|
@@ -218,7 +215,6 @@
|
|
218
215
|
</define>
|
219
216
|
<define name="quote">
|
220
217
|
<element name="quote">
|
221
|
-
<a:documentation>Block quotes</a:documentation>
|
222
218
|
<attribute name="id">
|
223
219
|
<data type="ID"/>
|
224
220
|
</attribute>
|
@@ -253,7 +249,6 @@
|
|
253
249
|
</define>
|
254
250
|
<define name="sourcecode">
|
255
251
|
<element name="sourcecode">
|
256
|
-
<a:documentation>Source code, a pre-formatted source snippet to be rendered in monospace font, and with spaces preserved</a:documentation>
|
257
252
|
<attribute name="id">
|
258
253
|
<data type="ID"/>
|
259
254
|
</attribute>
|
@@ -1052,7 +1047,6 @@
|
|
1052
1047
|
</define>
|
1053
1048
|
<define name="ul">
|
1054
1049
|
<element name="ul">
|
1055
|
-
<a:documentation>Unordered list</a:documentation>
|
1056
1050
|
<attribute name="id">
|
1057
1051
|
<data type="ID"/>
|
1058
1052
|
</attribute>
|
@@ -1066,7 +1060,6 @@
|
|
1066
1060
|
</define>
|
1067
1061
|
<define name="li">
|
1068
1062
|
<element name="li">
|
1069
|
-
<a:documentation>List item</a:documentation>
|
1070
1063
|
<optional>
|
1071
1064
|
<attribute name="id">
|
1072
1065
|
<data type="ID"/>
|
@@ -1104,7 +1097,6 @@
|
|
1104
1097
|
</define>
|
1105
1098
|
<define name="dl">
|
1106
1099
|
<element name="dl">
|
1107
|
-
<a:documentation>Definition list</a:documentation>
|
1108
1100
|
<attribute name="id">
|
1109
1101
|
<data type="ID"/>
|
1110
1102
|
</attribute>
|
@@ -1119,7 +1111,6 @@
|
|
1119
1111
|
</define>
|
1120
1112
|
<define name="dt">
|
1121
1113
|
<element name="dt">
|
1122
|
-
<a:documentation>Definition term</a:documentation>
|
1123
1114
|
<zeroOrMore>
|
1124
1115
|
<ref name="TextElement"/>
|
1125
1116
|
</zeroOrMore>
|
@@ -1127,7 +1118,6 @@
|
|
1127
1118
|
</define>
|
1128
1119
|
<define name="dd">
|
1129
1120
|
<element name="dd">
|
1130
|
-
<a:documentation>Definition description</a:documentation>
|
1131
1121
|
<zeroOrMore>
|
1132
1122
|
<ref name="paragraph-with-footnote"/>
|
1133
1123
|
</zeroOrMore>
|
@@ -76,14 +76,12 @@
|
|
76
76
|
<define name="script">
|
77
77
|
<a:documentation>ISO-639</a:documentation>
|
78
78
|
<element name="script">
|
79
|
-
<a:documentation>ISO-639</a:documentation>
|
80
79
|
<text/>
|
81
80
|
</element>
|
82
81
|
</define>
|
83
82
|
<define name="edition">
|
84
83
|
<a:documentation>ISO-15924: Latn</a:documentation>
|
85
84
|
<element name="edition">
|
86
|
-
<a:documentation>ISO-15924: Latn</a:documentation>
|
87
85
|
<optional>
|
88
86
|
<attribute name="number"/>
|
89
87
|
</optional>
|
@@ -18,8 +18,8 @@ module Asciidoctor
|
|
18
18
|
xml.updates_document_type a
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
|
21
|
+
def metadata_subdoctype(node, xml)
|
22
|
+
super
|
23
23
|
a = node.attr("horizontal") and xml.horizontal a
|
24
24
|
end
|
25
25
|
|
@@ -146,11 +146,24 @@ module Asciidoctor
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def relaton_relations
|
149
|
-
super + %w(obsoletes)
|
149
|
+
super + %w(obsoletes successor-of manifestation-of related annotation-of)
|
150
150
|
end
|
151
151
|
|
152
152
|
def relaton_relation_descriptions
|
153
|
-
super.merge(
|
153
|
+
super.merge(
|
154
|
+
"amends" => "updates", "revises" => "updates",
|
155
|
+
"replaces" => "obsoletes",
|
156
|
+
"supersedes" => "obsoletes",
|
157
|
+
"corrects" => "updates",
|
158
|
+
"informatively-cited-in" => "isCitedIn",
|
159
|
+
"informatively-cites" => "cites",
|
160
|
+
"normatively-cited in" => "isCitedIn",
|
161
|
+
"normatively-cites" => "cites",
|
162
|
+
"identical-adopted-from" => "adoptedFrom",
|
163
|
+
"modified-adopted-from" => "adoptedFrom",
|
164
|
+
"related-directive" => "related",
|
165
|
+
"related-mandate" => "related",
|
166
|
+
)
|
154
167
|
end
|
155
168
|
end
|
156
169
|
end
|
@@ -48,7 +48,7 @@ module Asciidoctor
|
|
48
48
|
ret
|
49
49
|
end
|
50
50
|
|
51
|
-
def stage_name(stage, substage,
|
51
|
+
def stage_name(stage, substage, _doctype, iteration = nil)
|
52
52
|
return "Proof" if stage == "60" && substage == "00"
|
53
53
|
|
54
54
|
ret = STAGE_NAMES[stage.to_sym]
|
@@ -69,7 +69,7 @@ module Asciidoctor
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def iso_id(node, xml)
|
72
|
-
!@amd && node.attr("docnumber") || @amd && node.attr("updates") or
|
72
|
+
(!@amd && node.attr("docnumber")) || (@amd && node.attr("updates")) or
|
73
73
|
return
|
74
74
|
|
75
75
|
dn = iso_id1(node)
|
@@ -133,28 +133,33 @@ module Asciidoctor
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def id_stage_abbr(stage, substage, node, bare = false)
|
136
|
-
ret =
|
137
|
-
IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
|
138
|
-
.status_abbrev(stage_abbr(stage, substage, doctype(node)),
|
139
|
-
substage, nil, nil, doctype(node))
|
140
|
-
else
|
141
|
-
IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
|
142
|
-
.status_abbrev(stage_abbr(stage, substage, doctype(node)),
|
143
|
-
substage, node.attr("iteration"),
|
144
|
-
node.attr("draft"), doctype(node))
|
145
|
-
end
|
136
|
+
ret = id_stage_abbr1(stage, substage, node, bare)
|
146
137
|
if %w(amendment technical-corrigendum technical-report
|
147
|
-
technical-specification).include?(doctype(node))
|
148
|
-
|
138
|
+
technical-specification).include?(doctype(node)) &&
|
139
|
+
!%w(D FD).include?(ret)
|
140
|
+
ret = "#{ret} "
|
149
141
|
end
|
150
142
|
ret
|
151
143
|
end
|
152
144
|
|
145
|
+
def id_stage_abbr1(stage, substage, node, bare)
|
146
|
+
if bare
|
147
|
+
IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
|
148
|
+
.status_abbrev(stage_abbr(stage, substage, doctype(node)),
|
149
|
+
substage, nil, nil, doctype(node))
|
150
|
+
else
|
151
|
+
IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
|
152
|
+
.status_abbrev(stage_abbr(stage, substage, doctype(node)),
|
153
|
+
substage, node.attr("iteration"),
|
154
|
+
node.attr("draft"), doctype(node))
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
153
158
|
def cover_stage_abbr(node)
|
154
159
|
stage = get_stage(node)
|
155
160
|
abbr = id_stage_abbr(get_stage(node), get_substage(node), node, true)
|
156
161
|
typeabbr = get_typeabbr(node, true)
|
157
|
-
if stage.to_i > 50 || stage.to_i == 60 && get_substage(node).to_i < 60
|
162
|
+
if stage.to_i > 50 || (stage.to_i == 60 && get_substage(node).to_i < 60)
|
158
163
|
typeabbr = ""
|
159
164
|
end
|
160
165
|
"#{abbr}#{typeabbr}".strip
|
@@ -213,8 +218,6 @@ module Asciidoctor
|
|
213
218
|
when "technical-specification" then "TS "
|
214
219
|
when "amendment" then (amd ? "Amd " : "")
|
215
220
|
when "technical-corrigendum" then (amd ? "Cor " : "")
|
216
|
-
else
|
217
|
-
nil
|
218
221
|
end
|
219
222
|
end
|
220
223
|
end
|
@@ -58,7 +58,7 @@
|
|
58
58
|
<attribute name="alt"/>
|
59
59
|
</optional>
|
60
60
|
<optional>
|
61
|
-
<attribute name="
|
61
|
+
<attribute name="update-type">
|
62
62
|
<data type="boolean"/>
|
63
63
|
</attribute>
|
64
64
|
</optional>
|
@@ -194,7 +194,6 @@
|
|
194
194
|
</optional>
|
195
195
|
<optional>
|
196
196
|
<attribute name="type">
|
197
|
-
<a:documentation>allow specifying labels of an ordered list</a:documentation>
|
198
197
|
<choice>
|
199
198
|
<value>roman</value>
|
200
199
|
<value>alphabet</value>
|
@@ -1797,6 +1796,20 @@
|
|
1797
1796
|
<data type="ID"/>
|
1798
1797
|
</attribute>
|
1799
1798
|
</optional>
|
1799
|
+
<optional>
|
1800
|
+
<attribute name="language"/>
|
1801
|
+
</optional>
|
1802
|
+
<optional>
|
1803
|
+
<attribute name="script"/>
|
1804
|
+
</optional>
|
1805
|
+
<optional>
|
1806
|
+
<attribute name="tag"/>
|
1807
|
+
</optional>
|
1808
|
+
<optional>
|
1809
|
+
<attribute name="multilingual-rendering">
|
1810
|
+
<ref name="MultilingualRenderingType"/>
|
1811
|
+
</attribute>
|
1812
|
+
</optional>
|
1800
1813
|
<oneOrMore>
|
1801
1814
|
<ref name="preferred"/>
|
1802
1815
|
</oneOrMore>
|
@@ -1815,9 +1828,6 @@
|
|
1815
1828
|
<optional>
|
1816
1829
|
<ref name="termsubject"/>
|
1817
1830
|
</optional>
|
1818
|
-
<optional>
|
1819
|
-
<ref name="termusage"/>
|
1820
|
-
</optional>
|
1821
1831
|
<oneOrMore>
|
1822
1832
|
<ref name="termdefinition"/>
|
1823
1833
|
</oneOrMore>
|
@@ -1881,17 +1891,37 @@
|
|
1881
1891
|
</attribute>
|
1882
1892
|
</optional>
|
1883
1893
|
<optional>
|
1884
|
-
<attribute name="
|
1894
|
+
<attribute name="geographic-area"/>
|
1885
1895
|
</optional>
|
1886
1896
|
<choice>
|
1887
1897
|
<ref name="expression_designation"/>
|
1888
1898
|
<ref name="letter_symbol_designation"/>
|
1889
1899
|
<ref name="graphical_symbol_designation"/>
|
1890
1900
|
</choice>
|
1901
|
+
<optional>
|
1902
|
+
<ref name="fieldofapplication"/>
|
1903
|
+
</optional>
|
1904
|
+
<optional>
|
1905
|
+
<ref name="usageinfo"/>
|
1906
|
+
</optional>
|
1891
1907
|
<zeroOrMore>
|
1892
1908
|
<ref name="termsource"/>
|
1893
1909
|
</zeroOrMore>
|
1894
1910
|
</define>
|
1911
|
+
<define name="fieldofapplication">
|
1912
|
+
<element name="field-of-application">
|
1913
|
+
<oneOrMore>
|
1914
|
+
<ref name="PureTextElement"/>
|
1915
|
+
</oneOrMore>
|
1916
|
+
</element>
|
1917
|
+
</define>
|
1918
|
+
<define name="usageinfo">
|
1919
|
+
<element name="usage-info">
|
1920
|
+
<oneOrMore>
|
1921
|
+
<ref name="PureTextElement"/>
|
1922
|
+
</oneOrMore>
|
1923
|
+
</element>
|
1924
|
+
</define>
|
1895
1925
|
<define name="letter_symbol_designation">
|
1896
1926
|
<element name="letter-symbol">
|
1897
1927
|
<optional>
|
@@ -1943,11 +1973,15 @@
|
|
1943
1973
|
</optional>
|
1944
1974
|
<element name="name">
|
1945
1975
|
<zeroOrMore>
|
1946
|
-
<
|
1976
|
+
<choice>
|
1977
|
+
<ref name="PureTextElement"/>
|
1978
|
+
<ref name="stem"/>
|
1979
|
+
<ref name="index"/>
|
1980
|
+
</choice>
|
1947
1981
|
</zeroOrMore>
|
1948
1982
|
</element>
|
1949
1983
|
<optional>
|
1950
|
-
<element name="
|
1984
|
+
<element name="abbreviation-type">
|
1951
1985
|
<ref name="AbbreviationType"/>
|
1952
1986
|
</element>
|
1953
1987
|
</optional>
|
@@ -1957,7 +1991,7 @@
|
|
1957
1991
|
</element>
|
1958
1992
|
</optional>
|
1959
1993
|
<optional>
|
1960
|
-
<element name="
|
1994
|
+
<element name="grammar">
|
1961
1995
|
<ref name="Grammar"/>
|
1962
1996
|
</element>
|
1963
1997
|
</optional>
|
@@ -1984,6 +2018,11 @@
|
|
1984
2018
|
<ref name="GrammarGender"/>
|
1985
2019
|
</element>
|
1986
2020
|
</zeroOrMore>
|
2021
|
+
<zeroOrMore>
|
2022
|
+
<element name="number">
|
2023
|
+
<ref name="GrammarNumber"/>
|
2024
|
+
</element>
|
2025
|
+
</zeroOrMore>
|
1987
2026
|
<optional>
|
1988
2027
|
<element name="isPreposition">
|
1989
2028
|
<data type="boolean"/>
|
@@ -2015,7 +2054,7 @@
|
|
2015
2054
|
</element>
|
2016
2055
|
</optional>
|
2017
2056
|
<zeroOrMore>
|
2018
|
-
<element name="
|
2057
|
+
<element name="grammar-value">
|
2019
2058
|
<text/>
|
2020
2059
|
</element>
|
2021
2060
|
</zeroOrMore>
|
@@ -2028,6 +2067,13 @@
|
|
2028
2067
|
<value>common</value>
|
2029
2068
|
</choice>
|
2030
2069
|
</define>
|
2070
|
+
<define name="GrammarNumber">
|
2071
|
+
<choice>
|
2072
|
+
<value>singular</value>
|
2073
|
+
<value>dual</value>
|
2074
|
+
<value>plural</value>
|
2075
|
+
</choice>
|
2076
|
+
</define>
|
2031
2077
|
<define name="termdomain">
|
2032
2078
|
<element name="domain">
|
2033
2079
|
<oneOrMore>
|
@@ -2042,13 +2088,6 @@
|
|
2042
2088
|
</oneOrMore>
|
2043
2089
|
</element>
|
2044
2090
|
</define>
|
2045
|
-
<define name="termusage">
|
2046
|
-
<element name="usageinfo">
|
2047
|
-
<oneOrMore>
|
2048
|
-
<ref name="BasicBlock"/>
|
2049
|
-
</oneOrMore>
|
2050
|
-
</element>
|
2051
|
-
</define>
|
2052
2091
|
<define name="termdefinition">
|
2053
2092
|
<element name="definition">
|
2054
2093
|
<choice>
|
@@ -2062,13 +2101,16 @@
|
|
2062
2101
|
</element>
|
2063
2102
|
</define>
|
2064
2103
|
<define name="verbaldefinition">
|
2065
|
-
<element name="
|
2104
|
+
<element name="verbal-definition">
|
2066
2105
|
<oneOrMore>
|
2067
2106
|
<choice>
|
2068
2107
|
<ref name="paragraph"/>
|
2069
2108
|
<ref name="dl"/>
|
2070
2109
|
<ref name="ol"/>
|
2071
2110
|
<ref name="ul"/>
|
2111
|
+
<ref name="table"/>
|
2112
|
+
<ref name="figure"/>
|
2113
|
+
<ref name="formula"/>
|
2072
2114
|
</choice>
|
2073
2115
|
</oneOrMore>
|
2074
2116
|
<zeroOrMore>
|
@@ -2077,7 +2119,7 @@
|
|
2077
2119
|
</element>
|
2078
2120
|
</define>
|
2079
2121
|
<define name="nonverbalrep">
|
2080
|
-
<element name="
|
2122
|
+
<element name="non-verbal-representation">
|
2081
2123
|
<oneOrMore>
|
2082
2124
|
<choice>
|
2083
2125
|
<ref name="table"/>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0"
|
2
|
+
<grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
|
4
4
|
<include href="isostandard.rng">
|
5
5
|
<start>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0"
|
2
|
+
<grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
|
4
4
|
<include href="isodoc.rng">
|
5
5
|
<start>
|
@@ -159,6 +159,20 @@
|
|
159
159
|
<data type="ID"/>
|
160
160
|
</attribute>
|
161
161
|
</optional>
|
162
|
+
<optional>
|
163
|
+
<attribute name="language"/>
|
164
|
+
</optional>
|
165
|
+
<optional>
|
166
|
+
<attribute name="script"/>
|
167
|
+
</optional>
|
168
|
+
<optional>
|
169
|
+
<attribute name="tag"/>
|
170
|
+
</optional>
|
171
|
+
<optional>
|
172
|
+
<attribute name="multilingual-rendering">
|
173
|
+
<ref name="MultilingualRenderingType"/>
|
174
|
+
</attribute>
|
175
|
+
</optional>
|
162
176
|
<ref name="preferred"/>
|
163
177
|
<zeroOrMore>
|
164
178
|
<ref name="admitted"/>
|
@@ -359,7 +373,6 @@
|
|
359
373
|
-->
|
360
374
|
<define name="iso-standard">
|
361
375
|
<element name="iso-standard">
|
362
|
-
<a:documentation>Root element for xml document</a:documentation>
|
363
376
|
<attribute name="version"/>
|
364
377
|
<attribute name="type">
|
365
378
|
<choice>
|
@@ -470,7 +483,6 @@
|
|
470
483
|
</define>
|
471
484
|
<define name="annex-appendix">
|
472
485
|
<element name="appendix">
|
473
|
-
<a:documentation>Appendix</a:documentation>
|
474
486
|
<ref name="Clause-Section"/>
|
475
487
|
</element>
|
476
488
|
</define>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
2
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<!--
|
4
4
|
Presupposes isodoc.rnc, is included in it
|
5
5
|
include "isodoc.rnc" { }
|
@@ -78,7 +78,7 @@ module Asciidoctor
|
|
78
78
|
# ISO/IEC DIR 2, 16.5.6
|
79
79
|
def termdef_style(xmldoc)
|
80
80
|
xmldoc.xpath("//term").each do |t|
|
81
|
-
para = t.at("./definition/
|
81
|
+
para = t.at("./definition/verbal-definition") || return
|
82
82
|
term = t.at("./preferred//name").text
|
83
83
|
termdef_warn(para.text, /\A(the|a)\b/i, t, term,
|
84
84
|
"term definition starts with article")
|
@@ -216,7 +216,7 @@ module Asciidoctor
|
|
216
216
|
|
217
217
|
def asset_style(root)
|
218
218
|
root.xpath("//example | //termexample").each { |e| example_style(e) }
|
219
|
-
root.xpath("//definition/
|
219
|
+
root.xpath("//definition/verbal-definition").each { |e| definition_style(e) }
|
220
220
|
root.xpath("//note").each { |e| note_style(e) }
|
221
221
|
root.xpath("//fn").each { |e| footnote_style(e) }
|
222
222
|
root.xpath(ASSETS_TO_STYLE).each { |e| style(e, extract_text(e)) }
|
@@ -74,29 +74,6 @@ module IsoDoc
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
def insertall_after_here(node, insert, name)
|
78
|
-
node.children.each do |n|
|
79
|
-
next unless n.name == name
|
80
|
-
|
81
|
-
insert.next = n.remove
|
82
|
-
insert = n
|
83
|
-
end
|
84
|
-
insert
|
85
|
-
end
|
86
|
-
|
87
|
-
def termexamples_before_termnotes(node)
|
88
|
-
return unless node.at(ns("./termnote")) && node.at(ns("./termexample"))
|
89
|
-
return unless insert = node.at(ns("./definition"))
|
90
|
-
|
91
|
-
insert = insertall_after_here(node, insert, "termexample")
|
92
|
-
insertall_after_here(node, insert, "termnote")
|
93
|
-
end
|
94
|
-
|
95
|
-
def termdef_parse(node, out)
|
96
|
-
termexamples_before_termnotes(node)
|
97
|
-
super
|
98
|
-
end
|
99
|
-
|
100
77
|
def cleanup(docxml)
|
101
78
|
super
|
102
79
|
table_th_center(docxml)
|
@@ -177,14 +154,20 @@ module IsoDoc
|
|
177
154
|
|
178
155
|
def clause_etc(isoxml, out, num)
|
179
156
|
isoxml.xpath(ns("//sections/clause[not(@type = 'scope')] | "\
|
180
|
-
"//sections/terms | //sections/definitions"))
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
157
|
+
"//sections/terms | //sections/definitions"))
|
158
|
+
.each do |f|
|
159
|
+
clause_etc1(f, out, num)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
def clause_etc1(clause, out, num)
|
164
|
+
out.div **attr_code(
|
165
|
+
id: clause["id"],
|
166
|
+
class: clause.name == "definitions" ? "Symbols" : nil) do |div|
|
167
|
+
num = num + 1
|
168
|
+
clause_name(num, clause&.at(ns("./title")), div, nil)
|
169
|
+
clause.elements.each do |e|
|
170
|
+
parse(e, div) unless %w{title source}.include? e.name
|
188
171
|
end
|
189
172
|
end
|
190
173
|
end
|
@@ -689,7 +689,6 @@ p.Terms, li.Terms, div.Terms {
|
|
689
689
|
mso-fareast-font-family: "SimHei",serif;
|
690
690
|
mso-bidi-font-family: {{headerfont}};
|
691
691
|
mso-ansi-language: EN-GB;
|
692
|
-
font-weight: bold;
|
693
692
|
mso-bidi-font-weight: normal; }
|
694
693
|
|
695
694
|
p.AltTerms, li.AltTerms, div.AltTerms {
|
@@ -658,7 +658,6 @@ p.Terms, li.Terms, div.Terms
|
|
658
658
|
mso-fareast-font-family:"SimHei",serif;
|
659
659
|
mso-bidi-font-family:$headerfont;
|
660
660
|
mso-ansi-language:EN-GB;
|
661
|
-
font-weight:bold;
|
662
661
|
mso-bidi-font-weight:normal;}
|
663
662
|
p.AltTerms, li.AltTerms, div.AltTerms
|
664
663
|
{mso-style-name:"AltTerm\(s\)";
|