metanorma-ogc 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/ogc/boilerplate.xml +1 -1
  3. data/lib/asciidoctor/ogc/converter.rb +25 -1
  4. data/lib/asciidoctor/ogc/isodoc.rng +0 -1
  5. data/lib/asciidoctor/ogc/validate.rb +1 -1
  6. data/lib/isodoc/ogc/html/_coverpage.css +6 -0
  7. data/lib/isodoc/ogc/html/_coverpage.scss +8 -0
  8. data/lib/isodoc/ogc/html/html_ogc_titlepage.html +3 -3
  9. data/lib/isodoc/ogc/html/htmlstyle.css +7 -1
  10. data/lib/isodoc/ogc/html/word_ogc_titlepage.html +1 -1
  11. data/lib/isodoc/ogc/html_convert.rb +1 -0
  12. data/lib/isodoc/ogc/i18n-en.yaml +10 -0
  13. data/lib/isodoc/ogc/init.rb +1 -1
  14. data/lib/isodoc/ogc/metadata.rb +1 -1
  15. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +314 -63
  16. data/lib/isodoc/ogc/ogc.best-practice.xsl +314 -63
  17. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +314 -63
  18. data/lib/isodoc/ogc/ogc.community-practice.xsl +314 -63
  19. data/lib/isodoc/ogc/ogc.community-standard.xsl +314 -63
  20. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +314 -63
  21. data/lib/isodoc/ogc/ogc.engineering-report.xsl +314 -63
  22. data/lib/isodoc/ogc/ogc.other.xsl +314 -63
  23. data/lib/isodoc/ogc/ogc.policy.xsl +314 -63
  24. data/lib/isodoc/ogc/ogc.reference-model.xsl +314 -63
  25. data/lib/isodoc/ogc/ogc.release-notes.xsl +314 -63
  26. data/lib/isodoc/ogc/ogc.standard.xsl +314 -63
  27. data/lib/isodoc/ogc/ogc.test-suite.xsl +314 -63
  28. data/lib/isodoc/ogc/ogc.user-guide.xsl +314 -63
  29. data/lib/isodoc/ogc/ogc.white-paper.xsl +281 -46
  30. data/lib/isodoc/ogc/presentation_xml_convert.rb +12 -0
  31. data/lib/isodoc/ogc/sections.rb +6 -1
  32. data/lib/isodoc/ogc/word_convert.rb +1 -0
  33. data/lib/isodoc/ogc/xref.rb +30 -5
  34. data/lib/metanorma/ogc/version.rb +1 -1
  35. metadata +2 -2
@@ -15,6 +15,7 @@ module IsoDoc
15
15
  def insert_preface_sections(docxml)
16
16
  insert_keywords(docxml)
17
17
  insert_submitting_orgs(docxml)
18
+ insert_security(docxml)
18
19
  end
19
20
 
20
21
  def preface_init_insert_pt(docxml)
@@ -30,6 +31,17 @@ module IsoDoc
30
31
  docxml.at(ns("//preface/abstract"))
31
32
  end
32
33
 
34
+ def insert_security(docxml)
35
+ s = docxml&.at(ns("//preface/clause[@type = 'security']"))&.remove or
36
+ return
37
+ if a = submit_orgs_append_pt(docxml)
38
+ a.next = s
39
+ else
40
+ preface_init_insert_pt(docxml)&.children&.first&.
41
+ add_previous_sibling(s)
42
+ end
43
+ end
44
+
33
45
  def insert_submitting_orgs(docxml)
34
46
  orgs = []
35
47
  docxml.xpath(ns(submittingorgs_path)).each { |org| orgs << org.text }
@@ -18,6 +18,11 @@ module IsoDoc
18
18
  intro_clause(f, out)
19
19
  end
20
20
 
21
+ def security(docxml, out)
22
+ f = docxml.at(ns("//preface/clause[@type = 'security']")) || return
23
+ intro_clause(f, out)
24
+ end
25
+
21
26
  def submitters(docxml, out)
22
27
  f = docxml.at(ns("//submitters")) || return
23
28
  intro_clause(f, out)
@@ -25,7 +30,7 @@ module IsoDoc
25
30
 
26
31
  def preface(isoxml, out)
27
32
  isoxml.xpath(ns("//preface/clause[not(@type = 'keywords' or "\
28
- "@type = 'submitting_orgs')]")).each do |f|
33
+ "@type = 'submitting_orgs' or @type = 'security')]")).each do |f|
29
34
  intro_clause(f, out)
30
35
  end
31
36
  end
@@ -144,6 +144,7 @@ module IsoDoc
144
144
  keywords docxml, div2
145
145
  foreword docxml, div2
146
146
  introduction docxml, div2
147
+ security docxml, div2
147
148
  submittingorgs docxml, div2
148
149
  submitters docxml, div2
149
150
  preface docxml, div2
@@ -107,11 +107,12 @@ module IsoDoc
107
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
+ preface_names_numbered(d.at(ns("//preface/clause[@type = 'security']")))
110
111
  preface_names_numbered(d.at(ns("//preface/clause"\
111
112
  "[@type = 'submitting_orgs']")))
112
113
  preface_names_numbered(d.at(ns("//submitters")))
113
114
  d.xpath(ns("//preface/clause[not(@type = 'keywords' or "\
114
- "@type = 'submitting_orgs')]")).each do |c|
115
+ "@type = 'submitting_orgs' or @type = 'security')]")).each do |c|
115
116
  preface_names_numbered(c)
116
117
  end
117
118
  preface_names_numbered(d.at(ns("//acknowledgements")))
@@ -143,13 +144,37 @@ module IsoDoc
143
144
  def preface_names_numbered(clause)
144
145
  return if clause.nil?
145
146
  @prefacenum += 1
146
- pref = RomanNumerals.to_roman(@prefacenum).downcase
147
+ pref = preface_number(@prefacenum, 1)
147
148
  @anchors[clause["id"]] =
148
149
  { label: pref,
149
150
  level: 1, xref: preface_clause_name(clause), type: "clause" }
150
- clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
151
- "./references")).each_with_index do |c, i|
152
- section_names1(c, "#{pref}.#{i + 1}", 2)
151
+ clause.xpath(ns(SUBCLAUSES)).each_with_index do |c, i|
152
+ preface_names_numbered1(c, "#{pref}.#{preface_number(i + 1, 2)}", 2)
153
+ end
154
+ end
155
+
156
+ def preface_names_numbered1(clause, num, level)
157
+ @anchors[clause["id"]] =
158
+ { label: num, level: level, xref: l10n("#{@labels["clause"]} #{num}"),
159
+ type: "clause" }
160
+ clause.xpath(ns(SUBCLAUSES)).each_with_index do |c, i|
161
+ lbl = "#{num}.#{preface_number(i + 1, level + 1)}"
162
+ preface_names_numbered1(c, lbl, level + 1)
163
+ end
164
+ end
165
+
166
+ def preface_number(num, level)
167
+ case level
168
+ when 1 then RomanNumerals.to_roman(num).upcase
169
+ when 2 then (64 + num).chr.to_s
170
+ when 3 then num.to_s
171
+ when 4 then (96 + num).chr.to_s
172
+ when 5 then RomanNumerals.to_roman(num).downcase
173
+ when 6 then "(#{num.to_s})"
174
+ when 7 then "(#{(96 + num).chr.to_s})"
175
+ when 8 then "(#{RomanNumerals.to_roman(num).downcase})"
176
+ else
177
+ num.to_s
153
178
  end
154
179
  end
155
180
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "1.2.4"
3
+ VERSION = "1.2.5"
4
4
  end
5
5
  end
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: 1.2.4
4
+ version: 1.2.5
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-09-26 00:00:00.000000000 Z
11
+ date: 2020-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc