metanorma-ogc 2.0.8.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) 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/htmlstyle.css +6 -0
  5. data/lib/isodoc/ogc/html/htmlstyle.scss +2 -0
  6. data/lib/isodoc/ogc/html/ogc.css +18 -12
  7. data/lib/isodoc/ogc/html/ogc.scss +16 -9
  8. data/lib/isodoc/ogc/html/ogc_wp.css +18 -12
  9. data/lib/isodoc/ogc/html/ogc_wp.scss +16 -9
  10. data/lib/isodoc/ogc/html/word_ogc_intro.html +2 -3
  11. data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +1 -2
  12. data/lib/isodoc/ogc/html/word_ogc_titlepage.html +20 -17
  13. data/lib/isodoc/ogc/html/word_ogc_titlepage_wp.html +3 -0
  14. data/lib/isodoc/ogc/i18n.rb +1 -1
  15. data/lib/isodoc/ogc/init.rb +5 -6
  16. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +1502 -401
  17. data/lib/isodoc/ogc/ogc.best-practice.xsl +1502 -401
  18. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +1502 -401
  19. data/lib/isodoc/ogc/ogc.community-practice.xsl +1502 -401
  20. data/lib/isodoc/ogc/ogc.community-standard.xsl +1502 -401
  21. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +1502 -401
  22. data/lib/isodoc/ogc/ogc.engineering-report.xsl +1502 -401
  23. data/lib/isodoc/ogc/ogc.other.xsl +1502 -401
  24. data/lib/isodoc/ogc/ogc.policy.xsl +1502 -401
  25. data/lib/isodoc/ogc/ogc.reference-model.xsl +1502 -401
  26. data/lib/isodoc/ogc/ogc.release-notes.xsl +1502 -401
  27. data/lib/isodoc/ogc/ogc.standard.xsl +1502 -401
  28. data/lib/isodoc/ogc/ogc.test-suite.xsl +1502 -401
  29. data/lib/isodoc/ogc/ogc.user-guide.xsl +1502 -401
  30. data/lib/isodoc/ogc/ogc.white-paper.xsl +1521 -420
  31. data/lib/isodoc/ogc/presentation_xml_convert.rb +14 -10
  32. data/lib/isodoc/ogc/word_convert.rb +3 -4
  33. data/lib/isodoc/ogc/xref.rb +6 -2
  34. data/lib/metanorma/ogc/biblio.rng +69 -42
  35. data/lib/metanorma/ogc/isodoc.rng +65 -0
  36. data/lib/metanorma/ogc/version.rb +1 -1
  37. data/lib/relaton/render/config.yml +10 -0
  38. data/lib/relaton/render/date.rb +9 -0
  39. data/lib/relaton/render/fields.rb +23 -0
  40. data/lib/relaton/render/general.rb +25 -0
  41. data/lib/relaton/render/parse.rb +11 -0
  42. data/metanorma-ogc.gemspec +1 -1
  43. metadata +10 -5
@@ -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
@@ -97,7 +98,7 @@ module IsoDoc
97
98
 
98
99
  def example1(elem)
99
100
  lbl = @xrefs.anchor(elem["id"], :label, false) or return
100
- prefix_name(elem, " — ", l10n("#{@i18n.example} #{lbl}"),
101
+ prefix_name(elem, " — ", l10n("#{@i18n.example} #{lbl}"),
101
102
  "name")
102
103
  end
103
104
 
@@ -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
@@ -230,6 +222,18 @@ module IsoDoc
230
222
  bibitem["hidden"] == "true" || bibitem.parent["hidden"] == "true"
231
223
  end
232
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
235
+ end
236
+
233
237
  include Init
234
238
  end
235
239
  end
@@ -102,7 +102,7 @@ module IsoDoc
102
102
  submitters docxml, div2
103
103
  preface docxml, div2
104
104
  acknowledgements docxml, div2
105
- div2.p { |p| p << "&nbsp;" } # placeholder
105
+ div2.p { |p| p << "&#xA0;" } # placeholder
106
106
  end
107
107
  section_break(body)
108
108
  end
@@ -159,14 +159,13 @@ module IsoDoc
159
159
  result = from_xhtml(word_cleanup(to_xhtml(result)))
160
160
  .gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
161
161
  @wordstylesheet = wordstylesheet_update
162
- Html2Doc.process(
163
- result,
162
+ Html2Doc.new(
164
163
  filename: filename, imagedir: @localdir,
165
164
  stylesheet: @wordstylesheet&.path,
166
165
  header_file: header&.path, dir: dir,
167
166
  asciimathdelims: [@openmathdelim, @closemathdelim],
168
167
  liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" }
169
- )
168
+ ).process(result)
170
169
  header&.unlink
171
170
  @wordstylesheet.unlink if @wordstylesheet.is_a?(Tempfile)
172
171
  end
@@ -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]} (draft)" }
224
+ @anchors[ref["id"]] = { xref: "#{@anchors[ref['id']][:xref]} (draft)" }
221
225
  end
222
226
  end
223
227
  end
@@ -614,12 +614,12 @@
614
614
  <optional>
615
615
  <ref name="fetched"/>
616
616
  </optional>
617
- <choice>
618
- <oneOrMore>
619
- <ref name="btitle"/>
620
- </oneOrMore>
617
+ <optional>
621
618
  <ref name="formattedref"/>
622
- </choice>
619
+ </optional>
620
+ <oneOrMore>
621
+ <ref name="btitle"/>
622
+ </oneOrMore>
623
623
  <zeroOrMore>
624
624
  <ref name="bsource"/>
625
625
  </zeroOrMore>
@@ -851,17 +851,46 @@
851
851
  </define>
852
852
  <define name="bplace">
853
853
  <element name="place">
854
- <optional>
855
- <attribute name="uri">
856
- <data type="anyURI"/>
857
- </attribute>
858
- </optional>
859
- <optional>
860
- <attribute name="region"/>
861
- </optional>
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">
862
870
  <text/>
863
871
  </element>
864
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>
865
894
  <define name="bprice">
866
895
  <element name="price">
867
896
  <attribute name="currency"/>
@@ -957,36 +986,34 @@
957
986
  <ref name="SeriesType"/>
958
987
  </attribute>
959
988
  </optional>
960
- <choice>
989
+ <optional>
961
990
  <ref name="formattedref"/>
962
- <group>
963
- <ref name="btitle"/>
964
- <optional>
965
- <ref name="bplace"/>
966
- </optional>
967
- <optional>
968
- <ref name="seriesorganization"/>
969
- </optional>
970
- <optional>
971
- <ref name="abbreviation"/>
972
- </optional>
973
- <optional>
974
- <ref name="seriesfrom"/>
975
- </optional>
976
- <optional>
977
- <ref name="seriesto"/>
978
- </optional>
979
- <optional>
980
- <ref name="seriesnumber"/>
981
- </optional>
982
- <optional>
983
- <ref name="seriespartnumber"/>
984
- </optional>
985
- <optional>
986
- <ref name="seriesrun"/>
987
- </optional>
988
- </group>
989
- </choice>
991
+ </optional>
992
+ <ref name="btitle"/>
993
+ <optional>
994
+ <ref name="bplace"/>
995
+ </optional>
996
+ <optional>
997
+ <ref name="seriesorganization"/>
998
+ </optional>
999
+ <optional>
1000
+ <ref name="abbreviation"/>
1001
+ </optional>
1002
+ <optional>
1003
+ <ref name="seriesfrom"/>
1004
+ </optional>
1005
+ <optional>
1006
+ <ref name="seriesto"/>
1007
+ </optional>
1008
+ <optional>
1009
+ <ref name="seriesnumber"/>
1010
+ </optional>
1011
+ <optional>
1012
+ <ref name="seriespartnumber"/>
1013
+ </optional>
1014
+ <optional>
1015
+ <ref name="seriesrun"/>
1016
+ </optional>
990
1017
  </element>
991
1018
  </define>
992
1019
  <define name="SeriesType">
@@ -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>
@@ -245,6 +282,9 @@
245
282
  <ref name="MultilingualRenderingType"/>
246
283
  </attribute>
247
284
  </optional>
285
+ <optional>
286
+ <ref name="tname"/>
287
+ </optional>
248
288
  <oneOrMore>
249
289
  <ref name="ul_li"/>
250
290
  </oneOrMore>
@@ -287,6 +327,9 @@
287
327
  </choice>
288
328
  </attribute>
289
329
  </optional>
330
+ <optional>
331
+ <ref name="tname"/>
332
+ </optional>
290
333
  <oneOrMore>
291
334
  <ref name="li"/>
292
335
  </oneOrMore>
@@ -323,6 +366,9 @@
323
366
  <ref name="MultilingualRenderingType"/>
324
367
  </attribute>
325
368
  </optional>
369
+ <optional>
370
+ <ref name="tname"/>
371
+ </optional>
326
372
  <oneOrMore>
327
373
  <ref name="dt"/>
328
374
  <ref name="dd"/>
@@ -851,6 +897,16 @@
851
897
  <ref name="MultilingualRenderingType"/>
852
898
  </attribute>
853
899
  </optional>
900
+ <optional>
901
+ <attribute name="coverpage">
902
+ <data type="boolean"/>
903
+ </attribute>
904
+ </optional>
905
+ <optional>
906
+ <attribute name="notag">
907
+ <data type="boolean"/>
908
+ </attribute>
909
+ </optional>
854
910
  <oneOrMore>
855
911
  <choice>
856
912
  <ref name="paragraph"/>
@@ -1178,6 +1234,7 @@
1178
1234
  <ref name="concept"/>
1179
1235
  <ref name="add"/>
1180
1236
  <ref name="del"/>
1237
+ <ref name="span"/>
1181
1238
  </choice>
1182
1239
  </define>
1183
1240
  <define name="add">
@@ -1204,6 +1261,14 @@
1204
1261
  </choice>
1205
1262
  </element>
1206
1263
  </define>
1264
+ <define name="span">
1265
+ <element name="span">
1266
+ <attribute name="class"/>
1267
+ <oneOrMore>
1268
+ <ref name="TextElement"/>
1269
+ </oneOrMore>
1270
+ </element>
1271
+ </define>
1207
1272
  <define name="concept">
1208
1273
  <element name="concept">
1209
1274
  <optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.0.8.1".freeze
3
+ VERSION = "2.1.2".freeze
4
4
  end
5
5
  end
@@ -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,9 @@
1
+ module Relaton
2
+ module Render
3
+ class Date
4
+ def render
5
+ @date&.sub(/-.*$/, "")
6
+ end
7
+ end
8
+ end
9
+ end
@@ -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
@@ -0,0 +1,11 @@
1
+ module Relaton
2
+ module Render
3
+ module Ogc
4
+ class Parse < ::Relaton::Render::Parse
5
+ def creatornames_roles_allowed
6
+ %w(author performer adapter translator editor)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -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.0.0"
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.8.1
4
+ version: 2.1.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: 2022-04-20 00:00:00.000000000 Z
11
+ date: 2022-06-06 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.0.0
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.0.0
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:
@@ -285,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
290
  - !ruby/object:Gem::Version
286
291
  version: '0'
287
292
  requirements: []
288
- rubygems_version: 3.3.9
293
+ rubygems_version: 3.3.7
289
294
  signing_key:
290
295
  specification_version: 4
291
296
  summary: Metanorma for the Open Geospatial Consortium.