metanorma-iso 1.10.2 → 1.10.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -33
  3. data/.github/workflows/ubuntu.yml +1 -1
  4. data/Gemfile +1 -1
  5. data/lib/asciidoctor/iso/base.rb +1 -1
  6. data/lib/asciidoctor/iso/basicdoc.rng +1 -11
  7. data/lib/asciidoctor/iso/biblio.rng +0 -2
  8. data/lib/asciidoctor/iso/front.rb +17 -4
  9. data/lib/asciidoctor/iso/front_id.rb +20 -17
  10. data/lib/asciidoctor/iso/isodoc.rng +61 -19
  11. data/lib/asciidoctor/iso/isostandard-amd.rng +1 -1
  12. data/lib/asciidoctor/iso/isostandard.rng +15 -3
  13. data/lib/asciidoctor/iso/reqt.rng +1 -1
  14. data/lib/asciidoctor/iso/section.rb +1 -1
  15. data/lib/asciidoctor/iso/validate.rb +1 -1
  16. data/lib/asciidoctor/iso/validate_image.rb +1 -1
  17. data/lib/asciidoctor/iso/validate_section.rb +1 -1
  18. data/lib/isodoc/iso/base_convert.rb +14 -31
  19. data/lib/isodoc/iso/html/isodoc.scss +0 -1
  20. data/lib/isodoc/iso/html/style-human.scss +36 -9
  21. data/lib/isodoc/iso/html/style-iso.scss +31 -6
  22. data/lib/isodoc/iso/html/wordstyle.scss +10 -8
  23. data/lib/isodoc/iso/html_convert.rb +81 -22
  24. data/lib/isodoc/iso/index.rb +53 -45
  25. data/lib/isodoc/iso/iso.amendment.xsl +406 -122
  26. data/lib/isodoc/iso/iso.international-standard.xsl +406 -122
  27. data/lib/isodoc/iso/isosts_convert.rb +6 -2
  28. data/lib/isodoc/iso/metadata.rb +27 -22
  29. data/lib/isodoc/iso/presentation_xml_convert.rb +60 -25
  30. data/lib/isodoc/iso/sts_convert.rb +3 -2
  31. data/lib/isodoc/iso/word_convert.rb +0 -2
  32. data/lib/metanorma/iso/processor.rb +2 -2
  33. data/lib/metanorma/iso/version.rb +1 -1
  34. data/metanorma-iso.gemspec +3 -3
  35. data/spec/asciidoctor/base_spec.rb +398 -546
  36. data/spec/asciidoctor/blocks_spec.rb +4 -4
  37. data/spec/asciidoctor/cleanup_spec.rb +15 -12
  38. data/spec/asciidoctor/refs_spec.rb +87 -84
  39. data/spec/isodoc/amd_spec.rb +261 -250
  40. data/spec/isodoc/i18n_spec.rb +7 -7
  41. data/spec/isodoc/inline_spec.rb +242 -216
  42. data/spec/isodoc/iso_spec.rb +3 -1
  43. data/spec/isodoc/postproc_spec.rb +111 -28
  44. data/spec/isodoc/section_spec.rb +4 -4
  45. data/spec/isodoc/terms_spec.rb +34 -41
  46. data/spec/isodoc/xref_spec.rb +3 -3
  47. data/spec/metanorma/processor_spec.rb +110 -14
  48. data/spec/vcr_cassettes/docrels.yml +37 -427
  49. metadata +11 -16
  50. data/lib/isodoc/iso/html/htmlstyle.css +0 -47
  51. data/lib/isodoc/iso/html/isodoc.css +0 -1328
  52. data/lib/isodoc/iso/html/style-human.css +0 -979
  53. data/lib/isodoc/iso/html/style-iso.css +0 -1007
  54. data/lib/isodoc/iso/html/wordstyle.css +0 -1699
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 697a2f88d09f6183604f8ead7682575df682e59c09c211b3482404bbb5b7c5bf
4
- data.tar.gz: 452e1127517360903e4406ab81d443903f2490350b4a1df7b2dd114221c454a1
3
+ metadata.gz: 21ca1b89516933df5070519917f8092fc8707f121360d004676a5b9c6c560c08
4
+ data.tar.gz: c840ab50752e09f94da711cd9d92d4e232704718de10fdfab8cfbf86c428e21c
5
5
  SHA512:
