metanorma-ogc 1.4.0 → 1.4.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/ogc/boilerplate.xml +6 -6
  3. data/lib/asciidoctor/ogc/cleanup.rb +173 -0
  4. data/lib/asciidoctor/ogc/converter.rb +62 -64
  5. data/lib/asciidoctor/ogc/front.rb +1 -1
  6. data/lib/asciidoctor/ogc/isodoc.rng +211 -11
  7. data/lib/asciidoctor/ogc/reqt.rng +16 -0
  8. data/lib/asciidoctor/ogc/validate.rb +35 -20
  9. data/lib/isodoc/ogc/base_convert.rb +47 -10
  10. data/lib/isodoc/ogc/biblio.rb +57 -51
  11. data/lib/isodoc/ogc/html/htmlstyle.css +10 -0
  12. data/lib/isodoc/ogc/html/htmlstyle.scss +12 -0
  13. data/lib/isodoc/ogc/html/ogc.css +4 -0
  14. data/lib/isodoc/ogc/html/ogc.scss +4 -0
  15. data/lib/isodoc/ogc/i18n-en.yaml +24 -8
  16. data/lib/isodoc/ogc/metadata.rb +1 -1
  17. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +501 -127
  18. data/lib/isodoc/ogc/ogc.best-practice.xsl +501 -127
  19. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +501 -127
  20. data/lib/isodoc/ogc/ogc.community-practice.xsl +501 -127
  21. data/lib/isodoc/ogc/ogc.community-standard.xsl +501 -127
  22. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +501 -127
  23. data/lib/isodoc/ogc/ogc.engineering-report.xsl +501 -127
  24. data/lib/isodoc/ogc/ogc.other.xsl +501 -127
  25. data/lib/isodoc/ogc/ogc.policy.xsl +501 -127
  26. data/lib/isodoc/ogc/ogc.reference-model.xsl +501 -127
  27. data/lib/isodoc/ogc/ogc.release-notes.xsl +501 -127
  28. data/lib/isodoc/ogc/ogc.standard.xsl +501 -127
  29. data/lib/isodoc/ogc/ogc.test-suite.xsl +501 -127
  30. data/lib/isodoc/ogc/ogc.user-guide.xsl +501 -127
  31. data/lib/isodoc/ogc/ogc.white-paper.xsl +358 -66
  32. data/lib/isodoc/ogc/presentation_xml_convert.rb +58 -48
  33. data/lib/isodoc/ogc/reqt.rb +64 -46
  34. data/lib/isodoc/ogc/xref.rb +1 -2
  35. data/lib/metanorma/ogc/version.rb +1 -1
  36. metadata +3 -2
@@ -1,31 +1,31 @@
1
1
  module IsoDoc
2
2
  module Ogc
3
3
  module BaseConvert
4
- def std_bibitem_entry(list, b, ordinal, biblio)
5
- list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
4
+ def std_bibitem_entry(list, bib, ordinal, biblio)
5
+ list.p **attr_code(iso_bibitem_entry_attrs(bib, biblio)) do |ref|
6
6
  prefix_bracketed_ref(ref, "[#{ordinal}]") if biblio
7
- standard_citation(ref, b)
7
+ standard_citation(ref, bib)
8
8
  end
9
9
  end
10
10
 
11
- def nonstd_bibitem(list, b, ordinal, bibliography)
12
- list.p **attr_code(iso_bibitem_entry_attrs(b, bibliography)) do |r|
13
- id = bibitem_ref_code(b)
11
+ def nonstd_bibitem(list, bib, ordinal, bibliography)
12
+ list.p **attr_code(iso_bibitem_entry_attrs(bib, bibliography)) do |r|
13
+ id = bibitem_ref_code(bib)
14
14
  identifier = render_identifier(id)
15
15
  identifier[1] = nil
16
16
  if bibliography
17
17
  ref_entry_code(r, ordinal, identifier, id)
18
18
  end
19
- reference_format(b, r)
19
+ reference_format(bib, r)
20
20
  end
21
21
  end
22
22
 
23
- def reference_format(b, r)
24
- if ftitle = b.at(ns("./formattedref"))
25
- ftitle&.children&.each { |n| parse(n, r) }
23
+ def reference_format(bib, ref)
24
+ if ftitle = bib.at(ns("./formattedref"))
25
+ ftitle&.children&.each { |n| parse(n, ref) }
26
26
  else
27
27
  # eventually will be full LNCS reference
28
- standard_citation(r, b)
28
+ standard_citation(ref, bib)
29
29
  end
30
30
  end
31
31
 
@@ -34,97 +34,101 @@ module IsoDoc
34
34
  end
35
35
 
36
36
  def multiplenames_and(names)
37
- return "" if names.length == 0
37
+ return "" if names.empty?
38
38
  return names[0] if names.length == 1
39
39
  return "#{names[0]} and #{names[1]}" if names.length == 2
40
+
40
41
  names[0..-2].join(", ") + " and #{names[-1]}"
41
42
  end
42
43
 
43
- def nodes_to_span(n)
44
+ def nodes_to_span(node)
44
45
  noko do |xml|
45
46
  xml.span do |s|
46
- n&.children&.each { |x| parse(x, s) }
47
+ node&.children&.each { |x| parse(x, s) }
47
48
  end
48
- end.join("")
49
+ end.join
49
50
  end
50
51
 
51
- def extract_publisher(b)
52
- c = b.xpath(ns("./contributor[role/@type = 'publisher'][organization]"))
52
+ def extract_publisher(bib)
53
53
  abbrs = []
54
54
  names = []
55
- c&.each do |c1|
55
+ bib.xpath(ns("./contributor[role/@type = 'publisher']"\
56
+ "[organization]"))&.each do |c1|
56
57
  n = c1.at(ns("./organization/name")) or next
57
58
  abbrs << (c1.at(ns("./organization/abbreviation")) || n)
58
59
  names << nodes_to_span(n)
59
60
  end
60
61
  return [nil, nil] if names.empty?
61
- return [multiplenames_and(names), (abbrs.map { |x| x.text }).join("/")]
62
+
63
+ [multiplenames_and(names), abbrs.map(&:text).join("/")]
62
64
  end
63
65
 
64
- def extract_author(b)
65
- c = b.xpath(ns("./contributor[role/@type = 'author']"))
66
- c = b.xpath(ns("./contributor[role/@type = 'editor']")) if c.empty?
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?
67
69
  return nil if c.empty?
70
+
68
71
  c.map do |c1|
69
72
  c1&.at(ns("./organization/name"))&.text || extract_person_name(c1)
70
73
  end.reject { |e| e.nil? || e.empty? }.join(", ")
71
74
  end
72
75
 
73
- def extract_person_name(b)
74
- p = b.at(ns("./person/name")) or return
76
+ def extract_person_name(bib)
77
+ p = bib.at(ns("./person/name")) or return
75
78
  c = p.at(ns("./completename")) and return c.text
76
79
  s = p&.at(ns("./surname"))&.text or return
77
80
  i = p.xpath(ns("./initial")) and
78
- front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join("")
81
+ front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join
79
82
  i.empty? and f = p.xpath(ns("./forename")) and
80
- front = f.map { |e| e.text[0].upcase }.join("")
83
+ front = f.map { |e| e.text[0].upcase }.join
81
84
  front ? "#{s} #{front}" : s
82
85
  end
83
86
 
84
-
85
87
  def date_render(date)
86
88
  return nil if date.nil?
89
+
87
90
  on = date&.at(ns("./on"))&.text
88
91
  from = date&.at(ns("./from"))&.text
89
92
  to = date&.at(ns("./to"))&.text
90
93
  return on if on && !on.empty?
91
94
  return "#{from}&ndash;#{to}" if from && !from.empty?
95
+
92
96
  nil
93
97
  end
94
98
 
95
- def extract_year(b)
96
- d = b.at(ns("./date[@type = 'published']")) ||
97
- b.at(ns("./date[@type = 'issued']")) ||
98
- b.at(ns("./date[@type = 'circulated']")) ||
99
- b.at(ns("./date"))
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"))
100
104
  date_render(d)
101
105
  end
102
106
 
103
- def extract_city(b)
104
- b.at(ns("./place"))
107
+ def extract_city(bib)
108
+ bib.at(ns("./place"))
105
109
  end
106
110
 
107
- def extract_uri(b)
108
- b.at(ns("./uri"))
111
+ def extract_uri(bib)
112
+ bib.at(ns("./uri"))
109
113
  end
110
114
 
111
115
  # {author}: {document identifier}, {title}. {publisher}, {city} ({year})
112
- def standard_citation(out, b)
113
- if ftitle = b.at(ns("./formattedref"))
116
+ def standard_citation(out, bib)
117
+ if ftitle = bib.at(ns("./formattedref"))
114
118
  ftitle&.children&.each { |n| parse(n, out) }
115
119
  else
116
- pub, pub_abbrev = extract_publisher(b)
117
- author = extract_author(b)
118
- c = extract_city(b)
119
- y = extract_year(b)
120
- u = extract_uri(b)
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)
121
125
  out << "#{author || pub_abbrev}: " if author || pub_abbrev
122
- id = render_identifier(inline_bibitem_ref_code(b))
126
+ id = render_identifier(inline_bibitem_ref_code(bib))
123
127
  out << id[1] if id[1]
124
- out << " (Draft)" if ogc_draft_ref?(b)
128
+ out << " (Draft)" if ogc_draft_ref?(bib)
125
129
  out << ", "
126
130
  out.i do |i|
127
- iso_title(b)&.children&.each { |n| parse(n, i) }
131
+ iso_title(bib)&.children&.each { |n| parse(n, i) }
128
132
  end
129
133
  out << ". "
130
134
  out << pub if pub
@@ -136,12 +140,14 @@ module IsoDoc
136
140
  end
137
141
  end
138
142
 
139
- def inline_bibitem_ref_code(b)
140
- id = b.at(ns("./docidentifier[not(@type = 'DOI' or @type = 'metanorma' "\
141
- "or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"))
142
- id ||= b.at(ns("./docidentifier[not(@type = 'metanorma')]"))
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 = 'rfc-anchor')]"))
147
+ id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma')]"))
143
148
  return [nil, id, nil] if id
144
- id = Nokogiri::XML::Node.new("docidentifier", b.document)
149
+
150
+ id = Nokogiri::XML::Node.new("docidentifier", bib.document)
145
151
  id << "(NO ID)"
146
152
  [nil, id, nil]
147
153
  end
@@ -784,6 +784,12 @@ ul > li {
784
784
  ul > li:first-child {
785
785
  margin-top: 1em; }
786
786
 
787
+ ul ul > li:first-child {
788
+ margin-top: 0; }
789
+
790
+ ol ul > li:first-child {
791
+ margin-top: 0; }
792
+
787
793
  span.keyword {
788
794
  font-weight: 600; }
789
795
 
@@ -865,6 +871,10 @@ p.AltTerms {
865
871
  font-size: 24px;
866
872
  margin-top: 1em; }
867
873
 
874
+ span.AdmittedLabel {
875
+ color: #00335b;
876
+ background-color: #CFE2F3; }
877
+
868
878
  /* Links, selection */
869
879
  a, a:visited {
870
880
  text-decoration: none;
@@ -273,6 +273,13 @@ ul {
273
273
  }
274
274
  }
275
275
 
276
+ ul ul > li:first-child {
277
+ margin-top: 0;
278
+ }
279
+ ol ul > li:first-child {
280
+ margin-top: 0;
281
+ }
282
+
276
283
 
277
284
  span.keyword {
278
285
  font-weight: 600;
@@ -363,6 +370,11 @@ p.AltTerms {
363
370
  margin-top: 1em;
364
371
  }
365
372
 
373
+ span.AdmittedLabel {
374
+ color: #00335b;
375
+ background-color: #CFE2F3;
376
+ }
377
+
366
378
 
367
379
  /* Links, selection */
368
380
 
@@ -851,3 +851,7 @@ div.warning p {
851
851
 
852
852
  span.hi {
853
853
  background-color: yellow; }
854
+
855
+ span.AdmittedLabel {
856
+ color: #00335b;
857
+ background-color: #CFE2F3; }
@@ -809,3 +809,7 @@ padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt;
809
809
  span.hi {
810
810
  background-color: yellow;
811
811
  }
812
+ span.AdmittedLabel {
813
+ color: #00335b;
814
+ background-color: #CFE2F3;
815
+ }
@@ -1,15 +1,31 @@
1
+ admitted: ADMITTED
1
2
  foreword: Preface
2
3
  submitters: Submitters
3
- recommendationtest: Recommendation Test
4
- requirementtest: Requirement Test
5
- permissiontest: Permission Test
6
- recommendationclass: Recommendation Class
7
- requirementclass: Requirement Class
8
- permissionclass: Permission Class
9
- abstracttest: Abstract Test
10
- conformanceclass: Conformance Class
4
+ recommendationtest: Recommendation test
5
+ requirementtest: Requirement test
6
+ permissiontest: Permission test
7
+ recommendationclass: Recommendations class
8
+ requirementclass: Requirements class
9
+ permissionclass: Permissions class
10
+ abstracttest: Abstract test
11
+ conformanceclass: Conformance class
11
12
  example: Example
12
13
  security_empty: No security considerations have been made for this %.
14
+ internal_terms_boilerplate: |
15
+ <p>This document uses the terms defined in <link target="https://portal.ogc.org/public_ogc/directives/directives.php">OGC Policy Directive 49</link>, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this standard and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.</p>
16
+ <p>This document also uses terms defined in the OGC Standard for Modular specifications (<link target="https://portal.opengeospatial.org/files/?artifact_id=34762">OGC 08-131r3</link>), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.</p>
17
+ <p>For the purposes of this document, the following additional terms and definitions apply.</p>
18
+ external_terms_boilerplate: |
19
+ <p>This document uses the terms defined in <link target="https://portal.ogc.org/public_ogc/directives/directives.php">OGC Policy Directive 49</link>, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this standard and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.</p>
20
+ <p>This document also uses terms defined in the OGC Standard for Modular specifications (<link target="https://portal.opengeospatial.org/files/?artifact_id=34762">OGC 08-131r3</link>), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.</p>
21
+ <p>For the purposes of this document,
22
+ the terms and definitions given in % additionally apply.</p>
23
+ internal_external_terms_boilerplate: |
24
+ <p>This document uses the terms defined in <link target="https://portal.ogc.org/public_ogc/directives/directives.php">OGC Policy Directive 49</link>, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this standard and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.</p>
25
+ <p>This document also uses terms defined in the OGC Standard for Modular specifications (<link target="https://portal.opengeospatial.org/files/?artifact_id=34762">OGC 08-131r3</link>), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.</p>
26
+ <p>For the purposes of this document, the terms and definitions
27
+ given in % and the following additionally apply.</p>
28
+ term_defined_in: "(%)"
13
29
  stage_dict:
14
30
  swg-draft: Candidate SWG Draft
15
31
  oab-review: Candidate OAB Review Draft
@@ -96,7 +96,7 @@ module IsoDoc
96
96
  if t = isoxml&.at(ns("//bibdata/ext/doctype"))&.text
97
97
  set(:doctype, type_capitalise(t))
98
98
  set(:doctype_abbr, doctype_abbr(t))
99
- if st = isoxml&.at(ns("//bibdata/ext/docsubtype"))&.text
99
+ if st = isoxml&.at(ns("//bibdata/ext/subdoctype"))&.text
100
100
  set(:docsubtype, type_capitalise(st))
101
101
  set(:docsubtype_abbr, docsubtype_abbr(st, t))
102
102
  end