metanorma-ogc 2.0.7 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/biblio.rb +1 -134
- data/lib/isodoc/ogc/html/html_ogc_titlepage.html +2 -0
- data/lib/isodoc/ogc/html/word_ogc_titlepage.html +3 -0
- data/lib/isodoc/ogc/html/word_ogc_titlepage_wp.html +3 -0
- data/lib/isodoc/ogc/init.rb +5 -6
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +547 -190
- data/lib/isodoc/ogc/ogc.best-practice.xsl +547 -190
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +547 -190
- data/lib/isodoc/ogc/ogc.community-practice.xsl +547 -190
- data/lib/isodoc/ogc/ogc.community-standard.xsl +547 -190
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +547 -190
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +547 -190
- data/lib/isodoc/ogc/ogc.other.xsl +547 -190
- data/lib/isodoc/ogc/ogc.policy.xsl +547 -190
- data/lib/isodoc/ogc/ogc.reference-model.xsl +547 -190
- data/lib/isodoc/ogc/ogc.release-notes.xsl +547 -190
- data/lib/isodoc/ogc/ogc.standard.xsl +547 -190
- data/lib/isodoc/ogc/ogc.test-suite.xsl +547 -190
- data/lib/isodoc/ogc/ogc.user-guide.xsl +547 -190
- data/lib/isodoc/ogc/ogc.white-paper.xsl +552 -197
- data/lib/isodoc/ogc/presentation_xml_convert.rb +15 -10
- data/lib/isodoc/ogc/word_convert.rb +3 -3
- data/lib/isodoc/ogc/xref.rb +6 -2
- data/lib/metanorma/ogc/biblio.rng +62 -10
- data/lib/metanorma/ogc/isodoc.rng +56 -0
- data/lib/metanorma/ogc/version.rb +1 -1
- data/lib/relaton/render/config.yml +10 -0
- data/lib/relaton/render/date.rb +9 -0
- data/lib/relaton/render/fields.rb +23 -0
- data/lib/relaton/render/general.rb +25 -0
- data/lib/relaton/render/parse.rb +11 -0
- data/metanorma-ogc.gemspec +1 -1
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 114f569b93b16cd055eda79bde9d167827b5af201bcab72cec2341a19f71e679
|
4
|
+
data.tar.gz: 75b4b390941bece71edeb25dd481fac0a39631b72abc2dbccbdc4bb54b102210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70bba60758978f653c396c98be63012440e00ae7d82dbd721256d0bc12db6b0d4ae099469acfa24208e5bd067812ca207fe465e986a9e4f2c2202142c2fa3a25
|
7
|
+
data.tar.gz: 00267f9fc1fb975117feeceb9a2cb29c45ecf86cda368115138452369aa3f52ab36bcd851a9c4d9efaf1e37f1467c145551b4961f949f1e6d94369c808b5f837
|
data/lib/isodoc/ogc/biblio.rb
CHANGED
@@ -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
|
-
|
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}–#{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
|
@@ -50,7 +50,10 @@ 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:
|
@@ -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 Description automatically generated"
|
data/lib/isodoc/ogc/init.rb
CHANGED
@@ -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,
|
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
|
-
|
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
|
-
|