metanorma-ogc 1.0.1 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cee080dfddf34ac247b0913a4bdfa0a1a399c45cdb13821a3e0135ca20967c8
4
- data.tar.gz: 9ba37a51168b6a5445f04da1f189ff3a560240fcadae5c688ed59baa291adbfb
3
+ metadata.gz: 4584b19640ae392d32331f799e97e13e6716ac96fe509b7ccf1c0c533778982d
4
+ data.tar.gz: 7db35d1b9b76cbc831f30acd5abf1b0a474819625898c2089fbb1e8083401872
5
5
  SHA512:
6
- metadata.gz: 1f03966af60358ff2e2d4c20f64e508f1605ab6995f75c923bae735a151ede61b55cc1a1a5c80cb9f07c9ff6fe67cbe88c566f824360724221ccb40e47271097
7
- data.tar.gz: 3a71ba1576a89618248131d4266d09c7e86db3946e69f1ad260f9e3b3c5091f9505fda2a5a5e3cd5eeb3943c2ac717516ebd08d68dfead2571fe65a49d8115fc
6
+ metadata.gz: 0131aa4d4e433d368d47f431b5d6c45cf798a1340b3eb2083ceb1b5a51739570225832d9303f11b134a4fe721f6bdf3332b9d92b45cc2f50430c8d610a2348a9
7
+ data.tar.gz: bc237907bc224453c0d6dee4ce0beaa28e3611dec7bde17eeedd43279f179489558b43cd5f35091b2e84d9353f559239ae1ef130b2e86ca726530e2e2eeb20fc
@@ -44,6 +44,7 @@ module Asciidoctor
44
44
  case ret
45
45
  when "preface" then "foreword"
46
46
  when "foreword" then "donotrecognise-foreword"
47
+ when "introduction" then "donotrecognise-foreword"
47
48
  else
48
49
  super
49
50
  end
@@ -4,12 +4,7 @@ require "fileutils"
4
4
 
5
5
  module Asciidoctor
6
6
  module Ogc
7
-
8
- # A {Converter} implementation that generates RSD output, and a document
9
- # schema encapsulation of the document for validation
10
- #
11
7
  class Converter < Standoc::Converter
12
-
13
8
  def metadata_author(node, xml)
14
9
  corporate_author(node, xml)
15
10
  personal_author(node, xml)
@@ -17,7 +12,8 @@ module Asciidoctor
17
12
 
18
13
  def corporate_author(node, xml)
19
14
  return unless node.attr("submitting-organizations")
20
- node.attr("submitting-organizations").split(/;[ ]*/).each do |org|
15
+ HTMLEntities.new.decode(node.attr("submitting-organizations")).
16
+ split(/;[ ]*/).each do |org|
21
17
  xml.contributor do |c|
22
18
  c.role **{ type: "author" }
23
19
  c.organization do |a|
@@ -91,9 +87,18 @@ module Asciidoctor
91
87
  end
92
88
  end
93
89
 
90
+ def externalid(node)
91
+ return node.attr("external-id") if node.attr("external-id")
92
+ d = doctype(node)
93
+ a = node.attr("abbrev")
94
+ return unless d and a
95
+ url = "http://www.opengis.net/doc/#{IsoDoc::Ogc::DOCTYPE_ABBR[d]}/#{a}"
96
+ v = node.attr("edition") and url += "/#{v}"
97
+ url
98
+ end
99
+
94
100
  def metadata_id(node, xml)
95
- node.attr("external-id") and
96
- xml.docidentifier node.attr("external-id"), **{ type: "ogc-external" }
101
+ e = externalid(node) and xml.docidentifier e, **{ type: "ogc-external" }
97
102
  node.attr("referenceurlid") and
98
103
  xml.docidentifier externalurl(node), **{ type: "ogc-external" }
99
104
  docnumber = node.attr("docnumber") || node.attr("docreference")
@@ -168,6 +173,13 @@ module Asciidoctor
168
173
  s and xml.docsubtype s
169
174
  end
170
175
 
176
+ def title(node, xml)
177
+ super
178
+ at = { format: "text/plain", type: "abbrev" }
179
+ a = node.attr("abbrev") and
180
+ xml.title a, **attr_code(at)
181
+ end
182
+
171
183
  def metadata_ext(node, xml)
172
184
  metadata_doctype(node, xml)
173
185
  metadata_subdoctype(node, xml)
@@ -12,6 +12,7 @@ module Asciidoctor
12
12
 
13
13
  def bibdata_validate(doc)
14
14
  stage_validate(doc)
15
+ version_validate(doc)
15
16
  end
16
17
 
17
18
  def stage_validate(xmldoc)
@@ -21,6 +22,16 @@ module Asciidoctor
21
22
  warn "Document Attributes: #{stage} is not a recognised status"
22
23
  end
23
24
 
25
+ def version_validate(xmldoc)
26
+ version = xmldoc&.at("//bibdata/edition")&.text
27
+ doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
28
+ if %w(engineering-report discussion-paper).include? doctype
29
+ warn "Version not permitted for #{doctype}" unless version.nil?
30
+ else
31
+ warn "Version required for #{doctype}" if version.nil?
32
+ end
33
+ end
34
+
24
35
  def section_validate(doc)
25
36
  preface_sequence_validate(doc.root)
26
37
  sections_sequence_validate(doc.root)
@@ -128,12 +128,13 @@ module IsoDoc
128
128
  def preface_names_numbered(clause)
129
129
  return if clause.nil?
130
130
  @prefacenum += 1
131
+ pref = RomanNumerals.to_roman(@prefacenum).downcase
131
132
  @anchors[clause["id"]] =
132
- { label: RomanNumerals.to_roman(@prefacenum).downcase,
133
+ { label: pref,
133
134
  level: 1, xref: preface_clause_name(clause), type: "clause" }
134
135
  clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
135
136
  "./references")).each_with_index do |c, i|
136
- section_names1(c, "#{@prefacenum}.#{i + 1}", 2)
137
+ section_names1(c, "#{pref}.#{i + 1}", 2)
137
138
  end
138
139
  end
139
140
 
@@ -66,15 +66,15 @@ normal'><span lang=EN-GB><span style='mso-special-character:footnote-continuatio
66
66
  <div style='mso-element:header' id=eh1>
67
67
 
68
68
  <p class=MsoHeader align=left style='text-align:left;line-height:12.0pt;
69
- mso-line-height-rule:exactly'><span lang=EN-GB>CS&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
69
+ mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}</span></p>
70
70
 
71
71
  </div>
72
72
 
73
73
  <div style='mso-element:header' id=h1>
74
74
 
75
75
  <p class=MsoHeader style='margin-bottom:18.0pt'><span lang=EN-GB
76
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt;font-weight:normal'
77
- Open Geospatial Consortium&nbsp;{{ docyear }}&nbsp;– All rights reserved</span><span lang=EN-GB
76
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt;font-weight:normal'>
77
+ Open Geospatial Consortium&nbsp;{{ docnumber }}</span><span lang=EN-GB
78
78
  style='font-weight:normal'><o:p></o:p></span></p>
79
79
 
80
80
  </div>
@@ -92,28 +92,28 @@ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>2</span></span></b><!-
92
92
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
93
93
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
94
94
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
95
- style='mso-tab-count:1'>                                                                                                                                                                           </span>© {{ docyear }} OGC<o:p></o:p></span></p>
95
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>© Open Geospatial Consortium&nbsp;{{ docyear }} – All rights reserved<o:p></o:p></span></p>
96
96
 
97
97
  </div>
98
98
 
99
99
  <div style='mso-element:header' id=eh2>
100
100
  <p class=MsoHeader align=left style='text-align:left;line-height:12.0pt;
101
- mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
101
+ mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}</span></p>
102
102
  </div>
103
103
 
104
104
  <div style='mso-element:header' id=eh2l>
105
105
  <p class=MsoHeaderLandscape align=left style='text-align:left;line-height:12.0pt;
106
- mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
106
+ mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}</span></p>
107
107
  </div>
108
108
 
109
109
  <div style='mso-element:header' id=h2>
110
110
  <p class=MsoHeader align=right style='text-align:right;line-height:12.0pt;
111
- mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
111
+ mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}</span></p>
112
112
  </div>
113
113
 
114
114
  <div style='mso-element:header' id=h2l>
115
115
  <p class=MsoHeaderLandscape align=right style='text-align:right;line-height:12.0pt;
116
- mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
116
+ mso-line-height-rule:exactly'><span lang=EN-GB>Open Geospatial Consortium&nbsp;{{ docnumber }}</span></p>
117
117
  </div>
118
118
 
119
119
  <div style='mso-element:footer' id=ef2>
@@ -127,7 +127,8 @@ style='mso-no-proof:yes'>ii</span></span><!--[if supportFields]><span
127
127
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
128
128
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
129
129
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
130
- style='mso-tab-count:1'>                                                                                                                                                                           </span>© {{ docyear }} OGC<o:p></o:p></span></p>
130
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>© Open Geospatial Consortium&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
131
+
131
132
  </div>
132
133
 
133
134
  <div style='mso-element:footer' id=ef2l>
@@ -141,7 +142,8 @@ style='mso-no-proof:yes'>ii</span></span><!--[if supportFields]><span
141
142
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
142
143
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
143
144
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
144
- style='mso-tab-count:1'>                                                                                                                                                                           </span>© {{ docyear }} OGC<o:p></o:p></span></p>
145
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>© Open Geospatial Consortium&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
146
+
145
147
  </div>
146
148
 
147
149
  <div style='mso-element:footer' id=f2>
@@ -184,7 +186,8 @@ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>2</span></span></b><!-
184
186
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
185
187
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
186
188
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
187
- style='mso-tab-count:1'>                                                                                                                                                                           </span>© {{ docyear }} OGC<o:p></o:p></span></p>
189
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>© Open Geospatial Consortium&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
190
+
188
191
  </div>
189
192
 
190
193
  <div style='mso-element:footer' id=ef3l>
@@ -199,7 +202,8 @@ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>2</span></span></b><!-
199
202
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
200
203
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
201
204
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
202
- style='mso-tab-count:1'>                                                                                                                                                                           </span>© {{ docyear }} OGC<o:p></o:p></span></p>
205
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>© Open Geospatial Consortium&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
206
+
203
207
  </div>
204
208
 
205
209
  <div style='mso-element:footer' id=f3>
@@ -105,10 +105,11 @@
105
105
  <div class="info-section">
106
106
  <div class="copyright">
107
107
  <div id="boilerplate-copyright-destination"/>
108
-
108
+ {% if doctype == "Standard" or doctype == "Community Standard" %}
109
109
  <div class="contact-info">
110
110
  <div id="boilerplate-contact-destination"/>
111
111
  </div>
112
+ {% endif %}
112
113
  </div>
113
114
 
114
115
  <div class="rule"></div>
