metanorma-ogc 2.0.8 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/biblio.rb +1 -134
  3. data/lib/isodoc/ogc/html/html_ogc_titlepage.html +2 -0
  4. data/lib/isodoc/ogc/html/word_ogc_intro.html +2 -3
  5. data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +1 -2
  6. data/lib/isodoc/ogc/html/word_ogc_titlepage.html +20 -17
  7. data/lib/isodoc/ogc/html/word_ogc_titlepage_wp.html +3 -0
  8. data/lib/isodoc/ogc/init.rb +5 -6
  9. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +1501 -276
  10. data/lib/isodoc/ogc/ogc.best-practice.xsl +1501 -276
  11. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +1501 -276
  12. data/lib/isodoc/ogc/ogc.community-practice.xsl +1501 -276
  13. data/lib/isodoc/ogc/ogc.community-standard.xsl +1501 -276
  14. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +1501 -276
  15. data/lib/isodoc/ogc/ogc.engineering-report.xsl +1501 -276
  16. data/lib/isodoc/ogc/ogc.other.xsl +1501 -276
  17. data/lib/isodoc/ogc/ogc.policy.xsl +1501 -276
  18. data/lib/isodoc/ogc/ogc.reference-model.xsl +1501 -276
  19. data/lib/isodoc/ogc/ogc.release-notes.xsl +1501 -276
  20. data/lib/isodoc/ogc/ogc.standard.xsl +1501 -276
  21. data/lib/isodoc/ogc/ogc.test-suite.xsl +1501 -276
  22. data/lib/isodoc/ogc/ogc.user-guide.xsl +1501 -276
  23. data/lib/isodoc/ogc/ogc.white-paper.xsl +1506 -283
  24. data/lib/isodoc/ogc/presentation_xml_convert.rb +14 -10
  25. data/lib/isodoc/ogc/word_convert.rb +4 -4
  26. data/lib/isodoc/ogc/xref.rb +6 -2
  27. data/lib/metanorma/ogc/biblio.rng +37 -8
  28. data/lib/metanorma/ogc/isodoc.rng +56 -0
  29. data/lib/metanorma/ogc/version.rb +1 -1
  30. data/lib/relaton/render/config.yml +10 -0
  31. data/lib/relaton/render/date.rb +9 -0
  32. data/lib/relaton/render/fields.rb +23 -0
  33. data/lib/relaton/render/general.rb +25 -0
  34. data/lib/relaton/render/parse.rb +11 -0
  35. data/metanorma-ogc.gemspec +1 -1
  36. metadata +9 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef612784fe89a2f1a4a71dd5b4a21d76a867d91c04cb41c47d2c01f3ea42ebd2
4
- data.tar.gz: 724d7fa5be3843a86130b27a59f46221bd2d1abd0f8308132c2df4de67d7621b
3
+ metadata.gz: c0b39d758559b37e99cbf6cbd74f6fb4ca3d14f0e8d14c30dd6cd7976f44e2f9
4
+ data.tar.gz: 6197ea680ea55540397f234e8b9b9dc60deeff0397763fd16c905f6cddaed2cd
5
5
  SHA512:
6
- metadata.gz: 55ee40296e95badf067ee1ff19add5204e3cd5ac1cc0c024f3932a40b37113630baedb1edd7469cb070f2bd30aa2d49b16d627aae3a5c5adf00864b1750e87ce
7
- data.tar.gz: 8578f3bd16e028683cd5769f9bdfeea9f581650bc3ddd56c895d0a621ca2409ed5e675291600ca5536e6cbdac8836021dcd8e859531c74bb65d3b5fe67e7748d
6
+ metadata.gz: e29b04fc9445551ffed805d983209d7ad9ff096c3f91ceb08bb444b188030011ef6da4b460f071fca11048a157e2dcbb5b522468ef1b5cd1b58829b7bca5ba5c
7
+ data.tar.gz: d8edb500943625e3fbf994eda6f2f527a8173f06060db9a4a137f3eeb28e6c9515d35187fcf5f0870c2802052b10ffc97bcd5a392020b47d334ead77c7b024c0
@@ -4,7 +4,7 @@ module IsoDoc
4
4
  def std_bibitem_entry(list, bib, ordinal, biblio)
5
5
  list.p **attr_code(iso_bibitem_entry_attrs(bib, biblio)) do |ref|
6
6
  prefix_bracketed_ref(ref, "[#{ordinal}]") if biblio
7
- standard_citation(ref, bib)
7
+ reference_format(bib, ref)
8
8
  end
9
9
  end
10
10
 
@@ -19,139 +19,6 @@ module IsoDoc
19
19
  reference_format(bib, r)
20
20
  end
21
21
  end
22
-
23
- def reference_format(bib, ref)
24
- if ftitle = bib.at(ns("./formattedref"))
25
- ftitle&.children&.each { |n| parse(n, ref) }
26
- else
27
- # eventually will be full LNCS reference
28
- standard_citation(ref, bib)
29
- end
30
- end
31
-
32
- def multiplenames(names)
33
- names.join(", ")
34
- end
35
-
36
- def multiplenames_and(names)
37
- return "" if names.empty?
38
- return names[0] if names.length == 1
39
- return "#{names[0]} and #{names[1]}" if names.length == 2
40
-
41
- names[0..-2].join(", ") + " and #{names[-1]}"
42
- end
43
-
44
- def nodes_to_span(node)
45
- noko do |xml|
46
- xml.span do |s|
47
- node&.children&.each { |x| parse(x, s) }
48
- end
49
- end.join
50
- end
51
-
52
- def extract_publisher(bib)
53
- abbrs = []
54
- names = []
55
- bib.xpath(ns("./contributor[role/@type = 'publisher']"\
56
- "[organization]"))&.each do |c1|
57
- n = c1.at(ns("./organization/name")) or next
58
- abbrs << (c1.at(ns("./organization/abbreviation")) || n)
59
- names << nodes_to_span(n)
60
- end
61
- return [nil, nil] if names.empty?
62
-
63
- [multiplenames_and(names), abbrs.map(&:text).join("/")]
64
- end
65
-
66
- def extract_author(bib)
67
- c = bib.xpath(ns("./contributor[role/@type = 'author']"))
68
- c = bib.xpath(ns("./contributor[role/@type = 'editor']")) if c.empty?
69
- return nil if c.empty?
70
-
71
- c.map do |c1|
72
- c1&.at(ns("./organization/name"))&.text || extract_person_name(c1)
73
- end.reject { |e| e.nil? || e.empty? }.join(", ")
74
- end
75
-
76
- def extract_person_name(bib)
77
- p = bib.at(ns("./person/name")) or return
78
- c = p.at(ns("./completename")) and return c.text
79
- s = p&.at(ns("./surname"))&.text or return
80
- i = p.xpath(ns("./initial")) and
81
- front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join
82
- i.empty? and f = p.xpath(ns("./forename")) and
83
- front = f.map { |e| e.text[0].upcase }.join
84
- front ? "#{s} #{front}" : s
85
- end
86
-
87
- def date_render(date)
88
- return nil if date.nil?
89
-
90
- on = date&.at(ns("./on"))&.text
91
- from = date&.at(ns("./from"))&.text
92
- to = date&.at(ns("./to"))&.text
93
- return on if on && !on.empty?
94
- return "#{from}&ndash;#{to}" if from && !from.empty?
95
-
96
- nil
97
- end
98
-
99
- def extract_year(bib)
100
- d = bib.at(ns("./date[@type = 'published']")) ||
101
- bib.at(ns("./date[@type = 'issued']")) ||
102
- bib.at(ns("./date[@type = 'circulated']")) ||
103
- bib.at(ns("./date"))
104
- date_render(d)
105
- end
106
-
107
- def extract_city(bib)
108
- bib.at(ns("./place"))
109
- end
110
-
111
- def extract_uri(bib)
112
- bib.at(ns("./uri[@type = 'src']")) || bib.at(ns("./uri"))
113
- end
114
-
115
- # {author}: {document identifier}, {title}. {publisher}, {city} ({year})
116
- def standard_citation(out, bib)
117
- if ftitle = bib.at(ns("./formattedref"))
118
- ftitle&.children&.each { |n| parse(n, out) }
119
- else
120
- pub, pub_abbrev = extract_publisher(bib)
121
- author = extract_author(bib)
122
- c = extract_city(bib)
123
- y = extract_year(bib)
124
- u = extract_uri(bib)
125
- out << "#{author || pub_abbrev}: " if author || pub_abbrev
126
- id = render_identifier(inline_bibitem_ref_code(bib))
127
- out << id[:sdo] if id[:sdo]
128
- out << " (Draft)" if ogc_draft_ref?(bib)
129
- out << ", "
130
- out.i do |i|
131
- iso_title(bib)&.children&.each { |n| parse(n, i) }
132
- end
133
- out << ". "
134
- out << pub if pub
135
- out << ", " if pub && c
136
- c&.children&.each { |n| parse(n, out) }
137
- out << " " if (pub || c) && y
138
- out << "(#{y}). " if y
139
- u and out << "<a href='#{u.text}'>#{u.text}</a>"
140
- end
141
- end
142
-
143
- def inline_bibitem_ref_code(bib)
144
- id = bib.at(ns("./docidentifier[not(@type = 'DOI' "\
145
- "or @type = 'metanorma' or @type = 'ISSN' "\
146
- "or @type = 'ISBN' or @type = 'metanorma-ordinal')]"))
147
- id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma' or "\
148
- "@type = 'metanorma-ordinal')]"))
149
- return [nil, id, nil, nil] if id
150
-
151
- id = Nokogiri::XML::Node.new("docidentifier", bib.document)
152
- id << "(NO ID)"
153
- [nil, id, nil, nil]
154
- end
155
22
  end
156
23
  end
157
24
  end
@@ -98,6 +98,8 @@
98
98
  <div class="coverpage-warning">
99
99
  <div id="boilerplate-legal-destination"/>
100
100
  </div>
101
+ <div class="coverpage-warning" id="coverpage-note-destination"/>
102
+
101
103
 
102
104
  <div class="docstage-box">
103
105
  <table>
@@ -6,10 +6,9 @@
6
6
  {% endif %}
7
7
  </div>
8
8
 
9
- <span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;
9
+ <span lang="EN-US" style='font-size:12.0pt;font-family:"Times New Roman",serif;
10
10
  mso-fareast-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-fareast-language:
11
- EN-US;mso-bidi-language:AR-SA'><br clear=all style='mso-special-character:line-break;
12
- page-break-before:always'>
11
+ EN-US;mso-bidi-language:AR-SA'><br clear="all" style='mso-special-character:line-break;page-break-before:always'>
13
12
  </span>
14
13
 
15
14
  <p class="zzContents" style='margin-top:0cm'><span lang="EN-GB">Contents</span></p>
@@ -5,8 +5,7 @@
5
5
 
6
6
  <span lang="EN-US" style='font-size:12.0pt;font-family:"Times New Roman",serif;
7
7
  mso-fareast-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-fareast-language:
8
- EN-US;mso-bidi-language:AR-SA'><br clear=all style='mso-special-character:line-break;
9
- page-break-before:always'>
8
+ EN-US;mso-bidi-language:AR-SA'><br clear="all" style='mso-special-character:line-break;page-break-before:always'>
10
9
  </span>
11
10
 
12
11
  <p class="zzContents"><span lang="EN-GB">Table of Contents</span></p>
@@ -50,61 +50,64 @@ style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:24.0pt'>
50
50
 
51
51
  <div class="warning">
52
52
  <div id="boilerplate-legal-destination"/>
53
+ <div id="boilerplate-license-destination"/>
53
54
  </div>
55
+ <div class="coverpage-warning" id="coverpage-note-destination"/>
56
+
54
57
 
55
58
  <div style='mso-element:frame;mso-element-frame-hspace:7.1pt;mso-element-frame-vspace:
56
59
  7.1pt;mso-element-wrap:auto;mso-element-anchor-vertical:page;mso-element-anchor-horizontal:
57
60
  page;mso-element-left:39.9pt;mso-element-top:693.25pt;mso-height-rule:exactly'>
58
61
 
59
- <table cellspacing=0 cellpadding=0 hspace=0 vspace=0>
62
+ <table cellspacing="0" cellpadding="0" hspace="0" vspace="0">
60
63
  <tr>
61
- <td valign=top align=left style='padding-top:7.1pt;padding-right:7.1pt;
64
+ <td valign="top" align="left" style='padding-top:7.1pt;padding-right:7.1pt;
62
65
  padding-bottom:7.1pt;padding-left:7.1pt'>
63
- <p class=zzCover align=left style='margin-bottom:0cm;margin-bottom:.0001pt;
66
+ <p class="zzCover" align="left" style='margin-bottom:0cm;margin-bottom:.0001pt;
64
67
  text-align:left;mso-hyphenate:none;tab-stops:99.0pt;mso-element:frame;
65
68
  mso-element-frame-hspace:7.1pt;mso-element-frame-vspace:7.1pt;mso-element-wrap:
66
69
  auto;mso-element-anchor-vertical:page;mso-element-anchor-horizontal:page;
67
70
  mso-element-left:39.9pt;mso-element-top:693.25pt;mso-height-rule:exactly'><span
68
- lang=EN-GB style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
71
+ lang="EN-GB" style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
69
72
  number:&nbsp;&nbsp;&nbsp;<span style='mso-tab-count:1'>         </span><span
70
- class=SpellE><span lang=EN-GB
71
- style='font-size:10.0pt;font-weight:normal'>{{ docnumber }}</span><span lang=EN-GB style='font-size:10.0pt;
73
+ class="SpellE"><span lang="EN-GB"
74
+ style='font-size:10.0pt;font-weight:normal'>{{ docnumber }}</span><span lang="EN-GB" style='font-size:10.0pt;
72
75
  mso-color-alt:windowtext;font-weight:normal'><o:p></o:p></span></p>
73
76
 
74
- <p class=zzCover align=left style='margin-bottom:0cm;margin-bottom:.0001pt;
77
+ <p class="zzCover" align="left" style='margin-bottom:0cm;margin-bottom:.0001pt;
75
78
  text-align:left;mso-hyphenate:none;tab-stops:99.0pt;mso-element:frame;
76
79
  mso-element-frame-hspace:7.1pt;mso-element-frame-vspace:7.1pt;mso-element-wrap:
77
80
  auto;mso-element-anchor-vertical:page;mso-element-anchor-horizontal:page;
78
81
  mso-element-left:39.9pt;mso-element-top:693.25pt;mso-height-rule:exactly'><span
79
- lang=EN-GB style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
82
+ lang="EN-GB" style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
80
83
  type:&nbsp;&nbsp;&nbsp;<span style='mso-tab-count:1'>         </span><span
81
- class=SpellE>OGC</span><sup>®</sup> </span><span lang=EN-GB
82
- style='font-size:10.0pt;font-weight:normal'>{{ doctype }}</span><span lang=EN-GB style='font-size:10.0pt;
84
+ class="SpellE">OGC</span><sup>®</sup> </span><span lang="EN-GB"
85
+ style='font-size:10.0pt;font-weight:normal'>{{ doctype }}</span><span lang="EN-GB" style='font-size:10.0pt;
83
86
  mso-color-alt:windowtext;font-weight:normal'><o:p></o:p></span></p>
84
87
 
85
- <p class=zzCover align=left style='margin-bottom:0cm;margin-bottom:.0001pt;
88
+ <p class="zzCover" align="left" style='margin-bottom:0cm;margin-bottom:.0001pt;
86
89
  text-align:left;mso-hyphenate:none;tab-stops:99.0pt;mso-element:frame;
87
90
  mso-element-frame-hspace:7.1pt;mso-element-frame-vspace:7.1pt;mso-element-wrap:
88
91
  auto;mso-element-anchor-vertical:page;mso-element-anchor-horizontal:page;
89
92
  mso-element-left:39.9pt;mso-element-top:693.25pt;mso-height-rule:exactly'><span
90
- lang=EN-GB style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
93
+ lang="EN-GB" style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
91
94
  subtype:&nbsp;&nbsp;&nbsp;<span style='mso-tab-count:1'>    </span>{{ docsubstatus }}<o:p></o:p></span></p>
92
95
 
93
- <p class=zzCover align=left style='margin-bottom:0cm;margin-bottom:.0001pt;
96
+ <p class="zzCover" align="left" style='margin-bottom:0cm;margin-bottom:.0001pt;
94
97
  text-align:left;mso-hyphenate:none;tab-stops:99.0pt;mso-element:frame;
95
98
  mso-element-frame-hspace:7.1pt;mso-element-frame-vspace:7.1pt;mso-element-wrap:
96
99
  auto;mso-element-anchor-vertical:page;mso-element-anchor-horizontal:page;
97
100
  mso-element-left:39.9pt;mso-element-top:693.25pt;mso-height-rule:exactly'><span
98
- lang=EN-GB style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
101
+ lang="EN-GB" style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
99
102
  stage:&nbsp;&nbsp;&nbsp;<span style='mso-tab-count:1'>        </span>{{ stage_display }}<o:p></o:p></span></p>
100
- <p class=zzCover align=left style='margin-bottom:0cm;margin-bottom:.0001pt;
103
+ <p class="zzCover" align="left" style='margin-bottom:0cm;margin-bottom:.0001pt;
101
104
  text-align:left;mso-hyphenate:none;tab-stops:99.0pt;mso-element:frame;
102
105
  mso-element-frame-hspace:7.1pt;mso-element-frame-vspace:7.1pt;mso-element-wrap:
103
106
  auto;mso-element-anchor-vertical:page;mso-element-anchor-horizontal:page;
104
107
  mso-element-left:39.9pt;mso-element-top:693.25pt;mso-height-rule:exactly'><span
105
- lang=EN-GB style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
108
+ lang="EN-GB" style='font-size:10.0pt;mso-color-alt:windowtext;font-weight:normal'>Document
106
109
  language:&nbsp;<span style='mso-tab-count:1'>    </span>{{ doclanguage }}</span><span
107
- lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;mso-color-alt:
110
+ lang="EN-GB" style='font-size:8.0pt;mso-bidi-font-size:10.0pt;mso-color-alt:
108
111
  windowtext'><o:p></o:p></span></p>
109
112
  </td>
110
113
  </tr>
@@ -65,8 +65,11 @@ style='mso-no-proof:yes;font-size:10.0pt'>Category: {{ doctype }}</span></p>
65
65
  <div id="boilerplate-copyright-destination"/>
66
66
  <div class="warning">
67
67
  <div id="boilerplate-legal-destination"/>
68
+ <div id="boilerplate-license-destination"/>
68
69
  </div>
69
70
  </div>
71
+ <div class="coverpage-warning" id="coverpage-note-destination"/>
72
+
70
73
 
71
74
  <v:shape id="Picture_x0020_4" o:spid="_x0000_s1026" type="#_x0000_t75"
72
75
  alt="A close up of a sign&#10;&#10;Description automatically generated"
@@ -10,13 +10,13 @@ module IsoDoc
10
10
  @meta = Metadata.new(lang, script, labels)
11
11
  end
12
12
 
13
- def xref_init(lang, script, klass, labels, options)
13
+ def xref_init(lang, script, _klass, labels, options)
14
14
  html = HtmlConvert.new(language: lang, script: script)
15
15
  @xrefs = Xref.new(lang, script, html, labels, options)
16
16
  end
17
17
 
18
18
  def i18n_init(lang, script, i18nyaml = nil)
19
- @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
19
+ @i18n = I18n.new(lang, script, i18nyaml: i18nyaml || @i18nyaml)
20
20
  end
21
21
 
22
22
  def fileloc(loc)
@@ -28,14 +28,13 @@ module IsoDoc
28
28
  end
29
29
 
30
30
  def ogc_draft_ref?(ref)
31
- return unless ref.at(
32
- ns("./contributor[role/@type = 'publisher']/organization"\
33
- "[name = 'Open Geospatial Consortium']"))
31
+ return unless ref.at(ns("./docidentifier[@type = 'OGC']"))
32
+
34
33
  status = ref.at(ns("./status/stage"))&.text or return
35
34
  return if %w(approved published deprecated retired).include? status
35
+
36
36
  true
37
37
  end
38
38
  end
39
39
  end
40
40
  end
41
-