metanorma-ogc 1.2.11 → 1.2.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +9 -32
  3. data/.rubocop.yml +0 -4
  4. data/lib/asciidoctor/ogc/basicdoc.rng +5 -3
  5. data/lib/asciidoctor/ogc/boilerplate.xml +1 -1
  6. data/lib/asciidoctor/ogc/converter.rb +14 -15
  7. data/lib/asciidoctor/ogc/isodoc.rng +108 -2
  8. data/lib/asciidoctor/ogc/ogc.rng +22 -0
  9. data/lib/isodoc/ogc/base_convert.rb +15 -1
  10. data/lib/isodoc/ogc/html/htmlstyle.css +3 -0
  11. data/lib/isodoc/ogc/html/htmlstyle.scss +4 -0
  12. data/lib/isodoc/ogc/html/ogc.css +3 -0
  13. data/lib/isodoc/ogc/html/ogc.scss +3 -0
  14. data/lib/isodoc/ogc/html_convert.rb +2 -2
  15. data/lib/isodoc/ogc/i18n-en.yaml +1 -1
  16. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +573 -263
  17. data/lib/isodoc/ogc/ogc.best-practice.xsl +573 -263
  18. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +573 -263
  19. data/lib/isodoc/ogc/ogc.community-practice.xsl +573 -263
  20. data/lib/isodoc/ogc/ogc.community-standard.xsl +573 -263
  21. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +573 -263
  22. data/lib/isodoc/ogc/ogc.engineering-report.xsl +573 -263
  23. data/lib/isodoc/ogc/ogc.other.xsl +573 -263
  24. data/lib/isodoc/ogc/ogc.policy.xsl +573 -263
  25. data/lib/isodoc/ogc/ogc.reference-model.xsl +573 -263
  26. data/lib/isodoc/ogc/ogc.release-notes.xsl +573 -263
  27. data/lib/isodoc/ogc/ogc.standard.xsl +573 -263
  28. data/lib/isodoc/ogc/ogc.test-suite.xsl +573 -263
  29. data/lib/isodoc/ogc/ogc.user-guide.xsl +573 -263
  30. data/lib/isodoc/ogc/ogc.white-paper.xsl +618 -268
  31. data/lib/isodoc/ogc/word_convert.rb +7 -9
  32. data/lib/metanorma/ogc/version.rb +1 -1
  33. data/metanorma-ogc.gemspec +3 -3
  34. metadata +9 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e15d1d5244c56742241206793480e35f4147e85f20718fe003da6b8609138b9e
4
- data.tar.gz: 71fc5a1f0e1583e1b4de15b23626bdadbe6acc6e533824c33cf15b9f4dbf0578
3
+ metadata.gz: 816ca1ce2154ba61cd550a0b550929268b5afffc1e0169bad4e068826213f1b2
4
+ data.tar.gz: 67d972963e5c5e9e5451ed5de9f16f5bc7ee25954c4db4e5c9773d090dad9b72
5
5
  SHA512:
6
- metadata.gz: c217d011a9b1177160d097c7e706d074ad6313daec50e36de1ff7d45c93d50d3b7a88ac0823cf2434ce5ca83f9532988ddd47e04497cfac144db541ff7c364cb
7
- data.tar.gz: c963da6c2086b761979d59bcb38b157f34ea0ad6ea5f3739f6b240c95945f49424d5c4bf5a9dfaa7ceb9f030a854ae96b8d0933ebbd6e4629d2ccd97e60917df
6
+ metadata.gz: 5e1cbd0845909917b8b160abba46bec7ea9b86bc1b32277df618a97034824fd59e4122e1e95734c8b416307ddc148e328897ba0ff803ed259fe0ac0930347f81
7
+ data.tar.gz: 867108d5fb51c724b538929614bcbce7ef9f10416a9c97a70273a995d6e046b8fd3f2f9dbeaecea273699bf402ac68ca0427ec07d4ee0993e96208551a50f9f6
@@ -4,7 +4,7 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master, main ]
7
+ branches: [ master, main ]
8
8
  tags: [ v* ]
9
9
  pull_request:
10
10
 
@@ -16,50 +16,27 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.6', '2.5', '2.4' ]
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  include:
23
- - ruby: '2.7'
23
+ - ruby: '3.0'
24
24
  os: 'ubuntu-latest'
25
25
  experimental: true
26
- - ruby: '2.7'
26
+ - ruby: '3.0'
27
27
  os: 'windows-latest'
28
28
  experimental: true
29
- - ruby: '2.7'
29
+ - ruby: '3.0'
30
30
  os: 'macos-latest'
31
31
  experimental: true
32
32
  steps:
33
- - uses: actions/checkout@master
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
34
36
 
35
37
  - uses: ruby/setup-ruby@v1
36
38
  with:
37
39
  ruby-version: ${{ matrix.ruby }}
38
-
39
- - if: matrix.os == 'macos-latest'
40
- run: brew install autoconf automake libtool
41
-
42
- - uses: actions/cache@v2
43
- with:
44
- path: vendor/bundle
45
- key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
46
- restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
47
-
48
- - run: bundle config set path 'vendor/bundle'
49
-
50
- - run: bundle install --jobs 4 --retry 3
40
+ bundler-cache: true
51
41
 
52
42
  - run: bundle exec rake
53
-
54
- tests-passed:
55
- needs: rake
56
- runs-on: ubuntu-latest
57
- steps:
58
- - name: Trigger tests passed event
59
- uses: Sibz/github-status-action@v1
60
- with:
61
- authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
62
- context: 'tests-passed-successfully'
63
- description: 'Tests passed successfully'
64
- state: 'success'
65
- sha: ${{ github.event.pull_request.head.sha || github.sha }}
data/.rubocop.yml CHANGED
@@ -4,7 +4,3 @@
4
4
 
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
- AllCops:
8
- TargetRubyVersion: 2.3
9
- Rails:
10
- Enabled: true
@@ -729,9 +729,11 @@
729
729
  </define>
730
730
  <define name="index">
731
731
  <element name="index">
732
- <attribute name="to">
733
- <data type="IDREF"/>
734
- </attribute>
732
+ <optional>
733
+ <attribute name="to">
734
+ <data type="IDREF"/>
735
+ </attribute>
736
+ </optional>
735
737
  <element name="primary">
736
738
  <oneOrMore>
737
739
  <ref name="PureTextElement"/>
@@ -6,7 +6,7 @@
6
6
  <p align="center">Copyright
7
7
  © {{ docyear }} Open Geospatial Consortium<br/>
8
8
  To obtain additional rights of use, visit
9
- <link target="http://www.opengeospatial.org/legal/">http://www.opengeospatial.org/legal/</link></p>
9
+ <link target="http://www.ogc.org/legal/">http://www.ogc.org/legal/</link></p>
10
10
  </clause>
11
11
  <clause>
12
12
  <title>Note</title>
@@ -55,18 +55,14 @@ module Asciidoctor
55
55
  def outputs(node, ret)
56
56
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
57
57
  presentation_xml_converter(node).convert(@filename + ".xml")
58
- html_converter(node).convert(@filename + ".presentation.xml",
59
- nil, false, "#{@filename}.html")
60
- doc_converter(node).convert(@filename + ".presentation.xml",
61
- nil, false, "#{@filename}.doc")
62
- pdf_converter(node)&.convert(@filename + ".presentation.xml",
63
- nil, false, "#{@filename}.pdf")
58
+ html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
59
+ doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
60
+ pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
64
61
  end
65
62
 
66
63
  def validate(doc)
67
64
  content_validate(doc)
68
- schema_validate(formattedstr_strip(doc.dup),
69
- File.join(File.dirname(__FILE__), "ogc.rng"))
65
+ schema_validate(formattedstr_strip(doc.dup), File.join(File.dirname(__FILE__), "ogc.rng"))
70
66
  end
71
67
 
72
68
  def sections_cleanup(x)
@@ -87,19 +83,19 @@ module Asciidoctor
87
83
  end
88
84
 
89
85
  def insert_security(x, s)
90
- preface = s.at("//preface") ||
91
- s.add_previous_sibling("<preface/>").first
86
+ doctype = s&.at("//bibdata/ext/doctype")&.text
87
+ description = %w(standard community-standard).include?(doctype) ? "standard" : "document"
88
+ preface = s.at("//preface") || s.add_previous_sibling("<preface/>").first
92
89
  s = x&.at("//clause[@type = 'security']")&.remove ||
93
90
  "<clause type='security' #{add_id}>"\
94
91
  "<title>Security Considerations</title>"\
95
- "<p>#{@i18n.security_empty}</p></clause>"
92
+ "<p>#{@i18n.security_empty.sub(/%/, description)}</p></clause>"
96
93
  preface.add_child s
97
94
  end
98
95
 
99
96
  def insert_submitters(x, s)
100
97
  if x.at("//submitters")
101
- preface = s.at("//preface") ||
102
- s.add_previous_sibling("<preface/>").first
98
+ preface = s.at("//preface") || s.add_previous_sibling("<preface/>").first
103
99
  submitters = x.at("//submitters").remove
104
100
  preface.add_child submitters.remove
105
101
  end
@@ -132,8 +128,11 @@ module Asciidoctor
132
128
  def bibdata_cleanup(xmldoc)
133
129
  super
