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
@@ -2,6 +2,7 @@ require_relative "init"
|
|
2
2
|
require_relative "reqt"
|
3
3
|
require "isodoc"
|
4
4
|
require "uuidtools"
|
5
|
+
require_relative "../../relaton/render/general"
|
5
6
|
|
6
7
|
module IsoDoc
|
7
8
|
module Ogc
|
@@ -169,15 +170,6 @@ module IsoDoc
|
|
169
170
|
references(docxml)
|
170
171
|
end
|
171
172
|
|
172
|
-
def references(docxml)
|
173
|
-
super
|
174
|
-
docxml.xpath(ns("//bibitem/date")).each do |d|
|
175
|
-
d.xpath(ns("./on | ./from | ./to")).each do |d1|
|
176
|
-
d1.children = d1.text.sub(/^(\d\d\d\d).*$/, "\\1")
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
173
|
def bibdata(docxml)
|
182
174
|
docxml.xpath(ns("//bibdata/contributor[@type = 'author']")).each do |a|
|
183
175
|
a.at(ns("./description"))&.text == "contributor" and
|
@@ -226,7 +218,20 @@ module IsoDoc
|
|
226
218
|
|
227
219
|
def bibliography_bibitem_number_skip(bibitem)
|
228
220
|
@xrefs.klass.implicit_reference(bibitem) ||
|
229
|
-
bibitem.at(ns(".//docidentifier[@type = 'metanorma-ordinal']"))
|
221
|
+
bibitem.at(ns(".//docidentifier[@type = 'metanorma-ordinal']")) ||
|
222
|
+
bibitem["hidden"] == "true" || bibitem.parent["hidden"] == "true"
|
223
|
+
end
|
224
|
+
|
225
|
+
def bibrenderer
|
226
|
+
::Relaton::Render::Ogc::General.new(language: @lang)
|
227
|
+
end
|
228
|
+
|
229
|
+
def bibrender(xml)
|
230
|
+
unless xml.at(ns("./formattedref"))
|
231
|
+
xml.children =
|
232
|
+
"#{bibrenderer.render(xml.to_xml)}"\
|
233
|
+
"#{xml.xpath(ns('./docidentifier | ./uri | ./note | ./status')).to_xml}"
|
234
|
+
end
|
230
235
|
end
|
231
236
|
|
232
237
|
include Init
|
@@ -157,15 +157,15 @@ module IsoDoc
|
|
157
157
|
|
158
158
|
def toWord(result, filename, dir, header)
|
159
159
|
result = from_xhtml(word_cleanup(to_xhtml(result)))
|
160
|
+
.gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
|
160
161
|
@wordstylesheet = wordstylesheet_update
|
161
|
-
Html2Doc.
|
162
|
-
result,
|
162
|
+
Html2Doc.new(
|
163
163
|
filename: filename, imagedir: @localdir,
|
164
164
|
stylesheet: @wordstylesheet&.path,
|
165
165
|
header_file: header&.path, dir: dir,
|
166
166
|
asciimathdelims: [@openmathdelim, @closemathdelim],
|
167
167
|
liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" }
|
168
|
-
)
|
168
|
+
).process(result)
|
169
169
|
header&.unlink
|
170
170
|
@wordstylesheet.unlink if @wordstylesheet.is_a?(Tempfile)
|
171
171
|
end
|
data/lib/isodoc/ogc/xref.rb
CHANGED
@@ -130,6 +130,7 @@ module IsoDoc
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def initial_anchor_names(doc)
|
133
|
+
if @parse_settings.empty? || @parse_settings[:clauses]
|
133
134
|
preface_anchor_names(doc)
|
134
135
|
n = Counter.new
|
135
136
|
n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
|
@@ -140,10 +141,13 @@ module IsoDoc
|
|
140
141
|
n, 1
|
141
142
|
)
|
142
143
|
n = section_names(doc.at(ns("//sections/definitions")), n, 1)
|
143
|
-
middle_section_asset_names(doc)
|
144
144
|
clause_names(doc, n)
|
145
|
+
end
|
146
|
+
if @parse_settings.empty?
|
147
|
+
middle_section_asset_names(doc)
|
145
148
|
termnote_anchor_names(doc)
|
146
149
|
termexample_anchor_names(doc)
|
150
|
+
end
|
147
151
|
end
|
148
152
|
|
149
153
|
def preface_anchor_names(doc)
|
@@ -217,7 +221,7 @@ module IsoDoc
|
|
217
221
|
super
|
218
222
|
return unless @klass.ogc_draft_ref?(ref)
|
219
223
|
|
220
|
-
@anchors[ref["id"]] = { xref: "#{@anchors[ref['id']][:xref]}
|
224
|
+
@anchors[ref["id"]] = { xref: "#{@anchors[ref['id']][:xref]} (draft)" }
|
221
225
|
end
|
222
226
|
end
|
223
227
|
end
|
@@ -527,7 +527,7 @@
|
|
527
527
|
</define>
|
528
528
|
<define name="LocalityType">
|
529
529
|
<data type="string">
|
530
|
-
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
530
|
+
<param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
531
531
|
</data>
|
532
532
|
</define>
|
533
533
|
<define name="referenceFrom">
|
@@ -677,6 +677,9 @@
|
|
677
677
|
<zeroOrMore>
|
678
678
|
<ref name="extent"/>
|
679
679
|
</zeroOrMore>
|
680
|
+
<optional>
|
681
|
+
<ref name="bibliographic_size"/>
|
682
|
+
</optional>
|
680
683
|
<zeroOrMore>
|
681
684
|
<ref name="accesslocation"/>
|
682
685
|
</zeroOrMore>
|
@@ -848,17 +851,46 @@
|
|
848
851
|
</define>
|
849
852
|
<define name="bplace">
|
850
853
|
<element name="place">
|
851
|
-
<
|
852
|
-
<
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
854
|
+
<choice>
|
855
|
+
<text/>
|
856
|
+
<group>
|
857
|
+
<ref name="bibliocity"/>
|
858
|
+
<zeroOrMore>
|
859
|
+
<ref name="biblioregion"/>
|
860
|
+
</zeroOrMore>
|
861
|
+
<zeroOrMore>
|
862
|
+
<ref name="bibliocountry"/>
|
863
|
+
</zeroOrMore>
|
864
|
+
</group>
|
865
|
+
</choice>
|
866
|
+
</element>
|
867
|
+
</define>
|
868
|
+
<define name="bibliocity">
|
869
|
+
<element name="city">
|
859
870
|
<text/>
|
860
871
|
</element>
|
861
872
|
</define>
|
873
|
+
<define name="biblioregion">
|
874
|
+
<element name="region">
|
875
|
+
<ref name="RegionType"/>
|
876
|
+
</element>
|
877
|
+
</define>
|
878
|
+
<define name="bibliocountry">
|
879
|
+
<element name="country">
|
880
|
+
<ref name="RegionType"/>
|
881
|
+
</element>
|
882
|
+
</define>
|
883
|
+
<define name="RegionType">
|
884
|
+
<optional>
|
885
|
+
<attribute name="iso"/>
|
886
|
+
</optional>
|
887
|
+
<optional>
|
888
|
+
<attribute name="recommended">
|
889
|
+
<data type="boolean"/>
|
890
|
+
</attribute>
|
891
|
+
</optional>
|
892
|
+
<text/>
|
893
|
+
</define>
|
862
894
|
<define name="bprice">
|
863
895
|
<element name="price">
|
864
896
|
<attribute name="currency"/>
|
@@ -922,9 +954,29 @@
|
|
922
954
|
<text/>
|
923
955
|
</element>
|
924
956
|
</define>
|
957
|
+
<define name="sizevalue">
|
958
|
+
<element name="value">
|
959
|
+
<attribute name="type"/>
|
960
|
+
<text/>
|
961
|
+
</element>
|
962
|
+
</define>
|
963
|
+
<define name="bibliographic_size">
|
964
|
+
<element name="size">
|
965
|
+
<oneOrMore>
|
966
|
+
<ref name="sizevalue"/>
|
967
|
+
</oneOrMore>
|
968
|
+
</element>
|
969
|
+
</define>
|
925
970
|
<define name="extent">
|
926
971
|
<element name="extent">
|
927
|
-
<
|
972
|
+
<choice>
|
973
|
+
<zeroOrMore>
|
974
|
+
<ref name="locality"/>
|
975
|
+
</zeroOrMore>
|
976
|
+
<zeroOrMore>
|
977
|
+
<ref name="localityStack"/>
|
978
|
+
</zeroOrMore>
|
979
|
+
</choice>
|
928
980
|
</element>
|
929
981
|
</define>
|
930
982
|
<define name="series">
|
@@ -32,6 +32,43 @@
|
|
32
32
|
<ref name="DocumentType"/>
|
33
33
|
</element>
|
34
34
|
</define>
|
35
|
+
<define name="admonition">
|
36
|
+
<element name="admonition">
|
37
|
+
<attribute name="type">
|
38
|
+
<ref name="AdmonitionType"/>
|
39
|
+
</attribute>
|
40
|
+
<optional>
|
41
|
+
<attribute name="class"/>
|
42
|
+
</optional>
|
43
|
+
<attribute name="id">
|
44
|
+
<data type="ID"/>
|
45
|
+
</attribute>
|
46
|
+
<optional>
|
47
|
+
<attribute name="uri">
|
48
|
+
<data type="anyURI"/>
|
49
|
+
</attribute>
|
50
|
+
</optional>
|
51
|
+
<optional>
|
52
|
+
<attribute name="coverpage">
|
53
|
+
<data type="boolean"/>
|
54
|
+
</attribute>
|
55
|
+
</optional>
|
56
|
+
<optional>
|
57
|
+
<attribute name="notag">
|
58
|
+
<data type="boolean"/>
|
59
|
+
</attribute>
|
60
|
+
</optional>
|
61
|
+
<optional>
|
62
|
+
<ref name="tname"/>
|
63
|
+
</optional>
|
64
|
+
<zeroOrMore>
|
65
|
+
<ref name="paragraph-with-footnote"/>
|
66
|
+
</zeroOrMore>
|
67
|
+
<zeroOrMore>
|
68
|
+
<ref name="note"/>
|
69
|
+
</zeroOrMore>
|
70
|
+
</element>
|
71
|
+
</define>
|
35
72
|
<define name="index">
|
36
73
|
<element name="index">
|
37
74
|
<optional>
|
@@ -851,6 +888,16 @@
|
|
851
888
|
<ref name="MultilingualRenderingType"/>
|
852
889
|
</attribute>
|
853
890
|
</optional>
|
891
|
+
<optional>
|
892
|
+
<attribute name="coverpage">
|
893
|
+
<data type="boolean"/>
|
894
|
+
</attribute>
|
895
|
+
</optional>
|
896
|
+
<optional>
|
897
|
+
<attribute name="notag">
|
898
|
+
<data type="boolean"/>
|
899
|
+
</attribute>
|
900
|
+
</optional>
|
854
901
|
<oneOrMore>
|
855
902
|
<choice>
|
856
903
|
<ref name="paragraph"/>
|
@@ -1178,6 +1225,7 @@
|
|
1178
1225
|
<ref name="concept"/>
|
1179
1226
|
<ref name="add"/>
|
1180
1227
|
<ref name="del"/>
|
1228
|
+
<ref name="span"/>
|
1181
1229
|
</choice>
|
1182
1230
|
</define>
|
1183
1231
|
<define name="add">
|
@@ -1204,6 +1252,14 @@
|
|
1204
1252
|
</choice>
|
1205
1253
|
</element>
|
1206
1254
|
</define>
|
1255
|
+
<define name="span">
|
1256
|
+
<element name="span">
|
1257
|
+
<attribute name="class"/>
|
1258
|
+
<oneOrMore>
|
1259
|
+
<ref name="TextElement"/>
|
1260
|
+
</oneOrMore>
|
1261
|
+
</element>
|
1262
|
+
</define>
|
1207
1263
|
<define name="concept">
|
1208
1264
|
<element name="concept">
|
1209
1265
|
<optional>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
template:
|
2
|
+
# skip standardidentifier, it is inserted in front of formattedref within metanorma
|
3
|
+
standard: "{% if creatornames %}{{ creatornames }} ({{role}}){%else%}{{ publisher_abbrev}}{%endif%} : {{standardidentifier|first}} {{draft}} , <em>{{ title }}</em>. {{ publisher }}{%if place%},{%endif%} {{ place }} ({{date}}). {{uri}}."
|
4
|
+
misc: standard
|
5
|
+
techreport: standard
|
6
|
+
nametemplate:
|
7
|
+
one: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} {{initials[0]}}{% endif %}"
|
8
|
+
two: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} {{initials[0]}}{% endif %} , {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{{surname[1]}} {{ initials[1]}}{% endif %}"
|
9
|
+
more: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} {{initials[0]}} {% endif %} , {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{{surname[1]}} {{ initials[1]}} {% endif %} , {% if nonpersonal[2] %}{{ nonpersonal[2] }}{% else %}{{surname[2]}} {{initials[2]}}{% endif %}"
|
10
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative "date"
|
2
|
+
|
3
|
+
module Relaton
|
4
|
+
module Render
|
5
|
+
module Ogc
|
6
|
+
class Fields < ::Relaton::Render::Fields
|
7
|
+
def name_fields_format(hash)
|
8
|
+
super
|
9
|
+
hash[:publisher_abbrev] = hash[:publisher_abbrev_raw]&.join("/")
|
10
|
+
end
|
11
|
+
|
12
|
+
def draftformat(num, hash)
|
13
|
+
return nil unless hash[:publisher] == "Open Geospatial Consortium"
|
14
|
+
return nil unless num[:status]
|
15
|
+
return nil if %w(approved published deprecated retired)
|
16
|
+
.include?(num[:status])
|
17
|
+
|
18
|
+
"(Draft)"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "relaton-render"
|
2
|
+
require_relative "parse"
|
3
|
+
require_relative "fields"
|
4
|
+
|
5
|
+
module Relaton
|
6
|
+
module Render
|
7
|
+
module Ogc
|
8
|
+
class General < ::Relaton::Render::IsoDoc::General
|
9
|
+
def config_loc
|
10
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
|
11
|
+
end
|
12
|
+
|
13
|
+
def klass_initialize(_options)
|
14
|
+
@nametemplateklass = Relaton::Render::Template::Name
|
15
|
+
@seriestemplateklass = Relaton::Render::Template::Series
|
16
|
+
@extenttemplateklass = Relaton::Render::Template::Extent
|
17
|
+
@sizetemplateklass = Relaton::Render::Template::Size
|
18
|
+
@generaltemplateklass = Relaton::Render::Template::General
|
19
|
+
@fieldsklass = Relaton::Render::Ogc::Fields
|
20
|
+
@parseklass = Relaton::Render::Ogc::Parse
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/metanorma-ogc.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
26
26
|
|
27
27
|
spec.add_dependency "iso-639"
|
28
|
-
spec.add_dependency "metanorma-standoc", "~> 2.
|
28
|
+
spec.add_dependency "metanorma-standoc", "~> 2.1.0"
|
29
29
|
|
30
30
|
spec.add_development_dependency "debug"
|
31
31
|
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.0
|
4
|
+
version: 2.1.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: 2022-
|
11
|
+
date: 2022-05-09 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.
|
33
|
+
version: 2.1.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.
|
40
|
+
version: 2.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: debug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -265,6 +265,11 @@ files:
|
|
265
265
|
- lib/metanorma/ogc/reqt.rng
|
266
266
|
- lib/metanorma/ogc/validate.rb
|
267
267
|
- lib/metanorma/ogc/version.rb
|
268
|
+
- lib/relaton/render/config.yml
|
269
|
+
- lib/relaton/render/date.rb
|
270
|
+
- lib/relaton/render/fields.rb
|
271
|
+
- lib/relaton/render/general.rb
|
272
|
+
- lib/relaton/render/parse.rb
|
268
273
|
- metanorma-ogc.gemspec
|
269
274
|
homepage: https://github.com/metanorma/metanorma-ogc
|
270
275
|
licenses:
|