metanorma-ogc 1.3.6 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/ogc/boilerplate.xml +6 -6
  3. data/lib/asciidoctor/ogc/converter.rb +91 -36
  4. data/lib/asciidoctor/ogc/front.rb +1 -1
  5. data/lib/asciidoctor/ogc/isodoc.rng +67 -16
  6. data/lib/asciidoctor/ogc/ogc.rng +13 -13
  7. data/lib/asciidoctor/ogc/reqt.rng +15 -4
  8. data/lib/isodoc/ogc/biblio.rb +57 -51
  9. data/lib/isodoc/ogc/i18n-en.yaml +17 -3
  10. data/lib/isodoc/ogc/metadata.rb +1 -1
  11. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +494 -139
  12. data/lib/isodoc/ogc/ogc.best-practice.xsl +494 -139
  13. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +494 -139
  14. data/lib/isodoc/ogc/ogc.community-practice.xsl +494 -139
  15. data/lib/isodoc/ogc/ogc.community-standard.xsl +494 -139
  16. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +494 -139
  17. data/lib/isodoc/ogc/ogc.engineering-report.xsl +494 -139
  18. data/lib/isodoc/ogc/ogc.other.xsl +494 -139
  19. data/lib/isodoc/ogc/ogc.policy.xsl +494 -139
  20. data/lib/isodoc/ogc/ogc.reference-model.xsl +494 -139
  21. data/lib/isodoc/ogc/ogc.release-notes.xsl +494 -139
  22. data/lib/isodoc/ogc/ogc.standard.xsl +494 -139
  23. data/lib/isodoc/ogc/ogc.test-suite.xsl +494 -139
  24. data/lib/isodoc/ogc/ogc.user-guide.xsl +494 -139
  25. data/lib/isodoc/ogc/ogc.white-paper.xsl +451 -100
  26. data/lib/isodoc/ogc/presentation_xml_convert.rb +53 -46
  27. data/lib/isodoc/ogc/reqt.rb +73 -24
  28. data/lib/isodoc/ogc/word_convert.rb +13 -12
  29. data/lib/isodoc/ogc/xref.rb +58 -41
  30. data/lib/metanorma/ogc/processor.rb +2 -1
  31. data/lib/metanorma/ogc/version.rb +1 -1
  32. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad3456994609c7561163566d0be10cf0770f4f3423871dbefcf24657d5e551a7
4
- data.tar.gz: 79a4f0da33d0194fb0684483977dcf75355f0660749d8bc649e710f72e31ae95
3
+ metadata.gz: b06257175ed17babd9928b2e5fecaf8aef1ab4e70ba53d494244813e28180d5b
4
+ data.tar.gz: 7f6d69a86ba6427adeed77e5b47565a4a286278f6931cbf451ee8606fdc0cf5e
5
5
  SHA512:
6
- metadata.gz: 35342c6a703f8a6a3bb910cdceea76ae6500d0423c248b51efd55b5a850f25be5e645c89c8fe09a1f662a817a693dea123074c434afd7bfaadb05dc7d2ad6eb2
7
- data.tar.gz: a7c312698494e453a5f12ac8450d2ebe182a8b708dbaef2352a5eeec9054a3151695cd3a2efce1f7f4d0d3e05a6050278932567d9e7da7c63c28b1ba438efc55
6
+ metadata.gz: 3396cd1cb78a0d014003913d57a4460b38b377b980441a98a1e453f125ea9b10636782ab6eff031e425518863cdcf5ef4c3228561cda5d4d6b0d720310b93fb4
7
+ data.tar.gz: 85705853508542c024f56181bd1ba871b8c869aa4e5b2f3df4689864fa0d7876193f08bb43638260ae5eff5d0eb4d9631892a13bf0a9a934b33af3e94793f1ae
@@ -95,13 +95,13 @@
95
95
  {% if doctype == "Standard" or doctype == "Community Standard" or doctype == "Abstract Specification" %}
96
96
  {% if stage == "Approved" or stage == "Withdrawn" %}
97
97
  <clause>
98
- <title>Warning</title>
98
+ <title>Notice</title>
99
99
  <p>This document is an OGC Member approved international standard. This document is available on a royalty free, non-discriminatory basis. Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.
100
100
  </p>
101
101
  </clause>
102
102
  {% else %}
103
103
  <clause>
104
- <title>Warning for Drafts</title>
104
+ <title>Notice for Drafts</title>
105
105
  <p>This document is not an OGC Standard. This document is distributed for review and comment. This document is subject to change without notice and may not be referred to as an OGC Standard.</p>
106
106
 
107
107
  <p>Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.</p>
@@ -111,7 +111,7 @@
111
111
 
112
112
  {% elsif doctype == "Engineering Report" %}
113
113
  <clause>
114
- <title>Warning</title>
114
+ <title>Notice</title>
115
115
  <p>This document is not an OGC Standard. This document is an OGC Public Engineering Report created as a deliverable in an OGC Interoperability Initiative and is <em>not an official position</em> of the OGC membership. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an OGC Standard.</p>
116
116
 
117
117
  <p>Further, any OGC Engineering Report should not be referenced as required or mandatory technology in procurements. However, the discussions in this document could very well lead to the definition of an OGC Standard.</p>
@@ -120,7 +120,7 @@
120
120
 
121
121
  {% elsif doctype == "Best Practice" %}
122
122
  <clause>
123
- <title>Warning</title>
123
+ <title>Notice</title>
124
124
  <p>This document defines an OGC Best Practice on a particular technology or approach related to an OGC standard. This document is <em>not</em> an OGC Standard and may not be referred to as an OGC Standard. It is subject to change without notice. However, this document is an <em>official</em> position of the OGC membership on this particular technology topic.</p>
125
125
 
126
126
  <p>Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.</p>
@@ -128,7 +128,7 @@
128
128
 
129
129
  {% elsif doctype == "Release Notes" %}
130
130
  <clause>
131
- <title>Warning</title>
131
+ <title>Notice</title>
132
132
  <p>This document is not an OGC standard. This document provides release notes for an OGC standard. This document is subject to change without notice and may not be referred to as an OGC Standard.</p>
133
133
 
134
134
  <p>Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.</p>
@@ -137,7 +137,7 @@
137
137
 
138
138
  {% else %}
139
139
  <clause>
140
- <title>Warning</title>
140
+ <title>Notice</title>
141
141
  <p>This document is not an OGC Standard. This document is an OGC {{ doctype }} and is therefore not an official position of the OGC membership. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an OGC Standard.</p>
142
142
  <p>Further, an OGC {{ doctype }} should not be referenced as required or mandatory technology in procurements.</p>
143
143
  </clause>
@@ -16,8 +16,7 @@ module Asciidoctor
16
16
  register_for "ogc"
17
17
 
18
18
  # ignore, we generate ToC outside of asciidoctor
19
- def toc(value)
20
- end
19
+ def toc(value); end
21
20
 
22
21
  def makexml(node)
23
22
  @draft = node.attributes.has_key?("draft")
@@ -27,11 +26,11 @@ module Asciidoctor
27
26
  def doctype(node)
28
27
  d = super
29
28
  d1 = ::IsoDoc::Ogc::DOCTYPE_ABBR.invert[d] and d = d1
30
- unless %w{abstract-specification-topic best-practice
31
- change-request-supporting-document community-practice
32
- community-standard discussion-paper engineering-report other policy
33
- reference-model release-notes standard user-guide white-paper
34
- test-suite}.include? d
29
+ unless %w{abstract-specification-topic best-practice other policy
30
+ change-request-supporting-document community-practice
31
+ community-standard discussion-paper engineering-report
32
+ reference-model release-notes standard user-guide white-paper
33
+ test-suite}.include? d
35
34
  @warned_doctype or
36
35
  @log.add("Document Attributes", nil,
37
36
  "'#{d}' is not a legal document type: reverting to 'standard'")
@@ -44,69 +43,80 @@ module Asciidoctor
44
43
  def sectiontype_streamline(ret)
45
44
  case ret
46
45
  when "preface" then "foreword"
47
- when "foreword" then "donotrecognise-foreword"
48
- when "introduction" then "donotrecognise-foreword"
46
+ when "foreword", "introduction" then "donotrecognise-foreword"
49
47
  when "references" then "normative references"
48
+ when "glossary" then "terms and definitions"
50
49
  else
51
50
  super
52
51
  end
53
52
  end
54
53
 
55
54
  def outputs(node, ret)
56
- File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
57
- presentation_xml_converter(node).convert(@filename + ".xml")
58
- html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
59
- doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
60
- pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
55
+ File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
56
+ presentation_xml_converter(node).convert("#{@filename}.xml")
57
+ html_converter(node).convert("#{@filename}.presentation.xml", nil,
58
+ false, "#{@filename}.html")
59
+ doc_converter(node).convert("#{@filename}.presentation.xml", nil,
60
+ false, "#{@filename}.doc")
61
+ pdf_converter(node)&.convert("#{@filename}.presentation.xml", nil,
62
+ false, "#{@filename}.pdf")
61
63
  end
62
64
 
63
65
  def validate(doc)
64
66
  content_validate(doc)
65
- schema_validate(formattedstr_strip(doc.dup), File.join(File.dirname(__FILE__), "ogc.rng"))
67
+ schema_validate(formattedstr_strip(doc.dup),
68
+ File.join(File.dirname(__FILE__), "ogc.rng"))
66
69
  end
67
70
 
68
- def sections_cleanup(x)
71
+ def sections_cleanup(xml)
69
72
  super
70
- x.xpath("//*[@inline-header]").each do |h|
73
+ xml.xpath("//*[@inline-header]").each do |h|
71
74
  h.delete("inline-header")
72
75
  end
73
76
  end
74
77
 
75
- def make_preface(x, s)
78
+ def make_preface(xml, sect)
76
79
  super
77
- insert_security(x, s)
78
- insert_submitters(x, s)
80
+ insert_security(xml, sect)
81
+ insert_submitters(xml, sect)
79
82
  end
80
83
 
81
84
  def add_id
82
85
  %(id="_#{UUIDTools::UUID.random_create}")
83
86
  end
84
87
 
85
- def insert_security(x, s)
86
- doctype = s&.at("//bibdata/ext/doctype")&.text
87
- description = %w(standard community-standard).include?(doctype) ? "standard" : "document"
88
- preface = s.at("//preface") || s.add_previous_sibling("<preface/>").first
89
- s = x&.at("//clause[@type = 'security']")&.remove ||
88
+ def insert_security(xml, sect)
89
+ doctype = sect&.at("//bibdata/ext/doctype")&.text
90
+ description = if %w(standard
91
+ community-standard).include?(doctype)
92
+ "standard"
93
+ else
94
+ "document"
95
+ end
96
+ preface = sect.at("//preface") ||
97
+ sect.add_previous_sibling("<preface/>").first
98
+ sect = xml&.at("//clause[@type = 'security']")&.remove ||
90
99
  "<clause type='security' #{add_id}>"\
91
100
  "<title>Security Considerations</title>"\
92
101
  "<p>#{@i18n.security_empty.sub(/%/, description)}</p></clause>"
93
- preface.add_child s
102
+ preface.add_child sect
94
103
  end
95
104
 
96
- def insert_submitters(x, s)
97
- if x.at("//submitters")
98
- preface = s.at("//preface") || s.add_previous_sibling("<preface/>").first
99
- submitters = x.at("//submitters").remove
105
+ def insert_submitters(xml, sect)
106
+ if xml.at("//submitters")
107
+ preface = sect.at("//preface") ||
108
+ sect.add_previous_sibling("<preface/>").first
109
+ submitters = xml.at("//submitters").remove
100
110
  preface.add_child submitters.remove
101
111
  end
102
112
  end
103
113
 
104
114
  def clause_parse(attrs, xml, node)
105
- case clausetype = node&.attr("heading")&.downcase || node.title.downcase
115
+ case node&.attr("heading")&.downcase || node.title.downcase
106
116
  when "submitters" then return submitters_parse(attrs, xml, node)
107
117
  when "conformance" then attrs = attrs.merge(type: "conformance")
108
- when "security considerations" then attrs =
109
- attrs.merge(type: "security")
118
+ when "security considerations" then attrs =
119
+ attrs.merge(type: "security")
110
120
  end
111
121
  super
112
122
  end
@@ -118,11 +128,36 @@ module Asciidoctor
118
128
  end
119
129
  end
120
130
 
121
- def style(n, t)
122
- return
131
+ def style(_node, _text)
132
+ nil
133
+ end
134
+
135
+ def termdef_boilerplate_cleanup(xmldoc); end
136
+
137
+ def term_def_parse(attrs, xml, node, _toplevel)
138
+ if node.attr("style") == "appendix" && node.level == 1
139
+ terms_annex_parse(attrs, xml, node)
140
+ else
141
+ super
142
+ end
143
+ end
144
+
145
+ def table_cell(node, xml_tr, tblsec)
146
+ node.set_attr("valign", "middle")
147
+ super
123
148
  end
124
149
 
125
- def termdef_boilerplate_cleanup(xmldoc)
150
+ def terms_annex_parse(attrs, xml, node)
151
+ attrs1 = attrs.merge(id: "_#{UUIDTools::UUID.random_create}")
152
+ xml.annex **attr_code(attrs1) do |xml_section|
153
+ xml_section.title { |name| name << node.title }
154
+ xml_section.terms **attr_code(attrs) do |terms|
155
+ (s = node.attr("source")) && s.split(",").each do |s1|
156
+ terms.termdocsource(nil, **attr_code(bibitemid: s1))
157
+ end
158
+ terms << node.content
159
+ end
160
+ end
126
161
  end