6
- metadata.gz: '09ac021eb3cd2c87f722f3b4c2033e0c5188f814609ff389018b7f65026a61f4f9c51f15650904b742a540a0c719f7742afedab5d0b89770c6913f02d38dfa44'
7
- data.tar.gz: d04e4234d13815cdb41168a18887610a2700611519cf3c9748cc492181ce28bafbfc95cfc094ca478d5dac461487992b822ebcec50bf385f9a998a28003fe34e
6
+ metadata.gz: 1b715123158dead59a52c186fe318a5d98d05c61dfd04dd793b9a6355e3a7f0718e055b3113259af22bdeabc5d8b5ca3683d76b803afb7249ef82e8e625e64ed
7
+ data.tar.gz: 129d8e858ec89afe0df4b006236caa309aefe8e046f22fc761482b9efbb22b009590189ed82c565828eafef9c806812bacf3489c7e4cb3674f3f280ac6d94a29
@@ -1,5 +1,3 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
1
  name: rake
4
2
 
5
3
  on:
@@ -10,34 +8,6 @@ on:
10
8
 
11
9
  jobs:
12
10
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
- steps:
23
- - uses: actions/checkout@master
24
-
25
- - uses: ruby/setup-ruby@v1
26
- with:
27
- ruby-version: ${{ matrix.ruby }}
28
- bundler-cache: true
29
-
30
- - uses: metanorma/metanorma-build-scripts/plantuml-setup-action@master
31
-
32
- - run: bundle exec rake
33
-
34
- tests-passed:
35
- needs: rake
36
- runs-on: ubuntu-latest
37
- steps:
38
- - uses: peter-evans/repository-dispatch@v1
39
- with:
40
- token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
41
- repository: ${{ github.repository }}
42
- event-type: tests-passed
43
- client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
11
+ uses: metanorma/metanorma-build-scripts/.github/workflows/plantuml-rake.yml@main
12
+ secrets:
13
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -36,6 +36,6 @@ jobs:
36
36
 
37
37
  - uses: actions/download-artifact@master
38
38
  with:
39
- name: xsd_doc-ubuntu
39
+ name: xsd_doc
40
40
  path: xsd_doc
41
41
 
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
- # gem "asciimath", git: "https://github.com/asciidoctor/asciimath"
7
+ gem "relaton", git: "https://github.com/relaton/relaton"
8
8
 
9
9
  gemspec
10
10
 
@@ -28,7 +28,7 @@ module Asciidoctor
28
28
  def pdf_converter(node)
29
29
  return nil if node.attr("no-pdf")
30
30
 
31
- IsoDoc::Iso::PdfConvert.new(doc_extract_attributes(node))
31
+ IsoDoc::Iso::PdfConvert.new(pdf_extract_attributes(node))
32
32
  end
33
33
 
34
34
  def sts_converter(node)
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
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 metadata_doctype(node, xml)
22
- xml.doctype doctype(node)
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("amends" => "updates")
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, doctype, iteration = nil)
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 = if bare
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
- ret = "#{ret} " unless %w(D FD).include?(ret)
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="updatetype">
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="geographicArea"/>
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
- <ref name="PureTextElement"/>
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="abbreviationType">
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="grammarInfo">
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="grammarvalue">
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="verbaldefinition">
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="nonverbalrepresentation">
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" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
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" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
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" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
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" { }
@@ -1,5 +1,5 @@
1
1
  require "htmlentities"
2
- require "uri"
2
+ require "uri" if /^2\./.match?(RUBY_VERSION)
3
3
 
4
4
  module Asciidoctor
5
5
  module ISO
@@ -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/verbaldefinition") || return
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")
@@ -31,7 +31,7 @@ module Asciidoctor
31
31
  when "ru" then "_r"
32
32
  when "es" then "_s"
33
33
  when "ar" then "_a"
34
- when "en" then "_e"
34
+ # when "en" then "_e"
35
35
  else
36
36
  "_e"
37
37
  end
@@ -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/verbaldefinition").each { |e| definition_style(e) }
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")).each do |f|
181
- out.div **attr_code(id: f["id"],
182
- class: f.name == "definitions" ? "Symbols" : nil) do |div|
183
- num = num + 1
184
- clause_name(num, f&.at(ns("./title")), div, nil)
185
- f.elements.each do |e|
186
- parse(e, div) unless %w{title source}.include? e.name
187
- end
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
@@ -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\)";