metanorma-ogc 2.3.13 → 2.4.0

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/isodoc/ogc/base_convert.rb +9 -18
  3. data/lib/isodoc/ogc/html/htmlstyle.css +9 -5
  4. data/lib/isodoc/ogc/html/htmlstyle.scss +2 -2
  5. data/lib/isodoc/ogc/html_convert.rb +2 -11
  6. data/lib/isodoc/ogc/i18n-en.yaml +11 -0
  7. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +121 -61
  8. data/lib/isodoc/ogc/ogc.best-practice.xsl +121 -61
  9. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +121 -61
  10. data/lib/isodoc/ogc/ogc.community-practice.xsl +121 -61
  11. data/lib/isodoc/ogc/ogc.community-standard.xsl +121 -61
  12. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +121 -61
  13. data/lib/isodoc/ogc/ogc.draft-standard.xsl +121 -61
  14. data/lib/isodoc/ogc/ogc.engineering-report.xsl +121 -61
  15. data/lib/isodoc/ogc/ogc.other.xsl +121 -61
  16. data/lib/isodoc/ogc/ogc.policy.xsl +121 -61
  17. data/lib/isodoc/ogc/ogc.reference-model.xsl +121 -61
  18. data/lib/isodoc/ogc/ogc.release-notes.xsl +121 -61
  19. data/lib/isodoc/ogc/ogc.standard.xsl +121 -61
  20. data/lib/isodoc/ogc/ogc.test-suite.xsl +121 -61
  21. data/lib/isodoc/ogc/ogc.user-guide.xsl +121 -61
  22. data/lib/isodoc/ogc/ogc.white-paper.xsl +84 -57
  23. data/lib/isodoc/ogc/presentation_xml_convert.rb +25 -18
  24. data/lib/isodoc/ogc/sections.rb +4 -27
  25. data/lib/isodoc/ogc/word_convert.rb +3 -22
  26. data/lib/isodoc/ogc/xref.rb +17 -6
  27. data/lib/metanorma/ogc/boilerplate.adoc +2 -2
  28. data/lib/metanorma/ogc/converter.rb +6 -2
  29. data/lib/metanorma/ogc/isodoc.rng +26 -4
  30. data/lib/metanorma/ogc/version.rb +1 -1
  31. data/metanorma-ogc.gemspec +1 -1
  32. metadata +4 -4
@@ -10,6 +10,8 @@ module IsoDoc
10
10
  super
11
11
  end
12
12
 
13
+ def middle_title(docxml); end
14
+
13
15
  def convert1(docxml, filename, dir)
14
16
  info docxml, nil
15
17
  super
@@ -62,8 +64,7 @@ module IsoDoc
62
64
  def insert_submitting_orgs(docxml)
63
65
  orgs = docxml.xpath(ns(submittingorgs_path))
64
66
  .each_with_object([]) { |org, m| m << org.text }
65
- return if orgs.empty?
66
-
67
+ orgs.empty? and return
67
68
  if a = submit_orgs_append_pt(docxml)
68
69
  a.next = submitting_orgs_clause(orgs)
69
70
  else
@@ -76,8 +77,7 @@ module IsoDoc
76
77
  <<~SUBMITTING
77
78
  <clause id="_#{UUIDTools::UUID.random_create}" type="submitting_orgs">
78
79
  <title>Submitting Organizations</title>
79
- <p>The following organizations submitted this Document to the
80
- Open Geospatial Consortium (OGC):</p>
80
+ <p>The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</p>
81
81
  <ul>#{orgs.map { |m| "<li>#{m}</li>" }.join("\n")}</ul>
82
82
  </clause>
83
83
  SUBMITTING
@@ -87,8 +87,7 @@ module IsoDoc
87
87
  <<~KEYWORDS
88
88
  <clause id="_#{UUIDTools::UUID.random_create}" type="keywords">
89
89
  <title>Keywords</title>
90
- <p>The following are keywords to be used by search engines and
91
- document catalogues.</p>
90
+ <p>The following are keywords to be used by search engines and document catalogues.</p>
92
91
  <p>#{kwords.join(', ')}</p></clause>
93
92
  KEYWORDS
94
93
  end
@@ -123,9 +122,7 @@ module IsoDoc
123
122
  super
124
123
  docxml.xpath(ns("//foreword | //preface/abstract | " \
125
124
  "//submitters | //introduction | //acknowledgements"))
126
- .each do |f|
127
- clause1(f)
128
- end
125
+ .each { |f| clause1(f) }
129
126
  end
130
127
 
131
128
  def clause1(elem)
@@ -159,16 +156,14 @@ module IsoDoc
159
156
  end
160
157
 
161
158
  def rename_doctype(doctype, date)
162
- return unless doctype&.text == "white-paper" && date
163
-
159
+ (doctype&.text == "white-paper" && date) or return
164
160
  Date.iso8601(date.text) >= Date.iso8601("2021-12-16") and
165
161
  doctype.children = "technical-paper"
166
162
  end
167
163
 
168
164
  def ol_depth(node)
169
- return super unless node["class"] == "steps" ||
170
- node.at(".//ancestor::xmlns:ol[@class = 'steps']")
171
-
165
+ node["class"] == "steps" ||
166
+ node.at(".//ancestor::xmlns:ol[@class = 'steps']") or return super
172
167
  idx = node.xpath("./ancestor-or-self::xmlns:ol[@class = 'steps']").size
173
168
  %i(arabic alphabet roman alphabet_upper roman_upper)[(idx - 1) % 5]
174
169
  end
@@ -200,21 +195,33 @@ module IsoDoc
200
195
  xml.children = "#{f}#{xml.xpath(ns(keep)).to_xml}"
201
196
  end
202
197
 
198
+ SECT_TERMS = "//sections/terms | //sections/clause[descendant::terms]"
199
+ .freeze
200
+
203
201
  def display_order(docxml)
204
202
  i = 0
205
203
  i = display_order_xpath(docxml, "//preface/*", i)
206
204
  i = display_order_at(docxml, "//clause[@type = 'scope']", i)
207
205
  i = display_order_at(docxml, "//clause[@type = 'conformance']", i)
208
206
  i = display_order_at(docxml, @xrefs.klass.norm_ref_xpath, i)
209
- i = display_order_at(docxml, "//sections/terms | " \
210
- "//sections/clause[descendant::terms]", i)
211
- i = display_order_at(docxml, "//sections/definitions", i)
212
- i = display_order_xpath(docxml, @xrefs.klass.middle_clause(docxml), i)
207
+ i = display_order_clauses(docxml, i)
213
208
  i = display_order_xpath(docxml, "//annex", i)
214
209
  i = display_order_xpath(docxml, @xrefs.klass.bibliography_xpath, i)
215
210
  display_order_xpath(docxml, "//indexsect", i)
216
211
  end
217
212
 
213
+ def display_order_clauses(docxml, idx)
214
+ if docxml.at(ns("//bibdata/ext/doctype"))&.text == "engineering-report"
215
+ xpath = "#{SECT_TERMS} | //sections/definitions | " +
216
+ @xrefs.klass.middle_clause(docxml)
217
+ return display_order_xpath(docxml, xpath, idx)
218
+ end
219
+ idx = display_order_at(docxml, SECT_TERMS, idx)
220
+ idx = display_order_at(docxml, "//sections/definitions", idx)
221
+ display_order_xpath(docxml, @xrefs.klass.middle_clause(docxml),
222
+ idx)
223
+ end
224
+
218
225
  def norm_ref_entry_code(_ordinal, _idents, _ids, _standard, _datefn, _bib)
219
226
  ""
220
227
  end
@@ -1,21 +1,10 @@
1
1
  module IsoDoc
2
2
  module Ogc
3
3
  module BaseConvert