127
162
 
128
163
  def bibdata_cleanup(xmldoc)
@@ -131,6 +166,25 @@ module Asciidoctor
131
166
  a.text == "published" and a.children = "approved"
132
167
  end
133
168
 
169
+ def section_names_terms_cleanup(xml)
170
+ replace_title(xml, "//definitions[@type = 'symbols']", @i18n&.symbols)
171
+ replace_title(xml, "//definitions[@type = 'abbreviated_terms']",
172
+ @i18n&.abbrev)
173
+ replace_title(xml, "//definitions[not(@type)]", @i18n&.symbolsabbrev)
174
+ replace_title(xml, "//sections//terms#{SYMnoABBR} | //sections//clause[.//terms]#{SYMnoABBR}",
175
+ @i18n&.termsdefsymbols, true)
176
+ replace_title(xml, "//sections//terms#{ABBRnoSYM} | //sections//clause[.//terms]#{ABBRnoSYM}",
177
+ @i18n&.termsdefabbrev, true)
178
+ replace_title(xml, "//sections//terms#{SYMABBR} | //sections//clause[.//terms]#{SYMABBR}",
179
+ @i18n&.termsdefsymbolsabbrev, true)
180
+ replace_title(xml, "//sections//terms#{NO_SYMABBR} | //sections//clause[.//terms]#{NO_SYMABBR}",
181
+ @i18n&.termsdefsymbolsabbrev, true)
182
+ replace_title(
183
+ xml, "//sections//terms[not(.//definitions)] | //sections//clause[.//terms][not(.//definitions)]",
184
+ @i18n&.termsdef, true
185
+ )
186
+ end
187
+
134
188
  def highlight_parse(text, xml)
135
189
  xml.hi { |s| s << text }
136
190
  end
@@ -145,6 +199,7 @@ module Asciidoctor
145
199
 
146
200
  def pdf_converter(node)
147
201
  return nil if node.attr("no-pdf")
202
+
148
203
  IsoDoc::Ogc::PdfConvert.new(html_extract_attributes(node))
149
204
  end
150
205
 
@@ -171,7 +171,7 @@ module Asciidoctor
171
171
  s = "general"
172
172
  end
173
173
  end
174
- s and xml.docsubtype s
174
+ s and xml.subdoctype s
175
175
  end
176
176
 
177
177
  def title(node, xml)
@@ -32,6 +32,18 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="section-title">
36
+ <element name="title">
37
+ <zeroOrMore>
38
+ <ref name="TextElement"/>
39
+ </zeroOrMore>
40
+ </element>
41
+ <zeroOrMore>
42
+ <element name="variant-title">
43
+ <ref name="TypedTitleString"/>
44
+ </element>
45
+ </zeroOrMore>
46
+ </define>
35
47
  <define name="hyperlink">
36
48
  <element name="link">
37
49
  <attribute name="target">
@@ -158,15 +170,17 @@
158
170
  <data type="boolean"/>
159
171
  </attribute>
160
172
  </optional>
161
- <attribute name="type">
162
- <choice>
163
- <value>roman</value>
164
- <value>alphabet</value>
165
- <value>arabic</value>
166
- <value>roman_upper</value>
167
- <value>alphabet_upper</value>
168
- </choice>
169
- </attribute>
173
+ <optional>
174
+ <attribute name="type">
175
+ <choice>
176
+ <value>roman</value>
177
+ <value>alphabet</value>
178
+ <value>arabic</value>
179
+ <value>roman_upper</value>
180
+ <value>alphabet_upper</value>
181
+ </choice>
182
+ </attribute>
183
+ </optional>
170
184
  <oneOrMore>
171
185
  <ref name="li"/>
172
186
  </oneOrMore>
@@ -204,6 +218,18 @@
204
218
  </zeroOrMore>
205
219
  </element>
206
220
  </define>
221
+ <define name="dt">
222
+ <element name="dt">
223
+ <optional>
224
+ <attribute name="id">
225
+ <data type="ID"/>
226
+ </attribute>
227
+ </optional>
228
+ <zeroOrMore>
229
+ <ref name="TextElement"/>
230
+ </zeroOrMore>
231
+ </element>
232
+ </define>
207
233
  <define name="example">
208
234
  <element name="example">
209
235
  <attribute name="id">
@@ -899,7 +925,7 @@
899
925
  </include>
900
926
  <!-- end overrides -->
901
927
  <define name="docsubtype">
