metanorma-ogc 1.5.2 → 1.5.3

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/cleanup.rb +9 -0
  3. data/lib/asciidoctor/ogc/converter.rb +4 -2
  4. data/lib/asciidoctor/ogc/isodoc.rng +42 -17
  5. data/lib/asciidoctor/ogc/validate.rb +12 -0
  6. data/lib/isodoc/ogc/base_convert.rb +2 -1
  7. data/lib/isodoc/ogc/html/htmlstyle.css +6 -2
  8. data/lib/isodoc/ogc/html/htmlstyle.scss +6 -1
  9. data/lib/isodoc/ogc/html/ogc.css +0 -1
  10. data/lib/isodoc/ogc/html/ogc.scss +0 -1
  11. data/lib/isodoc/ogc/html/ogc_wp.css +0 -1
  12. data/lib/isodoc/ogc/html/ogc_wp.scss +0 -1
  13. data/lib/isodoc/ogc/html_convert.rb +1 -0
  14. data/lib/isodoc/ogc/metadata.rb +6 -2
  15. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +119 -31
  16. data/lib/isodoc/ogc/ogc.best-practice.xsl +119 -31
  17. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +119 -31
  18. data/lib/isodoc/ogc/ogc.community-practice.xsl +119 -31
  19. data/lib/isodoc/ogc/ogc.community-standard.xsl +119 -31
  20. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +119 -31
  21. data/lib/isodoc/ogc/ogc.engineering-report.xsl +119 -31
  22. data/lib/isodoc/ogc/ogc.other.xsl +119 -31
  23. data/lib/isodoc/ogc/ogc.policy.xsl +119 -31
  24. data/lib/isodoc/ogc/ogc.reference-model.xsl +119 -31
  25. data/lib/isodoc/ogc/ogc.release-notes.xsl +119 -31
  26. data/lib/isodoc/ogc/ogc.standard.xsl +119 -31
  27. data/lib/isodoc/ogc/ogc.test-suite.xsl +119 -31
  28. data/lib/isodoc/ogc/ogc.user-guide.xsl +119 -31
  29. data/lib/isodoc/ogc/ogc.white-paper.xsl +29 -14
  30. data/lib/isodoc/ogc/presentation_xml_convert.rb +31 -2
  31. data/lib/isodoc/ogc/sections.rb +9 -2
  32. data/lib/isodoc/ogc/word_convert.rb +28 -4
  33. data/lib/isodoc/ogc/xref.rb +4 -2
  34. data/lib/metanorma/ogc/version.rb +1 -1
  35. data/metanorma-ogc.gemspec +1 -1
  36. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1eb36cd9acf77e8aa250a285572951349e07d00f78c574538a514bdae30ffc3
4
- data.tar.gz: 9777f0f9a6bbe8204f20449024c2644a0956932bf8b1bf5c2722b809debabfcc
3
+ metadata.gz: b5bb1ae7e71ccb9893d37252f166f957986676100103a0923a916e305d952c03
4
+ data.tar.gz: 3ed27b1075d8dc53266349d70c809427b0c548708a9b6fe4018d8b4666d17f5c
5
5
  SHA512:
6
- metadata.gz: a76271bb1ff825eb70caf9c0858b5b70a5f0fc13d07c7cd2713a3670923a9b4550e743b9a61541fc1fda17bfb2a4e8e9011a2b859b0a7d61c8ec9fde5ac67d4a
7
- data.tar.gz: 3a3ea1f65f90decc18daa92d6958ecb5f4ad8ff61ab6dda324639209516e8b79d90ef1d5eb5e561ca0089b3a603d6c1c18cf4db8139c3daa12f79587c814941c
6
+ metadata.gz: 63c9dc50ccc0094aa55ddf0313c9a5d1274330537d7af307fb5118dc122352d3ecf5f928dcf6f6a6fb686cee588d013eb656fbf1725e67ca6d17dc776428dc88
7
+ data.tar.gz: 73e2d1c0a868d9be6e8320504ffab6062368b95d2af4241e16f4d686e0f4e5bb0d78115a90d1bd3b86d09bc10d50d5ad40380801ac1f2d4ab6d2244bf56cdc94
@@ -10,6 +10,7 @@ module Asciidoctor
10
10
 
11
11
  def make_preface(xml, sect)
12
12
  super
13
+ insert_execsummary(xml, sect)
13
14
  insert_security(xml, sect)
14
15
  insert_submitters(xml, sect)
15
16
  end
@@ -18,6 +19,14 @@ module Asciidoctor
18
19
  %(id="_#{UUIDTools::UUID.random_create}")
19
20
  end
20
21
 
22
+ def insert_execsummary(xml, sect)
23
+ summ = xml&.at("//clause[@type = 'executivesummary']")&.remove or
24
+ return
25
+ preface = sect.at("//preface") ||
26
+ sect.add_previous_sibling("<preface/>").first
27
+ preface.add_child summ
28
+ end
29
+
21
30
  def insert_security(xml, sect)
22
31
  description = "document"
23
32
  description = "standard" if %w(standard community-standard)
@@ -75,8 +75,10 @@ module Asciidoctor
75
75
  case node&.attr("heading")&.downcase || node.title.downcase
76
76
  when "submitters" then return submitters_parse(attrs, xml, node)
77
77
  when "conformance" then attrs = attrs.merge(type: "conformance")
78
- when "security considerations" then attrs =
79
- attrs.merge(type: "security")
78
+ when "security considerations"
79
+ attrs = attrs.merge(type: "security")
80
+ when "executive summary"
81
+ attrs = attrs.merge(type: "executivesummary")
80
82
  end
81
83
  super
82
84
  end
@@ -58,7 +58,7 @@
58
58
  <attribute name="alt"/>
59
59
  </optional>
60
60
  <optional>
61
- <attribute name="updatetype">
61
+ <attribute name="update-type">
62
62
  <data type="boolean"/>
63
63
  </attribute>
64
64
  </optional>
@@ -1814,9 +1814,6 @@
1814
1814
  <optional>
1815
1815
  <ref name="termsubject"/>
1816
1816
  </optional>
1817
- <optional>
1818
- <ref name="termusage"/>
1819
- </optional>
1820
1817
  <oneOrMore>
1821
1818
  <ref name="termdefinition"/>
1822
1819
  </oneOrMore>
@@ -1880,17 +1877,37 @@
1880
1877
  </attribute>
1881
1878
  </optional>
1882
1879
  <optional>
1883
- <attribute name="geographicArea"/>
1880
+ <attribute name="geographic-area"/>
1884
1881
  </optional>
1885
1882
  <choice>
1886
1883
  <ref name="expression_designation"/>
1887
1884
  <ref name="letter_symbol_designation"/>
1888
1885
  <ref name="graphical_symbol_designation"/>
1889
1886
  </choice>
1887
+ <optional>
1888
+ <ref name="fieldofapplication"/>
1889
+ </optional>
1890
+ <optional>
1891
+ <ref name="usageinfo"/>
1892
+ </optional>
1890
1893
  <zeroOrMore>
1891
1894
  <ref name="termsource"/>
1892
1895
  </zeroOrMore>
1893
1896
  </define>
1897
+ <define name="fieldofapplication">
1898
+ <element name="field-of-application">
1899
+ <oneOrMore>
1900
+ <ref name="PureTextElement"/>
1901
+ </oneOrMore>
1902
+ </element>
1903
+ </define>
1904
+ <define name="usageinfo">
1905
+ <element name="usage-info">
1906
+ <oneOrMore>
1907
+ <ref name="PureTextElement"/>
1908
+ </oneOrMore>
1909
+ </element>
1910
+ </define>
1894
1911
  <define name="letter_symbol_designation">
1895
1912
  <element name="letter-symbol">
1896
1913
  <optional>
@@ -1946,7 +1963,7 @@
1946
1963
  </zeroOrMore>
1947
1964
  </element>
1948
1965
  <optional>
1949
- <element name="abbreviationType">
1966
+ <element name="abbreviation-type">
1950
1967
  <ref name="AbbreviationType"/>
1951
1968
  </element>
1952
1969
  </optional>
@@ -1956,7 +1973,7 @@
1956
1973
  </element>
1957
1974
  </optional>
1958
1975
  <optional>
1959
- <element name="grammarInfo">
1976
+ <element name="grammar-info">
1960
1977
  <ref name="Grammar"/>
1961
1978
  </element>
1962
1979
  </optional>