134
130
  a = xmldoc.at("//bibdata/status/stage")
135
- a.text == "published" and
136
- a.children = "approved"
131
+ a.text == "published" and a.children = "approved"
132
+ end
133
+
134
+ def highlight_parse(text, xml)
135
+ xml.hi { |s| s << text }
137
136
  end
138
137
 
139
138
  def presentation_xml_converter(node)
@@ -102,7 +102,7 @@
102
102
  </attribute>
103
103
  </optional>
104
104
  <oneOrMore>
105
- <ref name="li"/>
105
+ <ref name="ul_li"/>
106
106
  </oneOrMore>
107
107
  <zeroOrMore>
108
108
  <ref name="note"/>
@@ -789,6 +789,9 @@
789
789
  <attribute name="width"/>
790
790
  </element>
791
791
  </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
792
795
  <define name="TextElement" combine="choice">
793
796
  <ref name="concept"/>
794
797
  </define>
@@ -809,6 +812,8 @@
809
812
  <ref name="requirement"/>
810
813
  <ref name="recommendation"/>
811
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
812
817
  </choice>
813
818
  </define>
814
819
  <define name="bibliography">
@@ -914,6 +919,9 @@
914
919
  </choice>
915
920
  </attribute>
916
921
  <ref name="bibdata"/>
922
+ <optional>
923
+ <ref name="misccontainer"/>
924
+ </optional>
917
925
  <optional>
918
926
  <ref name="boilerplate"/>
919
927
  </optional>
@@ -924,11 +932,21 @@
924
932
  <zeroOrMore>
925
933
  <ref name="annex"/>
926
934
  </zeroOrMore>
935
+ <optional>
936
+ <ref name="bibliography"/>
937
+ </optional>
927
938
  <zeroOrMore>
928
- <ref name="references"/>
939
+ <ref name="indexsect"/>
929
940
  </zeroOrMore>
930
941
  </element>
931
942
  </define>
943
+ <define name="misccontainer">
944
+ <element name="misc-container">
945
+ <oneOrMore>
946
+ <ref name="AnyElement"/>
947
+ </oneOrMore>
948
+ </element>
949
+ </define>
932
950
  <define name="preface">
933
951
  <element name="preface">
934
952
  <oneOrMore>
@@ -952,6 +970,11 @@
952
970
  <ref name="Content-Section"/>
953
971
  </element>
954
972
  </define>
973
+ <define name="indexsect">
974
+ <element name="indexsect">
975
+ <ref name="Content-Section"/>
976
+ </element>
977
+ </define>
955
978
  <define name="boilerplate">
956
979
  <element name="boilerplate">
957
980
  <optional>
@@ -1632,4 +1655,87 @@
1632
1655
  <text/>
1633
1656
  </element>
1634
1657
  </define>
1658
+ <define name="imagemap">
1659
+ <element name="imagemap">
1660
+ <ref name="figure"/>
1661
+ <zeroOrMore>
1662
+ <element name="area">
1663
+ <attribute name="type">
1664
+ <choice>
1665
+ <value>rect</value>
1666
+ <value>circle</value>
1667
+ <value>ellipse</value>
1668
+ <value>poly</value>
1669
+ </choice>
1670
+ </attribute>
1671
+ <choice>
1672
+ <ref name="xref"/>
1673
+ <ref name="hyperlink"/>
1674
+ <ref name="eref"/>
1675
+ </choice>
1676
+ <oneOrMore>
1677
+ <element name="coords">
1678
+ <attribute name="x">
1679
+ <data type="float"/>
1680
+ </attribute>
1681
+ <attribute name="y">
1682
+ <data type="float"/>
1683
+ </attribute>
1684
+ </element>
1685
+ </oneOrMore>
1686
+ <optional>
1687
+ <element name="radius">
1688
+ <attribute name="x">
1689
+ <data type="float"/>
1690
+ </attribute>
1691
+ <optional>
1692
+ <attribute name="y">
1693
+ <data type="float"/>
1694
+ </attribute>
1695
+ </optional>
1696
+ </element>
1697
+ </optional>
1698
+ </element>
1699
+ </zeroOrMore>
1700
+ </element>
1701
+ </define>
1702
+ <define name="svgmap">
1703
+ <element name="svgmap">
1704
+ <ref name="figure"/>
1705
+ <zeroOrMore>
1706
+ <element name="target">
1707
+ <attribute name="href">
1708
+ <data type="anyURI"/>
1709
+ </attribute>
1710
+ <choice>
1711
+ <ref name="xref"/>
1712
+ <ref name="hyperlink"/>
1713
+ <ref name="eref"/>
1714
+ </choice>
1715
+ </element>
1716
+ </zeroOrMore>
1717
+ </element>
1718
+ </define>
1719
+ <define name="ul_li">
1720
+ <element name="li">
1721
+ <optional>
1722
+ <attribute name="id">
1723
+ <data type="ID"/>
1724
+ </attribute>
1725
+ </optional>
1726
+ <optional>
1727
+ <attribute name="uncheckedcheckbox">
1728
+ <data type="boolean"/>
1729
+ </attribute>
1730
+ </optional>
1731
+ <optional>
1732
+ <attribute name="checkedcheckbox">
1733
+ <data type="boolean"/>
1734
+ </attribute>
1735
+ </optional>
1736
+ <oneOrMore>
1737
+ <ref name="BasicBlock"/>
1738
+ </oneOrMore>
1739
+ </element>
1740
+ </define>
1635
1741
  </grammar>
@@ -63,6 +63,22 @@
63
63
  </element>
64
64
  </define>
65
65
  </include>
66
+ <define name="TextElement" combine="choice">
67
+ <ref name="hi"/>
68
+ </define>
69
+ <define name="PureTextElement" combine="choice">
70
+ <ref name="hi"/>
71
+ </define>
72
+ <define name="hi">
73
+ <element name="hi">
74
+ <zeroOrMore>
75
+ <choice>
76
+ <ref name="PureTextElement"/>
77
+ <ref name="stem"/>
78
+ </choice>
79
+ </zeroOrMore>
80
+ </element>
81
+ </define>
66
82
  <define name="docsubtype">
67
83
  <element name="docsubtype">
68
84
  <choice>
@@ -115,6 +131,9 @@
115
131
  <zeroOrMore>
116
132
  <ref name="termdocsource"/>
117
133
  </zeroOrMore>
134
+ <optional>
135
+ <ref name="misccontainer"/>
136
+ </optional>
118
137
  <optional>
119
138
  <ref name="boilerplate"/>
120
139
  </optional>
@@ -126,6 +145,9 @@
126
145
  <ref name="annex"/>
127
146
  </zeroOrMore>
128
147
  <ref name="bibliography"/>
148
+ <zeroOrMore>
149
+ <ref name="indexsect"/>
150
+ </zeroOrMore>
129
151
  </element>
130
152
  </define>
131
153
  </grammar>
@@ -6,6 +6,20 @@ require "fileutils"
6
6
  module IsoDoc
7
7
  module Ogc
8
8
  module BaseConvert
9
+ def error_parse(node, out)
10
+ case node.name
11
+ when "hi" then hi_parse(node, out)
12
+ else
13
+ super
14
+ end
15
+ end
16
+
17
+ def hi_parse(node, out)
18
+ out.span **{class: "hi"} do |e|
19
+ node.children.each { |n| parse(n, e) }
20
+ end
21
+ end
22
+
9
23
  def cleanup(docxml)
10
24
  super
11
25
  term_cleanup(docxml)
@@ -37,7 +51,7 @@ module IsoDoc
37
51
 
38
52
  def middle_clause(_docxml)
39
53
  "//clause[parent::sections][not(@type = 'scope' or "\
40
- "@type = 'conformance')][not(descendant::terms)]"
54
+ "@type = 'conformance')][not(descendant::terms)]"
41
55
  end
42
56
 
43
57
  def is_clause?(name)
@@ -1092,3 +1092,6 @@ a.footnote-number {
1092
1092
 
1093
1093
  .footnote {
1094
1094
  font-size: {{footnotefontsize}}; }
1095
+
1096
+ span.hi {
1097
+ background-color: yellow; }
@@ -597,3 +597,7 @@ a.footnote-number {
597
597
  .footnote {
598
598
  font-size: $footnotefontsize;
599
599
  }
600
+
601
+ span.hi {
602
+ background-color: yellow;
603
+ }
@@ -848,3 +848,6 @@ div.warning p {
848
848
  mso-border-alt: solid windowtext .5pt;
849
849
  padding: 0cm;
850
850
  mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; }
851
+
852
+ span.hi {
853
+ background-color: yellow; }
@@ -806,3 +806,6 @@ div.warning p {
806
806
  margin-bottom:6.0pt;border:none;mso-border-alt:solid windowtext .5pt;
807
807
  padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt;
808
808
  }
809
+ span.hi {
810
+ background-color: yellow;
811
+ }
@@ -18,8 +18,8 @@ module IsoDoc
18
18
 
19
19
  def default_fonts(options)
20
20
  {
21
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
22
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
21
+ bodyfont: '"Overpass",sans-serif',
22
+ headerfont: '"Overpass",sans-serif',
23
23
  monospacefont: '"Space Mono",monospace',
24
24
  normalfontsize: "16px",
25
25
  monospacefontsize: "0.8em",