902
- <element name="docsubtype">
928
+ <element name="subdoctype">
903
929
  <ref name="DocumentSubtype"/>
904
930
  </element>
905
931
  </define>
@@ -954,6 +980,16 @@
954
980
  </define>
955
981
  <define name="concept">
956
982
  <element name="concept">
983
+ <optional>
984
+ <attribute name="ital">
985
+ <data type="boolean"/>
986
+ </attribute>
987
+ </optional>
988
+ <optional>
989
+ <attribute name="ref">
990
+ <data type="boolean"/>
991
+ </attribute>
992
+ </optional>
957
993
  <optional>
958
994
  <element name="refterm">
959
995
  <zeroOrMore>
@@ -989,8 +1025,14 @@
989
1025
  <ref name="imagemap"/>
990
1026
  <ref name="svgmap"/>
991
1027
  <ref name="inputform"/>
1028
+ <ref name="toc"/>
992
1029
  </choice>
993
1030
  </define>
1031
+ <define name="toc">
1032
+ <element name="toc">
1033
+ <ref name="ul"/>
1034
+ </element>
1035
+ </define>
994
1036
  <define name="inputform">
995
1037
  <element name="form">
996
1038
  <attribute name="id">
@@ -998,6 +1040,9 @@
998
1040
  </attribute>
999
1041
  <attribute name="name"/>
1000
1042
  <attribute name="action"/>
1043
+ <optional>
1044
+ <attribute name="class"/>
1045
+ </optional>
1001
1046
  <zeroOrMore>
1002
1047
  <choice>
1003
1048
  <ref name="TextElement"/>
@@ -1229,6 +1274,12 @@
1229
1274
  <optional>
1230
1275
  <attribute name="type"/>
1231
1276
  </optional>
1277
+ <optional>
1278
+ <attribute name="identifier"/>
1279
+ </optional>
1280
+ <optional>
1281
+ <attribute name="prefix"/>
1282
+ </optional>
1232
1283
  <text/>
1233
1284
  </define>
1234
1285
  <define name="ics">
@@ -1490,26 +1541,26 @@
1490
1541
  <optional>
1491
1542
  <ref name="section-title"/>
1492
1543
  </optional>
1493
- <group>
1544
+ <choice>
1494
1545
  <choice>
1495
1546
  <group>
1496
- <zeroOrMore>
1547
+ <oneOrMore>
1497
1548
  <ref name="BasicBlock"/>
1498
- </zeroOrMore>
1549
+ </oneOrMore>
1499
1550
  <zeroOrMore>
1500
1551
  <ref name="note"/>
1501
1552
  </zeroOrMore>
1502
1553
  </group>
1503
1554
  <ref name="amend"/>
1504
1555
  </choice>
1505
- <zeroOrMore>
1556
+ <oneOrMore>
1506
1557
  <choice>
1507
1558
  <ref name="clause-subsection"/>
1508
1559
  <ref name="terms"/>
1509
1560
  <ref name="definitions"/>
1510
1561
  </choice>
1511
- </zeroOrMore>
1512
- </group>
1562
+ </oneOrMore>
1563
+ </choice>
1513
1564
  </define>
1514
1565
  <define name="Annex-Section">
1515
1566
  <optional>
@@ -62,6 +62,19 @@
62
62
  </optional>
63
63
  </element>
64
64
  </define>
65
+ <define name="DocumentSubtype">
66
+ <choice>
67
+ <value>conceptual-model</value>
68
+ <value>conceptual-model-and-encoding</value>
69
+ <value>conceptual-model-and-implementation</value>
70
+ <value>encoding</value>
71
+ <value>extension</value>
72
+ <value>implementation</value>
73
+ <value>profile</value>
74
+ <value>profile-with-extension</value>
75
+ <value>general</value>
76
+ </choice>
77
+ </define>
65
78
  </include>
66
79
  <define name="TextElement" combine="choice">
67
80
  <ref name="hi"/>
@@ -79,19 +92,6 @@
79
92
  </zeroOrMore>
80
93
  </element>
81
94
  </define>
82
- <define name="DocumentSubtype">
83
- <choice>
84
- <value>conceptual-model</value>
85
- <value>conceptual-model-and-encoding</value>
86
- <value>conceptual-model-and-implementation</value>
87
- <value>encoding</value>
88
- <value>extension</value>
89
- <value>implementation</value>
90
- <value>profile</value>
91
- <value>profile-with-extension</value>
92
- <value>general</value>
93
- </choice>
94
- </define>
95
95
  <define name="submitters">
96
96
  <element name="submitters">
97
97
  <ref name="Basic-Section"/>