metanorma-iec 1.2.14 → 1.3.1
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 +9 -1
- data/lib/asciidoctor/iec/biblio.rng +4 -6
- data/lib/asciidoctor/iec/front.rb +11 -5
- data/lib/asciidoctor/iec/iec.rng +11 -0
- data/lib/asciidoctor/iec/isodoc.rng +172 -3
- data/lib/asciidoctor/iec/isostandard.rng +17 -97
- data/lib/isodoc/iec/html/htmlstyle.css +7 -0
- data/lib/isodoc/iec/html_convert.rb +0 -1
- data/lib/isodoc/iec/iec.international-standard.xsl +589 -127
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +6 -6
- data/spec/{asciidoctor-iec → asciidoctor}/base_spec.rb +0 -0
- data/spec/{asciidoctor-iec → asciidoctor}/blocks_spec.rb +0 -0
- data/spec/{asciidoctor-iec → asciidoctor}/cleanup_spec.rb +0 -0
- data/spec/{asciidoctor-iec → asciidoctor}/iev_spec.rb +0 -0
- data/spec/{asciidoctor-iec → asciidoctor}/inline_spec.rb +0 -0
- data/spec/{asciidoctor-iec → asciidoctor}/lists_spec.rb +0 -0
- data/spec/{asciidoctor-iec → asciidoctor}/section_spec.rb +0 -0
- data/spec/{asciidoctor-iec → asciidoctor}/validate_spec.rb +0 -0
- data/spec/isodoc/postproc_spec.rb +2 -20
- metadata +50 -59
- data/spec/examples/rice.adoc +0 -723
- data/spec/examples/rice.doc +0 -19162
- data/spec/examples/rice.html +0 -1787
- data/spec/examples/rice.xml +0 -1951
- data/spec/examples/rice_img/rice_image1.png +0 -0
- data/spec/examples/rice_img/rice_image2.png +0 -0
- data/spec/examples/rice_img/rice_image3_1.png +0 -0
- data/spec/examples/rice_img/rice_image3_2.png +0 -0
- data/spec/examples/rice_img/rice_image3_3.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc0ee8f0d0923ed5a23f0e0b2b848f7638a3145b9bd5d76b164df2aa52d9c23c
|
4
|
+
data.tar.gz: a784c0a3ffa08411f53f7375cd1ff00b23bcd5e5170123a7c8fc7735b307ba25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27986c3e678e1c211b1dead573d496997296f2c3e8226b5550dcf673a4149921d963e49551c91d1063d68655ddeb0015ed007e019bf93f5bc28501a1c4e6c7fe
|
7
|
+
data.tar.gz: b22477bc92a6b47a268400a5ced0c89b306cd8b9a8fbdfec73bcc32e51de1ee6c10d91e6ef968fc6cc904a158999815a36b1abe37017fb20fcbaebc0b826383a
|
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,6 +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
|
+
|
9
|
+
AllCops:
|
10
|
+
DisplayCopNames: false
|
11
|
+
StyleGuideCopsOnly: false
|
12
|
+
TargetRubyVersion: 2.4
|
13
|
+
Rails:
|
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 @@ module Asciidoctor
|
|
6
6
|
csv_split(publishers)&.each do |p|
|
7
7
|
xml.contributor do |c|
|
8
8
|
c.role **{ type: "author" }
|
9
|
-
c.organization { |a| organization(a, p, node, !node.attr("publisher")) }
|
9
|
+
c.organization { |a| organization(a, p, false, node, !node.attr("publisher")) }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -16,19 +16,21 @@ module Asciidoctor
|
|
16
16
|
csv_split(publishers)&.each do |p|
|
17
17
|
xml.contributor do |c|
|
18
18
|
c.role **{ type: "publisher" }
|
19
|
-
c.organization { |a| organization(a, p, node, !node.attr("publisher")) }
|
19
|
+
c.organization { |a| organization(a, p, true, node, !node.attr("publisher")) }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
def metadata_copyright(node, xml)
|
25
|
-
publishers = node.attr("copyright-holder") || node.attr("publisher") ||
|
25
|
+
publishers = node.attr("copyright-holder") || node.attr("publisher") ||
|
26
|
+
"IEC"
|
26
27
|
csv_split(publishers)&.each do |p|
|
27
28
|
xml.copyright do |c|
|
28
29
|
c.from (node.attr("copyright-year") || Date.today.year)
|
29
30
|
c.owner do |owner|
|
30
31
|
owner.organization do |o|
|
31
|
-
organization(o, p, node, !node.attr("copyright-holder") ||
|
32
|
+
organization(o, p, true, node, !node.attr("copyright-holder") ||
|
33
|
+
node.attr("publisher"))
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
@@ -37,6 +39,7 @@ module Asciidoctor
|
|
37
39
|
|
38
40
|
def iso_id(node, xml)
|
39
41
|
return unless node.attr("docnumber")
|
42
|
+
|
40
43
|
part, subpart = node&.attr("partnumber")&.split(/-/)
|
41
44
|
dn = add_id_parts(node.attr("docnumber"), part, subpart)
|
42
45
|
dn = id_stage_prefix(dn, node, false)
|
@@ -111,6 +114,7 @@ module Asciidoctor
|
|
111
114
|
|
112
115
|
def status_abbrev1(stage, substage, iter, doctype, draft)
|
113
116
|
return "" unless stage
|
117
|
+
|
114
118
|
abbr = STAGE_ABBRS.dig(stage, substage) || "??"
|
115
119
|
if stage == "35" && substage == "92"
|
116
120
|
iter = (iter.to_i + 1) % "02"
|
@@ -136,6 +140,7 @@ module Asciidoctor
|
|
136
140
|
|
137
141
|
def stage_abbr(stage, substage)
|
138
142
|
return "PPUB" if stage == "60"
|
143
|
+
|
139
144
|
DOC_STAGE[stage.to_sym] || "??"
|
140
145
|
end
|
141
146
|
|
@@ -188,7 +193,8 @@ module Asciidoctor
|
|
188
193
|
|
189
194
|
def metadata_ext(node, xml)
|
190
195
|
super
|
191
|
-
a = node.attr("accessibility-color-inside") and
|
196
|
+
a = node.attr("accessibility-color-inside") and
|
197
|
+
xml.accessibility_color_inside a
|
192
198
|
a = node.attr("price-code") and xml.price_code a
|
193
199
|
a = node.attr("cen-processing") and xml.cen_processing a
|
194
200
|
a = node.attr("secretary") and xml.secretary a
|
data/lib/asciidoctor/iec/iec.rng
CHANGED
@@ -114,6 +114,9 @@
|
|
114
114
|
<zeroOrMore>
|
115
115
|
<ref name="termdocsource"/>
|
116
116
|
</zeroOrMore>
|
117
|
+
<optional>
|
118
|
+
<ref name="misccontainer"/>
|
119
|
+
</optional>
|
117
120
|
<optional>
|
118
121
|
<ref name="boilerplate"/>
|
119
122
|
</optional>
|
@@ -125,6 +128,14 @@
|
|
125
128
|
<ref name="annex"/>
|
126
129
|
</zeroOrMore>
|
127
130
|
<ref name="bibliography"/>
|
131
|
+
<zeroOrMore>
|
132
|
+
<ref name="indexsect"/>
|
133
|
+
</zeroOrMore>
|
134
|
+
</element>
|
135
|
+
</define>
|
136
|
+
<define name="updates_document_type">
|
137
|
+
<element name="updates-document-type">
|
138
|
+
<ref name="DocumentType"/>
|
128
139
|
</element>
|
129
140
|
</define>
|
130
141
|
</grammar>
|
@@ -86,6 +86,35 @@
|
|
86
86
|
<text/>
|
87
87
|
</element>
|
88
88
|
</define>
|
89
|
+
<define name="erefType">
|
90
|
+
<optional>
|
91
|
+
<attribute name="normative">
|
92
|
+
<data type="boolean"/>
|
93
|
+
</attribute>
|
94
|
+
</optional>
|
95
|
+
<attribute name="citeas"/>
|
96
|
+
<attribute name="type">
|
97
|
+
<ref name="ReferenceFormat"/>
|
98
|
+
</attribute>
|
99
|
+
<optional>
|
100
|
+
<attribute name="alt"/>
|
101
|
+
</optional>
|
102
|
+
<optional>
|
103
|
+
<attribute name="case">
|
104
|
+
<choice>
|
105
|
+
<value>capital</value>
|
106
|
+
<value>lowercase</value>
|
107
|
+
</choice>
|
108
|
+
</attribute>
|
109
|
+
</optional>
|
110
|
+
<optional>
|
111
|
+
<attribute name="droploc">
|
112
|
+
<data type="boolean"/>
|
113
|
+
</attribute>
|
114
|
+
</optional>
|
115
|
+
<ref name="CitationType"/>
|
116
|
+
<text/>
|
117
|
+
</define>
|
89
118
|
<define name="ul">
|
90
119
|
<element name="ul">
|
91
120
|
<attribute name="id">
|
@@ -102,7 +131,7 @@
|
|
102
131
|
</attribute>
|
103
132
|
</optional>
|
104
133
|
<oneOrMore>
|
105
|
-
<ref name="
|
134
|
+
<ref name="ul_li"/>
|
106
135
|
</oneOrMore>
|
107
136
|
<zeroOrMore>
|
108
137
|
<ref name="note"/>
|
@@ -775,6 +804,78 @@
|
|
775
804
|
<ref name="paragraph"/>
|
776
805
|
</element>
|
777
806
|
</define>
|
807
|
+
<define name="em">
|
808
|
+
<element name="em">
|
809
|
+
<zeroOrMore>
|
810
|
+
<choice>
|
811
|
+
<ref name="PureTextElement"/>
|
812
|
+
<ref name="stem"/>
|
813
|
+
<ref name="index"/>
|
814
|
+
</choice>
|
815
|
+
</zeroOrMore>
|
816
|
+
</element>
|
817
|
+
</define>
|
818
|
+
<define name="strong">
|
819
|
+
<element name="strong">
|
820
|
+
<zeroOrMore>
|
821
|
+
<choice>
|
822
|
+
<ref name="PureTextElement"/>
|
823
|
+
<ref name="stem"/>
|
824
|
+
<ref name="index"/>
|
825
|
+
</choice>
|
826
|
+
</zeroOrMore>
|
827
|
+
</element>
|
828
|
+
</define>
|
829
|
+
<define name="tt">
|
830
|
+
<element name="tt">
|
831
|
+
<zeroOrMore>
|
832
|
+
<choice>
|
833
|
+
<ref name="PureTextElement"/>
|
834
|
+
<ref name="index"/>
|
835
|
+
</choice>
|
836
|
+
</zeroOrMore>
|
837
|
+
</element>
|
838
|
+
</define>
|
839
|
+
<define name="keyword">
|
840
|
+
<element name="keyword">
|
841
|
+
<zeroOrMore>
|
842
|
+
<choice>
|
843
|
+
<ref name="PureTextElement"/>
|
844
|
+
<ref name="index"/>
|
845
|
+
</choice>
|
846
|
+
</zeroOrMore>
|
847
|
+
</element>
|
848
|
+
</define>
|
849
|
+
<define name="strike">
|
850
|
+
<element name="strike">
|
851
|
+
<zeroOrMore>
|
852
|
+
<choice>
|
853
|
+
<ref name="PureTextElement"/>
|
854
|
+
<ref name="index"/>
|
855
|
+
</choice>
|
856
|
+
</zeroOrMore>
|
857
|
+
</element>
|
858
|
+
</define>
|
859
|
+
<define name="underline">
|
860
|
+
<element name="underline">
|
861
|
+
<zeroOrMore>
|
862
|
+
<choice>
|
863
|
+
<ref name="PureTextElement"/>
|
864
|
+
<ref name="index"/>
|
865
|
+
</choice>
|
866
|
+
</zeroOrMore>
|
867
|
+
</element>
|
868
|
+
</define>
|
869
|
+
<define name="smallcap">
|
870
|
+
<element name="smallcap">
|
871
|
+
<zeroOrMore>
|
872
|
+
<choice>
|
873
|
+
<ref name="PureTextElement"/>
|
874
|
+
<ref name="index"/>
|
875
|
+
</choice>
|
876
|
+
</zeroOrMore>
|
877
|
+
</element>
|
878
|
+
</define>
|
778
879
|
</include>
|
779
880
|
<!-- end overrides -->
|
780
881
|
<define name="colgroup">
|
@@ -793,7 +894,35 @@
|
|
793
894
|
<value>internal</value>
|
794
895
|
</define>
|
795
896
|
<define name="TextElement" combine="choice">
|
796
|
-
<
|
897
|
+
<choice>
|
898
|
+
<ref name="concept"/>
|
899
|
+
<ref name="add"/>
|
900
|
+
<ref name="del"/>
|
901
|
+
</choice>
|
902
|
+
</define>
|
903
|
+
<define name="add">
|
904
|
+
<element name="add">
|
905
|
+
<choice>
|
906
|
+
<ref name="PureTextElement"/>
|
907
|
+
<ref name="eref"/>
|
908
|
+
<ref name="stem"/>
|
909
|
+
<ref name="keyword"/>
|
910
|
+
<ref name="xref"/>
|
911
|
+
<ref name="hyperlink"/>
|
912
|
+
</choice>
|
913
|
+
</element>
|
914
|
+
</define>
|
915
|
+
<define name="del">
|
916
|
+
<element name="del">
|
917
|
+
<choice>
|
918
|
+
<ref name="PureTextElement"/>
|
919
|
+
<ref name="eref"/>
|
920
|
+
<ref name="stem"/>
|
921
|
+
<ref name="keyword"/>
|
922
|
+
<ref name="xref"/>
|
923
|
+
<ref name="hyperlink"/>
|
924
|
+
</choice>
|
925
|
+
</element>
|
797
926
|
</define>
|
798
927
|
<define name="concept">
|
799
928
|
<element name="concept">
|
@@ -919,6 +1048,9 @@
|
|
919
1048
|
</choice>
|
920
1049
|
</attribute>
|
921
1050
|
<ref name="bibdata"/>
|
1051
|
+
<optional>
|
1052
|
+
<ref name="misccontainer"/>
|
1053
|
+
</optional>
|
922
1054
|
<optional>
|
923
1055
|
<ref name="boilerplate"/>
|
924
1056
|
</optional>
|
@@ -929,11 +1061,21 @@
|
|
929
1061
|
<zeroOrMore>
|
930
1062
|
<ref name="annex"/>
|
931
1063
|
</zeroOrMore>
|
1064
|
+
<optional>
|
1065
|
+
<ref name="bibliography"/>
|
1066
|
+
</optional>
|
932
1067
|
<zeroOrMore>
|
933
|
-
<ref name="
|
1068
|
+
<ref name="indexsect"/>
|
934
1069
|
</zeroOrMore>
|
935
1070
|
</element>
|
936
1071
|
</define>
|
1072
|
+
<define name="misccontainer">
|
1073
|
+
<element name="misc-container">
|
1074
|
+
<oneOrMore>
|
1075
|
+
<ref name="AnyElement"/>
|
1076
|
+
</oneOrMore>
|
1077
|
+
</element>
|
1078
|
+
</define>
|
937
1079
|
<define name="preface">
|
938
1080
|
<element name="preface">
|
939
1081
|
<oneOrMore>
|
@@ -957,6 +1099,11 @@
|
|
957
1099
|
<ref name="Content-Section"/>
|
958
1100
|
</element>
|
959
1101
|
</define>
|
1102
|
+
<define name="indexsect">
|
1103
|
+
<element name="indexsect">
|
1104
|
+
<ref name="Content-Section"/>
|
1105
|
+
</element>
|
1106
|
+
</define>
|
960
1107
|
<define name="boilerplate">
|
961
1108
|
<element name="boilerplate">
|
962
1109
|
<optional>
|
@@ -1698,4 +1845,26 @@
|
|
1698
1845
|
</zeroOrMore>
|
1699
1846
|
</element>
|
1700
1847
|
</define>
|
1848
|
+
<define name="ul_li">
|
1849
|
+
<element name="li">
|
1850
|
+
<optional>
|
1851
|
+
<attribute name="id">
|
1852
|
+
<data type="ID"/>
|
1853
|
+
</attribute>
|
1854
|
+
</optional>
|
1855
|
+
<optional>
|
1856
|
+
<attribute name="uncheckedcheckbox">
|
1857
|
+
<data type="boolean"/>
|
1858
|
+
</attribute>
|
1859
|
+
</optional>
|
1860
|
+
<optional>
|
1861
|
+
<attribute name="checkedcheckbox">
|
1862
|
+
<data type="boolean"/>
|
1863
|
+
</attribute>
|
1864
|
+
</optional>
|
1865
|
+
<oneOrMore>
|
1866
|
+
<ref name="BasicBlock"/>
|
1867
|
+
</oneOrMore>
|
1868
|
+
</element>
|
1869
|
+
</define>
|
1701
1870
|
</grammar>
|