metanorma-ogc 1.2.12 → 1.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +9 -32
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/ogc/biblio.rng +4 -6
- data/lib/asciidoctor/ogc/boilerplate.xml +1 -1
- data/lib/asciidoctor/ogc/converter.rb +14 -15
- data/lib/asciidoctor/ogc/isodoc.rng +105 -2
- data/lib/asciidoctor/ogc/ogc.rng +22 -0
- data/lib/isodoc/ogc/base_convert.rb +15 -1
- data/lib/isodoc/ogc/html/htmlstyle.css +3 -0
- data/lib/isodoc/ogc/html/htmlstyle.scss +4 -0
- data/lib/isodoc/ogc/html/ogc.css +3 -0
- data/lib/isodoc/ogc/html/ogc.scss +3 -0
- data/lib/isodoc/ogc/i18n-en.yaml +1 -1
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +496 -253
- data/lib/isodoc/ogc/ogc.best-practice.xsl +496 -253
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +496 -253
- data/lib/isodoc/ogc/ogc.community-practice.xsl +496 -253
- data/lib/isodoc/ogc/ogc.community-standard.xsl +496 -253
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +496 -253
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +496 -253
- data/lib/isodoc/ogc/ogc.other.xsl +496 -253
- data/lib/isodoc/ogc/ogc.policy.xsl +496 -253
- data/lib/isodoc/ogc/ogc.reference-model.xsl +496 -253
- data/lib/isodoc/ogc/ogc.release-notes.xsl +496 -253
- data/lib/isodoc/ogc/ogc.standard.xsl +496 -253
- data/lib/isodoc/ogc/ogc.test-suite.xsl +496 -253
- data/lib/isodoc/ogc/ogc.user-guide.xsl +496 -253
- data/lib/isodoc/ogc/ogc.white-paper.xsl +547 -264
- data/lib/metanorma/ogc/version.rb +1 -1
- data/metanorma-ogc.gemspec +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9b2a4f6759733416b83c67147a76fb26454cdb88b2db0878276307bfc47814e
|
4
|
+
data.tar.gz: c4eee012c45e1ab5bda542e1a53ea39acbc75889f2b9a2535a7338cbc4740197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8edb09f7b9250c90d53cfb5e046819d0f4b8bd25314f8b91f31f6b2d4e065e39ed867f9f68449f2561fcd17f53e4f64944b4e5123c8418e877e766917cda29af
|
7
|
+
data.tar.gz: 49477bcbb1cba63879167fb1228fc30994b9cc60ea82fc52289073c63d2c67c56cb42dadce15588d728a2603b119d1b8bb193994f282316d61c1efa20728ad51
|
data/.github/workflows/rake.yml
CHANGED
@@ -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: '
|
23
|
+
- ruby: '3.0'
|
24
24
|
os: 'ubuntu-latest'
|
25
25
|
experimental: true
|
26
|
-
- ruby: '
|
26
|
+
- ruby: '3.0'
|
27
27
|
os: 'windows-latest'
|
28
28
|
experimental: true
|
29
|
-
- ruby: '
|
29
|
+
- ruby: '3.0'
|
30
30
|
os: 'macos-latest'
|
31
31
|
experimental: true
|
32
32
|
steps:
|
33
|
-
- uses: actions/checkout@
|
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/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
# This project follows the Ribose OSS style guide.
|
2
2
|
# https://github.com/riboseinc/oss-guides
|
3
3
|
# All project-specific additions and overrides should be specified in this file.
|
4
|
-
|
5
4
|
inherit_from:
|
6
5
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
6
|
+
|
7
|
+
# local repo-specific modifications
|
8
|
+
|
7
9
|
AllCops:
|
8
|
-
|
10
|
+
DisplayCopNames: false
|
11
|
+
StyleGuideCopsOnly: false
|
12
|
+
TargetRubyVersion: 2.4
|
9
13
|
Rails:
|
10
14
|
Enabled: true
|
@@ -124,7 +124,7 @@
|
|
124
124
|
<value>application/tei+xml</value>
|
125
125
|
<value>text/x-asciidoc</value>
|
126
126
|
<value>text/markdown</value>
|
127
|
-
<value>application/x-
|
127
|
+
<value>application/x-metanorma+xml</value>
|
128
128
|
<text/>
|
129
129
|
</choice>
|
130
130
|
</attribute>
|
@@ -452,6 +452,7 @@
|
|
452
452
|
<attribute name="type">
|
453
453
|
<choice>
|
454
454
|
<value>isni</value>
|
455
|
+
<value>orcid</value>
|
455
456
|
<value>uri</value>
|
456
457
|
</choice>
|
457
458
|
</attribute>
|
@@ -461,10 +462,7 @@
|
|
461
462
|
<define name="org-identifier">
|
462
463
|
<element name="identifier">
|
463
464
|
<attribute name="type">
|
464
|
-
<
|
465
|
-
<value>orcid</value>
|
466
|
-
<value>uri</value>
|
467
|
-
</choice>
|
465
|
+
<data type="string" datatypeLibrary=""/>
|
468
466
|
</attribute>
|
469
467
|
<text/>
|
470
468
|
</element>
|
@@ -1106,7 +1104,7 @@
|
|
1106
1104
|
<value>complementOf</value>
|
1107
1105
|
<value>obsoletes</value>
|
1108
1106
|
<value>obsoletedBy</value>
|
1109
|
-
<value>
|
1107
|
+
<value>cites</value>
|
1110
1108
|
<value>isCitedIn</value>
|
1111
1109
|
</choice>
|
1112
1110
|
</define>
|
@@ -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.
|
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
|
-
|
60
|
-
|
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
|
-
|
91
|
-
|
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
|
-
|
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="
|
105
|
+
<ref name="ul_li"/>
|
106
106
|
</oneOrMore>
|
107
107
|
<zeroOrMore>
|
108
108
|
<ref name="note"/>
|
@@ -812,6 +812,8 @@
|
|
812
812
|
<ref name="requirement"/>
|
813
813
|
<ref name="recommendation"/>
|
814
814
|
<ref name="permission"/>
|
815
|
+
<ref name="imagemap"/>
|
816
|
+
<ref name="svgmap"/>
|
815
817
|
</choice>
|
816
818
|
</define>
|
817
819
|
<define name="bibliography">
|
@@ -917,6 +919,9 @@
|
|
917
919
|
</choice>
|
918
920
|
</attribute>
|
919
921
|
<ref name="bibdata"/>
|
922
|
+
<optional>
|
923
|
+
<ref name="misccontainer"/>
|
924
|
+
</optional>
|
920
925
|
<optional>
|
921
926
|
<ref name="boilerplate"/>
|
922
927
|
</optional>
|
@@ -927,11 +932,21 @@
|
|
927
932
|
<zeroOrMore>
|
928
933
|
<ref name="annex"/>
|
929
934
|
</zeroOrMore>
|
935
|
+
<optional>
|
936
|
+
<ref name="bibliography"/>
|
937
|
+
</optional>
|
930
938
|
<zeroOrMore>
|
931
|
-
<ref name="
|
939
|
+
<ref name="indexsect"/>
|
932
940
|
</zeroOrMore>
|
933
941
|
</element>
|
934
942
|
</define>
|
943
|
+
<define name="misccontainer">
|
944
|
+
<element name="misc-container">
|
945
|
+
<oneOrMore>
|
946
|
+
<ref name="AnyElement"/>
|
947
|
+
</oneOrMore>
|
948
|
+
</element>
|
949
|
+
</define>
|
935
950
|
<define name="preface">
|
936
951
|
<element name="preface">
|
937
952
|
<oneOrMore>
|
@@ -955,6 +970,11 @@
|
|
955
970
|
<ref name="Content-Section"/>
|
956
971
|
</element>
|
957
972
|
</define>
|
973
|
+
<define name="indexsect">
|
974
|
+
<element name="indexsect">
|
975
|
+
<ref name="Content-Section"/>
|
976
|
+
</element>
|
977
|
+
</define>
|
958
978
|
<define name="boilerplate">
|
959
979
|
<element name="boilerplate">
|
960
980
|
<optional>
|
@@ -1635,4 +1655,87 @@
|
|
1635
1655
|
<text/>
|
1636
1656
|
</element>
|
1637
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>
|
1638
1741
|
</grammar>
|
data/lib/asciidoctor/ogc/ogc.rng
CHANGED
@@ -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
|
-
|
54
|
+
"@type = 'conformance')][not(descendant::terms)]"
|
41
55
|
end
|
42
56
|
|
43
57
|
def is_clause?(name)
|