@@ -1983,6 +2000,11 @@
1983
2000
  <ref name="GrammarGender"/>
1984
2001
  </element>
1985
2002
  </zeroOrMore>
2003
+ <zeroOrMore>
2004
+ <element name="number">
2005
+ <ref name="GrammarNumber"/>
2006
+ </element>
2007
+ </zeroOrMore>
1986
2008
  <optional>
1987
2009
  <element name="isPreposition">
1988
2010
  <data type="boolean"/>
@@ -2014,7 +2036,7 @@
2014
2036
  </element>
2015
2037
  </optional>
2016
2038
  <zeroOrMore>
2017
- <element name="grammarvalue">
2039
+ <element name="grammar-value">
2018
2040
  <text/>
2019
2041
  </element>
2020
2042
  </zeroOrMore>
@@ -2027,6 +2049,13 @@
2027
2049
  <value>common</value>
2028
2050
  </choice>
2029
2051
  </define>
2052
+ <define name="GrammarNumber">
2053
+ <choice>
2054
+ <value>singular</value>
2055
+ <value>dual</value>
2056
+ <value>plural</value>
2057
+ </choice>
2058
+ </define>
2030
2059
  <define name="termdomain">
2031
2060
  <element name="domain">
2032
2061
  <oneOrMore>
@@ -2041,13 +2070,6 @@
2041
2070
  </oneOrMore>
2042
2071
  </element>
2043
2072
  </define>
2044
- <define name="termusage">
2045
- <element name="usageinfo">
2046
- <oneOrMore>
2047
- <ref name="BasicBlock"/>
2048
- </oneOrMore>
2049
- </element>
2050
- </define>
2051
2073
  <define name="termdefinition">
2052
2074
  <element name="definition">
2053
2075
  <choice>
@@ -2061,13 +2083,16 @@
2061
2083
  </element>
2062
2084
  </define>
2063
2085
  <define name="verbaldefinition">
2064
- <element name="verbaldefinition">
2086
+ <element name="verbal-definition">
2065
2087
  <oneOrMore>
2066
2088
  <choice>
2067
2089
  <ref name="paragraph"/>
2068
2090
  <ref name="dl"/>
2069
2091
  <ref name="ol"/>
2070
2092
  <ref name="ul"/>
2093
+ <ref name="table"/>
2094
+ <ref name="figure"/>
2095
+ <ref name="formula"/>
2071
2096
  </choice>
2072
2097
  </oneOrMore>
2073
2098
  <zeroOrMore>
@@ -2076,7 +2101,7 @@
2076
2101
  </element>
2077
2102
  </define>
2078
2103
  <define name="nonverbalrep">
2079
- <element name="nonverbalrepresentation">
2104
+ <element name="non-verbal-representation">
2080
2105
  <oneOrMore>
2081
2106
  <choice>
2082
2107
  <ref name="table"/>
@@ -57,8 +57,20 @@ module Asciidoctor
57
57
  end
58
58
  end
59
59
 
60
+ def execsummary_validate(xmldoc)
61
+ doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
62
+ sect = xmldoc&.at("//clause[@type = 'executivesummary']")
63
+ doctype == "engineering-report" && sect.nil? and
64
+ @log.add("Style", nil,
65
+ "Executive Summary required for Engineering Reports!")
66
+ doctype != "engineering-report" && !sect.nil? and
67
+ @log.add("Style", nil,
68
+ "Executive Summary only allowed for Engineering Reports!")
69
+ end
70
+
60
71
  def section_validate(doc)
61
72
  preface_sequence_validate(doc.root)
73
+ execsummary_validate(doc.root)
62
74
  sections_sequence_validate(doc.root)
63
75
  super
64
76
  end
@@ -138,7 +138,8 @@ module IsoDoc
138
138
  return super unless (node["class"] == "steps") ||
139
139
  node.at(".//ancestor::xmlns:ol[@class = 'steps']")
140
140
 
141
- ol_style(:arabic)
141
+ idx = node.xpath("./ancestor-or-self::xmlns:ol[@class = 'steps']").size
142
+ ol_style(%i(arabic alphabet roman alphabet_upper roman_upper)[(idx - 1) % 5])
142
143
  end
143
144
  end
144
145
  end
@@ -863,9 +863,11 @@ p.TableTitle {
863
863
  font-weight: 400; }
864
864
 
865
865
  /* Terms */
866
+ .TermNum {
867
+ font-weight: 300; }
868
+
866
869
  .TermNum, .Terms, .AltTerms {
867
870
  color: #00335b;
868
- font-weight: 300;
869
871
  font-family: {{headerfont}}; }
870
872
 
871
873
  h2.TermNum {
@@ -877,7 +879,9 @@ p.AltTerms {
877
879
 
878
880
  span.AdmittedLabel {
879
881
  color: #00335b;
880
- background-color: #CFE2F3; }
882
+ background-color: #CFE2F3;
883
+ font-size: 70%;
884
+ vertical-align: top; }
881
885
 
882
886
  /* Links, selection */
883
887
  a, a:visited {
@@ -355,9 +355,12 @@ p.TableTitle {
355
355
 
356
356
  /* Terms */
357
357
 
358
+ .TermNum {
359
+ font-weight: 300;
360
+ }
361
+
358
362
  .TermNum, .Terms, .AltTerms {
359
363
  color: #00335b;
360
- font-weight: 300;
361
364
  font-family: $headerfont;
362
365
  }
363
366
 
@@ -373,6 +376,8 @@ p.AltTerms {
373
376
  span.AdmittedLabel {
374
377
  color: #00335b;
375
378
  background-color: #CFE2F3;
379
+ font-size: 70%;
380
+ vertical-align: top;
376
381
  }
377
382
 
378
383
 
@@ -309,7 +309,6 @@ p.Terms, li.Terms, div.Terms {
309
309
  mso-fareast-font-family: {{headerfont}};
310
310
  mso-bidi-font-family: {{headerfont}};
311
311
  mso-ansi-language: EN-GB;
312
- font-weight: bold;
313
312
  mso-bidi-font-weight: normal; }
314
313
 
315
314
  p.AltTerms, li.AltTerms, div.AltTerms {
@@ -296,7 +296,6 @@ p.Terms, li.Terms, div.Terms
296
296
  mso-fareast-font-family:$headerfont;
297
297
  mso-bidi-font-family:$headerfont;
298
298
  mso-ansi-language:EN-GB;
299
- font-weight:bold;
300
299
  mso-bidi-font-weight:normal;}
301
300
  p.AltTerms, li.AltTerms, div.AltTerms
302
301
  {mso-style-name:"AltTerm\(s\)";
@@ -263,7 +263,6 @@ p.Terms, li.Terms, div.Terms {
263
263
  mso-fareast-font-family: {{headerfont}};
264
264
  mso-bidi-font-family: {{headerfont}};
265
265
  mso-ansi-language: EN-GB;
266
- font-weight: bold;
267
266
  mso-bidi-font-weight: normal; }
268
267
 
269
268
  p.AltTerms, li.AltTerms, div.AltTerms {
@@ -256,7 +256,6 @@ p.Terms, li.Terms, div.Terms
256
256
  mso-fareast-font-family:$headerfont;
257
257
  mso-bidi-font-family:$headerfont;
258
258
  mso-ansi-language:EN-GB;
259
- font-weight:bold;
260
259
  mso-bidi-font-weight:normal;}
261
260
  p.AltTerms, li.AltTerms, div.AltTerms
262
261
  {mso-style-name:"AltTerm\(s\)";
@@ -67,6 +67,7 @@ module IsoDoc
67
67
  boilerplate docxml, div3
68
68
  preface_block docxml, div3
69
69
  abstract docxml, div3
70
+ executivesummary docxml, div3
70
71
  keywords docxml, div3
71
72
  foreword docxml, div3
72
73
  introduction docxml, div3
@@ -130,8 +130,12 @@ module IsoDoc
130
130
  def bibdate(isoxml, _out)
131
131
  super
132
132
  d = docdate(isoxml)
133
- old = d.nil? || d.empty? ||
134
- DateTime.iso8601("2021-11-08") > DateTime.parse(d.text)
133
+ begin
134
+ old = d.nil? || d.empty? ||
135
+ DateTime.iso8601("2021-11-08") > DateTime.parse(d.text)
136
+ rescue StandardError
137
+ old = false
138
+ end
135
139
  set(:logo_word, old ? get[:logo_old] : get[:logo_new])
136
140
  end
137
141
  end