4
- def front(isoxml, out)
5
- p = isoxml.at(ns("//preface")) or return
6
- p.elements.each do |e|
7
- if is_clause?(e.name)
8
- case e.name
9
- when "abstract" then abstract e, out
10
- when "foreword" then foreword e, out
11
- when "introduction" then introduction e, out
12
- when "submitters" then intro_clause e, out
13
- when "clause" then preface e, out
14
- when "acknowledgements" then acknowledgements e, out
15
- end
16
- else
17
- preface_block(e, out)
18
- end
4
+ def top_element_render(node, out)
5
+ case node.name
6
+ when "submitters" then intro_clause node, out
7
+ else super
19
8
  end
20
9
  end
21
10
 
@@ -23,9 +12,6 @@ module IsoDoc
23
12
  case clause["type"]
24
13
  when "toc"
25
14
  table_of_contents(clause, out)
26
- when "executivesummary", "security", "submitting_orgs",
27
- "keywords"
28
- intro_clause(clause, out)
29
15
  else
30
16
  intro_clause(clause, out)
31
17
  end
@@ -66,15 +52,6 @@ module IsoDoc
66
52
  def acknowledgements(clause, out)
67
53
  intro_clause(clause, out)
68
54
  end
69
-
70
- def conformance(isoxml, out, num)
71
- f = isoxml.at(ns("//clause[@type = 'conformance']")) or return num
72
- out.div **attr_code(id: f["id"]) do |div|
73
- clause_name(f, f&.at(ns("./title")), div, nil)
74
- f.elements.each { |e| parse(e, div) unless e.name == "title" }
75
- end
76
- num
77
- end
78
55
  end
79
56
  end
80
57
  end
@@ -87,27 +87,8 @@ module IsoDoc
87
87
  end
88
88
 
89
89
  def make_body2(body, docxml)
90
- body.div **{ class: "WordSection2" } do |div2|
91
- @prefacenum = 0
92
- info docxml, div2
93
- boilerplate docxml, div2
94
- front docxml, div2
95
- =begin
96
- preface_block docxml, div2
97
- abstract docxml, div2
98
- executivesummary docxml, div2
99
- keywords docxml, div2
100
- foreword docxml, div2
101
- introduction docxml, div2
102
- security docxml, div2
103
- submittingorgs docxml, div2
104
- submitters docxml, div2
105
- preface docxml, div2
106
- acknowledgements docxml, div2
107
- =end
108
- div2.p { |p| p << "&#xA0;" } # placeholder
109
- end
110
- section_break(body)
90
+ @prefacenum = 0
91
+ super
111
92
  end
112
93
 
113
94
  def word_cleanup(docxml)
@@ -160,7 +141,7 @@ module IsoDoc
160
141
 
161
142
  def toWord(result, filename, dir, header)
162
143
  result = from_xhtml(word_cleanup(to_xhtml(result)))
163
- .gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
144
+ .gsub("-DOUBLE_HYPHEN_ESCAPE-", "--")
164
145
  @wordstylesheet = wordstylesheet_update
165
146
  Html2Doc.new(
166
147
  filename: filename, imagedir: @localdir,
@@ -11,12 +11,23 @@ module IsoDoc
11
11
  n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
12
12
  n = section_names(doc.at(ns("//clause[@type = 'conformance']")), n, 1)
13
13
  n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
14
- n = section_names(
15
- doc.at(ns("//sections/terms | //sections/clause[descendant::terms]")),
16
- n, 1
17
- )
18
- n = section_names(doc.at(ns("//sections/definitions")), n, 1)
19
- clause_names(doc, n)
14
+ initial_anchor_names_middle(doc, n,
15
+ doc.at(ns("//bibdata/ext/doctype"))&.text)
16
+ end
17
+ end
18
+
19
+ TERMS_SECT = "//sections/terms | //sections/clause[descendant::terms]"
20
+ .freeze
21
+
22
+ def initial_anchor_names_middle(doc, num, doctype)
23
+ if doctype == "engineering-report"
24
+ doc.xpath(ns(@klass.middle_clause(doc)) +
25
+ " | #{ns(TERMS_SECT)} | " + ns("//sections/definitions"))
26
+ .each_with_index { |c, _i| section_names(c, num, 1) }
27
+ else
28
+ num = section_names(doc.at(ns(TERMS_SECT)), num, 1)
29
+ num = section_names(doc.at(ns("//sections/definitions")), num, 1)
30
+ clause_names(doc, num)
20
31
  end
21
32
  end
22
33
 
@@ -16,7 +16,7 @@ Recipients of this document are requested to submit, with their comments, notifi
16
16
  == license-statement
17
17
  === License Agreement
18
18
 
19
- >Use of this document is subject to the license agreement at https://www.ogc.org/license[]
19
+ Use of this document is subject to the license agreement at https://www.ogc.org/license[]
20
20
 
21
21
  == legal-statement
22
22
  {% if doctype == "Standard" or doctype == "Community Standard" or doctype == "Abstract Specification" %}
@@ -35,7 +35,7 @@ Recipients of this document are invited to submit, with their comments, notifica
35
35
 
36
36
  {% elsif doctype == "Engineering Report" %}
37
37
  === Notice
38
- 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.
38
+ 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 _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.
39
39
 
40
40
  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.
41
41
 
@@ -88,7 +88,8 @@ module Metanorma
88
88
 
89
89
  def clause_parse(attrs, xml, node)
90
90
  case node.attr("heading")&.downcase || node.title.downcase
91
- when "submitters" then return submitters_parse(attrs, xml, node)
91
+ when "submitters", "contributors"
92
+ return submitters_parse(attrs, xml, node)
92
93
  when "conformance" then attrs = attrs.merge(type: "conformance")
93
94
  when "security considerations"
94
95
  attrs = attrs.merge(type: "security")
@@ -99,8 +100,11 @@ module Metanorma
99
100
  end
100
101
 
101
102
  def submitters_parse(attrs, xml, node)
103
+ title = @i18n.submitters
104
+ doctype(node) == "engineering-report" and
105
+ title = @i18n.contributors_clause
102
106
  xml.submitters **attr_code(attrs) do |xml_section|
103
- xml_section.title @i18n.submitters
107
+ xml_section.title title
104
108
  xml_section << node.content
105
109
  end
106
110
  end
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.2 -->
20
+ <!-- VERSION v1.2.3 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -192,9 +192,11 @@
192
192
  </attribute>
193
193
  </optional>
194
194
  <attribute name="citeas"/>
195
- <attribute name="type">
196
- <ref name="ReferenceFormat"/>
197
- </attribute>
195
+ <optional>
196
+ <attribute name="type">
197
+ <ref name="ReferenceFormat"/>
198
+ </attribute>
199
+ </optional>
198
200
  <optional>
199
201
  <attribute name="alt"/>
200
202
  </optional>
@@ -836,6 +838,26 @@
836
838
  <ref name="paragraph"/>
837
839
  </element>
838
840
  </define>
841
+ <define name="stem">
842
+ <element name="stem">
843
+ <attribute name="type">
844
+ <choice>
845
+ <value>MathML</value>
846
+ <value>AsciiMath</value>
847
+ <value>LatexMath</value>
848
+ </choice>
849
+ </attribute>
850
+ <attribute name="block">
851
+ <data type="boolean"/>
852
+ </attribute>
853
+ <oneOrMore>
854
+ <choice>
855
+ <text/>
856
+ <ref name="AnyElement"/>
857
+ </choice>
858
+ </oneOrMore>
859
+ </element>
860
+ </define>
839
861
  <define name="em">
840
862
  <element name="em">
841
863
  <zeroOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.3.13".freeze
3
+ VERSION = "2.4.0".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "iso-639"
29
- spec.add_dependency "metanorma-standoc", "~> 2.4.2"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.5.0"
30
30
 
31
31
  spec.add_development_dependency "debug"
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.13
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-07 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.4.2
33
+ version: 2.5.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.4.2
40
+ version: 2.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement