metanorma-ogc 1.1.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -0
  3. data/lib/asciidoctor/ogc/boilerplate.xml +3 -3
  4. data/lib/asciidoctor/ogc/converter.rb +12 -8
  5. data/lib/asciidoctor/ogc/front.rb +8 -20
  6. data/lib/asciidoctor/ogc/isodoc.rng +16 -7
  7. data/lib/asciidoctor/ogc/validate.rb +13 -25
  8. data/lib/isodoc/ogc/base_convert.rb +33 -48
  9. data/lib/isodoc/ogc/biblio.rb +33 -4
  10. data/lib/isodoc/ogc/html/_coverpage.css +195 -0
  11. data/lib/isodoc/ogc/html/header_wp.html +210 -0
  12. data/lib/isodoc/ogc/html/htmlstyle.css +1084 -0
  13. data/lib/isodoc/ogc/html/logo.png +0 -0
  14. data/lib/isodoc/ogc/html/ogc.css +838 -0
  15. data/lib/isodoc/ogc/html/ogc.scss +4 -2
  16. data/lib/isodoc/ogc/html/ogc_wp.css +758 -0
  17. data/lib/isodoc/ogc/html/ogc_wp.scss +724 -0
  18. data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +14 -0
  19. data/lib/isodoc/ogc/html/word_ogc_titlepage_wp.html +175 -0
  20. data/lib/isodoc/ogc/html/wordstyle.css +1253 -0
  21. data/lib/isodoc/ogc/html/wordstyle.scss +8 -9
  22. data/lib/isodoc/ogc/html/wordstyle_wp.css +1181 -0
  23. data/lib/isodoc/ogc/html/wordstyle_wp.scss +1093 -0
  24. data/lib/isodoc/ogc/html_convert.rb +3 -0
  25. data/lib/isodoc/ogc/i18n-en.yaml +1 -0
  26. data/lib/isodoc/ogc/i18n.rb +10 -0
  27. data/lib/isodoc/ogc/init.rb +41 -0
  28. data/lib/isodoc/ogc/metadata.rb +31 -28
  29. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +1899 -1618
  30. data/lib/isodoc/ogc/ogc.best-practice.xsl +1899 -1618
  31. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +1899 -1618
  32. data/lib/isodoc/ogc/ogc.community-practice.xsl +1899 -1618
  33. data/lib/isodoc/ogc/ogc.community-standard.xsl +1899 -1618
  34. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +1899 -1618
  35. data/lib/isodoc/ogc/ogc.engineering-report.xsl +1899 -1618
  36. data/lib/isodoc/ogc/ogc.other.xsl +1899 -1618
  37. data/lib/isodoc/ogc/ogc.policy.xsl +1899 -1618
  38. data/lib/isodoc/ogc/ogc.reference-model.xsl +1899 -1618
  39. data/lib/isodoc/ogc/ogc.release-notes.xsl +1899 -1618
  40. data/lib/isodoc/ogc/ogc.standard.xsl +1899 -1618
  41. data/lib/isodoc/ogc/ogc.test-suite.xsl +1899 -1618
  42. data/lib/isodoc/ogc/ogc.user-guide.xsl +1899 -1618
  43. data/lib/isodoc/ogc/ogc.white-paper.xsl +2264 -2218
  44. data/lib/isodoc/ogc/presentation_xml_convert.rb +134 -1
  45. data/lib/isodoc/ogc/reqt.rb +91 -124
  46. data/lib/isodoc/ogc/sections.rb +18 -64
  47. data/lib/isodoc/ogc/word_convert.rb +23 -3
  48. data/lib/isodoc/ogc/xref.rb +28 -23
  49. data/lib/metanorma/ogc/version.rb +1 -1
  50. data/metanorma-ogc.gemspec +3 -4
  51. metadata +34 -34
@@ -1,4 +1,5 @@
1
1
  require_relative "base_convert"
2
+ require_relative "init"
2
3
  require "fileutils"
3
4
  require "isodoc"
4
5
  require_relative "metadata"
@@ -36,6 +37,20 @@ module IsoDoc
36
37
  }
37
38
  end
38
39
 
40
+ def convert1(docxml, filename, dir)
41
+ if docxml&.at(ns('//bibdata/ext/doctype'))&.text == "white-paper"
42
+ @wordstylesheet_name = html_doc_path("wordstyle_wp.scss")
43
+ @standardstylesheet_name = html_doc_path("ogc_wp.scss")
44
+ @wordcoverpage = html_doc_path("word_ogc_titlepage_wp.html")
45
+ @wordintropage = html_doc_path("word_ogc_intro_wp.html")
46
+ @header = html_doc_path("header_wp.html")
47
+ @doctype = "white-paper"
48
+ options[:bodyfont] = '"Arial",sans-serif'
49
+ options[:headerfont] = '"Lato",sans-serif'
50
+ end
51
+ super
52
+ end
53
+
39
54
  def make_body(xml, docxml)
40
55
  body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72" }
41
56
  xml.body **body_attr do |body|
@@ -124,6 +139,7 @@ module IsoDoc
124
139
  @prefacenum = 0
125
140
  info docxml, div2
126
141
  boilerplate docxml, div2
142
+ preface_block docxml, div2
127
143
  abstract docxml, div2
128
144
  keywords docxml, div2
129
145
  foreword docxml, div2
@@ -156,9 +172,12 @@ module IsoDoc
156
172
  # center only the Copyright notice
157
173
  def word_copyright_cleanup(docxml)
158
174
  x = "//div[@class = 'boilerplate-copyright']/div[1]/p[not(@class)]"
159
- docxml.xpath(x).each do |p|
160
- p["align"] = "center"
161
- end
175
+ docxml.xpath(x).each { |p| p["align"] = "center" }
176
+ return unless @doctype == "white-paper"
177
+ docxml.xpath("//div[@class = 'boilerplate-copyright']//p[not(@class)]").
178
+ each { |p| p["class"] = "license" }
179
+ docxml.xpath("//div[@class = 'boilerplate-legal']//p[not(@class)]").
180
+ each { |p| p["class"] = "license" }
162
181
  end
163
182
 
164
183
  def word_term_cleanup(docxml)
@@ -182,6 +201,7 @@ module IsoDoc
182
201
  end
183
202
 
184
203
  include BaseConvert
204
+ include Init
185
205
  end
186
206
  end
187
207
  end
@@ -17,7 +17,8 @@ module IsoDoc
17
17
  clause.xpath(ns(".//#{klass}#{FIRST_LVL_REQ}")).each do |t|
18
18
  next if t["id"].nil? || t["id"].empty?
19
19
  id = c.increment(t).print
20
- @anchors[t["id"]] = anchor_struct(id, t, label, klass, t["unnumbered"])
20
+ @anchors[t["id"]] = anchor_struct(id, t, label, klass,
21
+ t["unnumbered"])
21
22
  l = t.at(ns("./label"))&.text and @reqtlabels[l] = t["id"]
22
23
  sequential_permission_children(t, id)
23
24
  end
@@ -38,9 +39,8 @@ module IsoDoc
38
39
  def sequential_permission_children(t, id)
39
40
  req_class_paths.each do |k, v|
40
41
  %w(permission requirement recommendation).each do |r|
41
- sequential_permission_names1(t, id, "#{r}[#{v}]", @labels["#{r}#{k}"])
42
- sequential_permission_names1(t, id, "#{r}[#{v}]", @labels["#{r}#{k}"])
43
- sequential_permission_names1(t, id, "#{r}[#{v}]", @labels["#{r}#{k}"])
42
+ sequential_permission_names1(t, id, "#{r}[#{v}]",
43
+ @labels["#{r}#{k}"])
44
44
  end
45
45
  end
46
46
  req_class_paths2.each do |k, v|
@@ -53,7 +53,8 @@ module IsoDoc
53
53
  block.xpath(ns("./#{klass}")).each do |t|
54
54
  next if t["id"].nil? || t["id"].empty?
55
55
  id = "#{lbl}#{hierfigsep}#{c.increment(t).print}"
56
- @anchors[t["id"]] = anchor_struct(id, t, label, klass, t["unnumbered"])
56
+ @anchors[t["id"]] = anchor_struct(id, t, label, klass,
57
+ t["unnumbered"])
57
58
  sequential_permission_children(t, id)
58
59
  end
59
60
  end
@@ -64,9 +65,8 @@ module IsoDoc
64
65
  sequential_formula_names(clause)
65
66
  req_class_paths.each do |k, v|
66
67
  %w(permission requirement recommendation).each do |r|
67
- sequential_permission_names(clause, "#{r}[#{v}]", @labels["#{r}#{k}"])
68
- sequential_permission_names(clause, "#{r}[#{v}]", @labels["#{r}#{k}"])
69
- sequential_permission_names(clause, "#{r}[#{v}]", @labels["#{r}#{k}"])
68
+ sequential_permission_names(clause, "#{r}[#{v}]",
69
+ @labels["#{r}#{k}"])
70
70
  end
71
71
  end
72
72
  req_class_paths2.each do |k, v|
@@ -80,9 +80,8 @@ module IsoDoc
80
80
  hierarchical_formula_names(clause, num)
81
81
  req_class_paths.each do |k, v|
82
82
  %w(permission requirement recommendation).each do |r|
83
- hierarchical_permission_names(clause, num, "#{r}[#{v}]", @labels["#{r}#{k}"])
84
- hierarchical_permission_names(clause, num, "#{r}[#{v}]", @labels["#{r}#{k}"])
85
- hierarchical_permission_names(clause, num, "#{r}[#{v}]", @labels["#{r}#{k}"])
83
+ hierarchical_permission_names(clause, num, "#{r}[#{v}]",
84
+ @labels["#{r}#{k}"])
86
85
  end
87
86
  end
88
87
  req_class_paths2.each do |k, v|
@@ -95,7 +94,8 @@ module IsoDoc
95
94
  clause.xpath(ns(".//#{klass}#{FIRST_LVL_REQ}")).each do |t|
96
95
  next if t["id"].nil? || t["id"].empty?
97
96
  lbl = "#{num}#{hiersep}#{c.increment(t).print}"
98
- @anchors[t["id"]] = anchor_struct(lbl, t, label, klass, t["unnumbered"])
97
+ @anchors[t["id"]] = anchor_struct(lbl, t, label, klass,
98
+ t["unnumbered"])
99
99
  l = t.at(ns("./label"))&.text and @reqtlabels[l] = t["id"]
100
100
  sequential_permission_children(t, lbl)
101
101
  end
@@ -104,23 +104,23 @@ module IsoDoc
104
104
  def initial_anchor_names(d)
105
105
  @prefacenum = 0
106
106
  preface_names_numbered(d.at(ns("//preface/abstract")))
107
- @prefacenum += 1 if d.at(ns("//keyword"))
107
+ preface_names_numbered(d.at(ns("//preface/clause[@type = 'keywords']")))
108
108
  preface_names_numbered(d.at(ns("//foreword")))
109
109
  preface_names_numbered(d.at(ns("//introduction")))
110
- @prefacenum += 1 if d.at(ns(@klass.submittingorgs_path))
110
+ preface_names_numbered(d.at(ns("//preface/clause"\
111
+ "[@type = 'submitting_orgs']")))
111
112
  preface_names_numbered(d.at(ns("//submitters")))
112
- d.xpath(ns("//preface/clause")).each do |c|
113
+ d.xpath(ns("//preface/clause[not(@type = 'keywords' or "\
114
+ "@type = 'submitting_orgs')]")).each do |c|
113
115
  preface_names_numbered(c)
114
116
  end
115
117
  preface_names_numbered(d.at(ns("//acknowledgements")))
116
118
  sequential_asset_names(d.xpath(ns(
117
119
  "//preface/abstract | //foreword | //introduction | "\
118
120
  "//submitters | //acknowledgements | //preface/clause")))
119
- n = section_names(d.at(ns("//clause[title = 'Scope']")), 0, 1)
120
- n = section_names(d.at(ns("//clause[title = 'Conformance']")), n, 1)
121
- n = section_names(d.at(ns(
122
- "//references[title = 'Normative References' or "\
123
- "title = 'Normative references']")), n, 1)
121
+ n = section_names(d.at(ns("//clause[@type = 'scope']")), 0, 1)
122
+ n = section_names(d.at(ns("//clause[@type = 'conformance']")), n, 1)
123
+ n = section_names(d.at(ns(@klass.norm_ref_xpath)), n, 1)
124
124
  n = section_names(
125
125
  d.at(ns("//sections/terms | //sections/clause[descendant::terms]")),
126
126
  n, 1)
@@ -132,11 +132,10 @@ module IsoDoc
132
132
  end
133
133
 
134
134
  def middle_section_asset_names(d)
135
- middle_sections = "//clause[title = 'Scope' or title = 'Conformance'] "\
135
+ middle_sections = "//clause[@type = 'scope' or @type = 'conformance'] "\
136
136
  "| //foreword | //introduction | //preface/abstract | "\
137
137
  "//submitters | //acknowledgements | //preface/clause | "\
138
- "//references[title = 'Normative References' or title = "\
139
- "'Normative references'] | //sections/terms | "\
138
+ " #{@klass.norm_ref_xpath} | //sections/terms | "\
140
139
  "//sections/definitions | //clause[parent::sections]"
141
140
  sequential_asset_names(d.xpath(ns(middle_sections)))
142
141
  end
@@ -153,6 +152,12 @@ module IsoDoc
153
152
  section_names1(c, "#{pref}.#{i + 1}", 2)
154
153
  end
155
154
  end
155
+
156
+ def reference_names(ref)
157
+ super
158
+ return unless @klass.ogc_draft_ref?(ref)
159
+ @anchors[ref["id"]] = { xref: @anchors[ref["id"]][:xref] + " (draft)" }
160
+ end
156
161
  end
157
162
  end
158
163
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.2"
4
4
  end
5
5
  end
@@ -24,13 +24,12 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ["lib"]
25
25
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
26
26
 
27
- spec.add_dependency "htmlentities", "~> 4.3.4"
28
- spec.add_dependency "ruby-jing"
29
- spec.add_dependency "metanorma-standoc", "~> 1.4.0"
30
- spec.add_dependency "isodoc", "~> 1.1.0"
27
+ spec.add_dependency "metanorma-standoc", "~> 1.5.0"
28
+ spec.add_dependency "isodoc", "~> 1.2.0"
31
29
  spec.add_dependency "iso-639"
32
30
 
33
31
  spec.add_development_dependency "byebug", "~> 9.1"
32
+ spec.add_development_dependency "sassc", "2.4.0"
34
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
35
34
  spec.add_development_dependency "guard", "~> 2.14"
36
35
  spec.add_development_dependency "guard-rspec", "~> 4.7"
metadata CHANGED
@@ -1,71 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.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-07-10 00:00:00.000000000 Z
11
+ date: 2020-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: htmlentities
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 4.3.4
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 4.3.4
27
- - !ruby/object:Gem::Dependency
28
- name: ruby-jing
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: metanorma-standoc
43
15
  requirement: !ruby/object:Gem::Requirement
44
16
  requirements:
45
17
  - - "~>"
46
18
  - !ruby/object:Gem::Version
47
- version: 1.4.0
19
+ version: 1.5.0
48
20
  type: :runtime
49
21
  prerelease: false
50
22
  version_requirements: !ruby/object:Gem::Requirement
51
23
  requirements:
52
24
  - - "~>"
53
25
  - !ruby/object:Gem::Version
54
- version: 1.4.0
26
+ version: 1.5.0
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: isodoc
57
29
  requirement: !ruby/object:Gem::Requirement
58
30
  requirements:
59
31
  - - "~>"
60
32
  - !ruby/object:Gem::Version
61
- version: 1.1.0
33
+ version: 1.2.0
62
34
  type: :runtime
63
35
  prerelease: false
64
36
  version_requirements: !ruby/object:Gem::Requirement
65
37
  requirements:
66
38
  - - "~>"
67
39
  - !ruby/object:Gem::Version
68
- version: 1.1.0
40
+ version: 1.2.0
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: iso-639
71
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +66,20 @@ dependencies:
94
66
  - - "~>"
95
67
  - !ruby/object:Gem::Version
96
68
  version: '9.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sassc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 2.4.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 2.4.0
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: equivalent-xml
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -243,18 +229,32 @@ files:
243
229
  - lib/isodoc/ogc.rb
244
230
  - lib/isodoc/ogc/base_convert.rb
245
231
  - lib/isodoc/ogc/biblio.rb
232
+ - lib/isodoc/ogc/html/_coverpage.css
246
233
  - lib/isodoc/ogc/html/_coverpage.scss
247
234
  - lib/isodoc/ogc/html/header.html
235
+ - lib/isodoc/ogc/html/header_wp.html
248
236
  - lib/isodoc/ogc/html/html_ogc_intro.html
249
237
  - lib/isodoc/ogc/html/html_ogc_titlepage.html
238
+ - lib/isodoc/ogc/html/htmlstyle.css
250
239
  - lib/isodoc/ogc/html/htmlstyle.scss
240
+ - lib/isodoc/ogc/html/logo.png
241
+ - lib/isodoc/ogc/html/ogc.css
251
242
  - lib/isodoc/ogc/html/ogc.scss
243
+ - lib/isodoc/ogc/html/ogc_wp.css
244
+ - lib/isodoc/ogc/html/ogc_wp.scss
252
245
  - lib/isodoc/ogc/html/scripts.html
253
246
  - lib/isodoc/ogc/html/word_ogc_intro.html
247
+ - lib/isodoc/ogc/html/word_ogc_intro_wp.html
254
248
  - lib/isodoc/ogc/html/word_ogc_titlepage.html
249
+ - lib/isodoc/ogc/html/word_ogc_titlepage_wp.html
250
+ - lib/isodoc/ogc/html/wordstyle.css
255
251
  - lib/isodoc/ogc/html/wordstyle.scss
252
+ - lib/isodoc/ogc/html/wordstyle_wp.css
253
+ - lib/isodoc/ogc/html/wordstyle_wp.scss
256
254
  - lib/isodoc/ogc/html_convert.rb
257
255
  - lib/isodoc/ogc/i18n-en.yaml
256
+ - lib/isodoc/ogc/i18n.rb
257
+ - lib/isodoc/ogc/init.rb
258
258
  - lib/isodoc/ogc/metadata.rb
259
259
  - lib/isodoc/ogc/ogc.abstract-specification-topic.xsl
260
260
  - lib/isodoc/ogc/ogc.best-practice.xsl