@@ -258,16 +258,9 @@ span.keyword {
258
258
  /* Tables */
259
259
 
260
260
  table {
261
- @include table($border: none !important);
262
-
263
- color: #010d16;
261
+ @include table($border: 1px solid black);
264
262
 
265
- tr:nth-child(even) {
266
- background: #f1f8ff
267
- }
268
- tr:nth-child(odd) {
269
- background: #cfe6fd
270
- }
263
+ /*color: #010d16;*/
271
264
 
272
265
  thead tr th {
273
266
  background-color: #5d99d6;
@@ -355,7 +348,11 @@ p.Biblio, p.NormRef {
355
348
 
356
349
  /* Blocks */
357
350
 
358
- .Sourcecode {
351
+ .SourceTitle {
352
+ @include blockTitle();
353
+ }
354
+
355
+ pre {
359
356
  @include sourceBlock(#f7f7f7);
360
357
 
361
358
  font-family: $monospacefont;
@@ -388,7 +385,7 @@ p.Biblio, p.NormRef {
388
385
  }
389
386
  }
390
387
 
391
- .figure, .Sourcecode, .pseudocode {
388
+ .figure, pre, .pseudocode {
392
389
  background-color: #e1eef1;
393
390
  color: #424242;
394
391
  font-size: 0.8em;
@@ -419,7 +416,7 @@ p.Biblio, p.NormRef {
419
416
  margin-left:-1.5em;
420
417
  }
421
418
 
422
- .Sourcecode, .pseudocode {
419
+ pre, .pseudocode {
423
420
  background: none;
424
421
  }
425
422
  }
@@ -131,7 +131,7 @@ p.Note, div.Note, li.Note, p.TableFootnote, div.TableFootnote, li.TableFootnote
131
131
  margin-right:0cm;
132
132
  margin-bottom:12.0pt;
133
133
  margin-left:0cm;
134
- text-align:justify;
134
+ text-align:left;
135
135
  line-height:12.0pt;
136
136
  mso-pagination:widow-orphan;
137
137
  tab-stops:20.15pt;
@@ -199,7 +199,7 @@ p.Definition, li.Definition, div.Definition
199
199
  margin-right:0cm;
200
200
  margin-bottom:12.0pt;
201
201
  margin-left:0cm;
202
- text-align:justify;
202
+ text-align:left;
203
203
  line-height:12.0pt;
204
204
  mso-pagination:widow-orphan;
205
205
  tab-stops:20.15pt;
@@ -216,7 +216,7 @@ p.ForewordTitle, li.ForewordTitle, div.ForewordTitle
216
216
  margin-right:0cm;
217
217
  margin-bottom:15.5pt;
218
218
  margin-left:0cm;
219
- text-align:justify;
219
+ text-align:left;
220
220
  line-height:15.5pt;
221
221
  page-break-before:always;
222
222
  mso-pagination:widow-orphan;
@@ -241,7 +241,7 @@ p.IntroTitle, li.IntroTitle, div.IntroTitle
241
241
  margin-right:0cm;
242
242
  margin-bottom:15.5pt;
243
243
  margin-left:0cm;
244
- text-align:justify;
244
+ text-align:left;
245
245
  line-height:15.5pt;
246
246
  mso-pagination:widow-orphan;
247
247
  page-break-after:avoid;
@@ -409,7 +409,7 @@ p.zzCopyright, li.zzCopyright
409
409
  margin-right:14.2pt;
410
410
  margin-bottom:12.0pt;
411
411
  margin-left:14.2pt;
412
- text-align:justify;
412
+ text-align:left;
413
413
  line-height:12.0pt;
414
414
  mso-pagination:widow-orphan;
415
415
  tab-stops:20.15pt 25.7pt 481.15pt;
@@ -492,7 +492,7 @@ p.Quote, li.Quote, div.Quote
492
492
  margin-right:36.0pt;
493
493
  margin-bottom:0cm;
494
494
  margin-left:36.0pt;
495
- text-align:justify;
495
+ text-align:left;
496
496
  line-height:12.0pt;
497
497
  mso-pagination:widow-orphan;
498
498
  tab-stops:20.15pt;
@@ -30,8 +30,10 @@ style='mso-no-proof:yes;font-size:10.0pt'>Version: {{ edition }}</span></span></
30
30
  <p class="MsoNormal" align="right" style='text-align:right'><span lang="EN-GB"
31
31
  style='mso-no-proof:yes;font-size:10.0pt'>Category: {{ doctype }}</span></span></p>
32
32
 
33
+ {% if editors %}
33
34
  <p class="MsoNormal" align="right" style='text-align:right'><span lang="EN-GB"
34
35
  style='mso-no-proof:yes;font-size:10.0pt'>Editor: {{ editors | join: ", " }}</span></span></p>
36
+ {% endif %}
35
37
 
36
38
  <p class="MsoNormal" align="center" style='text-align:center;line-height:18.0pt;margin-bottom:0.0pt'><b
37
39
  style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:24.0pt'>OGC {{ doctitle }}</span>
@@ -630,7 +630,7 @@ p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
630
630
  margin-right:0cm;
631
631
  margin-bottom:12.0pt;
632
632
  margin-left:0cm;
633
- text-align:justify;
633
+ text-align:left;
634
634
  line-height:12.0pt;
635
635
  mso-pagination:widow-orphan;
636
636
  tab-stops:20.15pt;
@@ -649,7 +649,7 @@ p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
649
649
  margin-right:0cm;
650
650
  margin-bottom:6.0pt;
651
651
  margin-left:0cm;
652
- text-align:justify;
652
+ text-align:left;
653
653
  line-height:12.0pt;
654
654
  mso-pagination:widow-orphan;
655
655
  font-size:10.5pt;
@@ -145,6 +145,7 @@ module IsoDoc
145
145
  word_recommend_cleanup(docxml)
146
146
  super
147
147
  word_license_cleanup(docxml)
148
+ word_term_cleanup(docxml)
148
149
  docxml
149
150
  end
150
151
 
@@ -154,6 +155,12 @@ module IsoDoc
154
155
  end
155
156
  end
156
157
 
158
+ def word_term_cleanup(docxml)
159
+ docxml.xpath("//p[@class = 'TermNum']//p[@class = 'Terms']").each do |p|
160
+ p.replace(p.children)
161
+ end
162
+ end
163
+
157
164
  def word_recommend_cleanup(docxml)
158
165
  docxml.xpath("//table[@class = 'recommendtest']/thead/tr").each do |tr|
159
166
  style_update(tr, "background:#C9C9C9;")
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-25 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities