metanorma-itu 1.3.11 → 1.4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/lib/asciidoctor/itu/basicdoc.rng +21 -4
- data/lib/asciidoctor/itu/front.rb +5 -61
- data/lib/asciidoctor/itu/front_id.rb +67 -0
- data/lib/asciidoctor/itu/isodoc.rng +419 -77
- data/lib/asciidoctor/itu/itu.rng +3 -8
- data/lib/asciidoctor/itu/reqt.rng +23 -2
- data/lib/asciidoctor/itu/validate.rb +33 -31
- data/lib/asciidoctor/itu.rb +0 -1
- data/lib/isodoc/itu/base_convert.rb +5 -2
- data/lib/isodoc/itu/html/wordstyle.css +29 -8
- data/lib/isodoc/itu/html/wordstyle.scss +29 -8
- data/lib/isodoc/itu/i18n-ar.yaml +1 -0
- data/lib/isodoc/itu/i18n-de.yaml +1 -0
- data/lib/isodoc/itu/i18n-en.yaml +1 -0
- data/lib/isodoc/itu/i18n-es.yaml +1 -0
- data/lib/isodoc/itu/i18n-fr.yaml +1 -0
- data/lib/isodoc/itu/i18n-ru.yaml +1 -0
- data/lib/isodoc/itu/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc/itu/i18n.rb +1 -2
- data/lib/isodoc/itu/init.rb +1 -2
- data/lib/isodoc/itu/itu.implementers-guide.xsl +171 -11
- data/lib/isodoc/itu/itu.in-force.xsl +171 -11
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +171 -11
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +171 -11
- data/lib/isodoc/itu/itu.recommendation.xsl +171 -11
- data/lib/isodoc/itu/itu.resolution.xsl +171 -11
- data/lib/isodoc/itu/itu.service-publication.xsl +171 -11
- data/lib/isodoc/itu/itu.technical-paper.xsl +171 -11
- data/lib/isodoc/itu/itu.technical-report.xsl +171 -11
- data/lib/isodoc/itu/metadata.rb +3 -2
- data/lib/isodoc/itu/pdf_convert.rb +5 -4
- data/lib/isodoc/itu/terms.rb +9 -6
- data/lib/isodoc/itu.rb +0 -1
- data/lib/metanorma/itu/version.rb +1 -1
- data/metanorma-itu.gemspec +1 -2
- metadata +6 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e486ed509e01e8839797855e65a6431033298b7e307253f64b600fbc195f4caa
|
4
|
+
data.tar.gz: cbb5b77f6e2d99ded15a6e50375689d9f57f700d3f4f00d320e2ce110713d535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 550210205331fb08d6e5f9da8614f8f0f9b9883e4b353d79698a8530e4f71dce36cfd5b36d75b0fcce073569cc1f1cf33a83b9baf348179ad3f547a3c9221da6
|
7
|
+
data.tar.gz: 3900db56104d0d73841f932220178e3ef1e64cb085d60bcbdff5259e36fbdbca539b3dfc26d71a25934f4622a48ba7afb93813ac1bee7d86d66456064fee9692
|
data/Gemfile
CHANGED
@@ -6,6 +6,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
|
|
6
6
|
|
7
7
|
gemspec
|
8
8
|
|
9
|
-
if File.exist?
|
10
|
-
eval File.read(
|
9
|
+
if File.exist? "Gemfile.devel"
|
10
|
+
eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
|
11
11
|
end
|
data/Rakefile
CHANGED
data/bin/rspec
CHANGED
@@ -624,6 +624,9 @@
|
|
624
624
|
<choice>
|
625
625
|
<ref name="PureTextElement"/>
|
626
626
|
<ref name="stem"/>
|
627
|
+
<ref name="eref"/>
|
628
|
+
<ref name="xref"/>
|
629
|
+
<ref name="hyperlink"/>
|
627
630
|
</choice>
|
628
631
|
</zeroOrMore>
|
629
632
|
</element>
|
@@ -634,6 +637,9 @@
|
|
634
637
|
<choice>
|
635
638
|
<ref name="PureTextElement"/>
|
636
639
|
<ref name="stem"/>
|
640
|
+
<ref name="eref"/>
|
641
|
+
<ref name="xref"/>
|
642
|
+
<ref name="hyperlink"/>
|
637
643
|
</choice>
|
638
644
|
</zeroOrMore>
|
639
645
|
</element>
|
@@ -641,7 +647,12 @@
|
|
641
647
|
<define name="tt">
|
642
648
|
<element name="tt">
|
643
649
|
<zeroOrMore>
|
644
|
-
<
|
650
|
+
<choice>
|
651
|
+
<ref name="PureTextElement"/>
|
652
|
+
<ref name="eref"/>
|
653
|
+
<ref name="xref"/>
|
654
|
+
<ref name="hyperlink"/>
|
655
|
+
</choice>
|
645
656
|
</zeroOrMore>
|
646
657
|
</element>
|
647
658
|
</define>
|
@@ -822,7 +833,9 @@
|
|
822
833
|
<attribute name="alt"/>
|
823
834
|
</optional>
|
824
835
|
<ref name="CitationType"/>
|
825
|
-
<
|
836
|
+
<oneOrMore>
|
837
|
+
<ref name="PureTextElement"/>
|
838
|
+
</oneOrMore>
|
826
839
|
</define>
|
827
840
|
<define name="hyperlink">
|
828
841
|
<element name="link">
|
@@ -835,7 +848,9 @@
|
|
835
848
|
<optional>
|
836
849
|
<attribute name="alt"/>
|
837
850
|
</optional>
|
838
|
-
<
|
851
|
+
<oneOrMore>
|
852
|
+
<ref name="PureTextElement"/>
|
853
|
+
</oneOrMore>
|
839
854
|
</element>
|
840
855
|
</define>
|
841
856
|
<define name="xref">
|
@@ -849,7 +864,9 @@
|
|
849
864
|
<optional>
|
850
865
|
<attribute name="alt"/>
|
851
866
|
</optional>
|
852
|
-
<
|
867
|
+
<oneOrMore>
|
868
|
+
<ref name="PureTextElement"/>
|
869
|
+
</oneOrMore>
|
853
870
|
</element>
|
854
871
|
</define>
|
855
872
|
<define name="fn">
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "asciidoctor"
|
2
2
|
require "asciidoctor/standoc/converter"
|
3
3
|
require "fileutils"
|
4
|
+
require_relative "./front_id"
|
4
5
|
|
5
6
|
module Asciidoctor
|
6
7
|
module ITU
|
@@ -13,6 +14,10 @@ module Asciidoctor
|
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
17
|
+
def relaton_relations
|
18
|
+
super + %w(complements)
|
19
|
+
end
|
20
|
+
|
16
21
|
def title_attr(type, lang = "en")
|
17
22
|
{ language: lang, format: "text/plain", type: type }
|
18
23
|
end
|
@@ -109,55 +114,6 @@ module Asciidoctor
|
|
109
114
|
end
|
110
115
|
end
|
111
116
|
|
112
|
-
def metadata_id(node, xml)
|
113
|
-
provisional_id(node, xml)
|
114
|
-
itu_id(node, xml)
|
115
|
-
recommendation_id(node, xml)
|
116
|
-
end
|
117
|
-
|
118
|
-
def provisional_id(node, xml)
|
119
|
-
return unless node.attr("provisional-name")
|
120
|
-
|
121
|
-
xml.docidentifier **{ type: "ITU-provisional" } do |i|
|
122
|
-
i << node.attr("provisional-name")
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
ITULANG = { "en" => "E", "fr" => "F", "ar" => "A", "es" => "S",
|
127
|
-
"zh" => "C", "ru" => "R" }.freeze
|
128
|
-
|
129
|
-
def itu_id1(node, lang)
|
130
|
-
bureau = node.attr("bureau") || "T"
|
131
|
-
id = if doctype(node) == "service-publication"
|
132
|
-
@i18n.annex_to_itu_ob_abbrev.sub(/%/, node.attr("docnumber"))
|
133
|
-
else
|
134
|
-
"ITU-#{bureau} #{node.attr('docnumber')}"
|
135
|
-
end
|
136
|
-
id + (lang ? "-#{ITULANG[@lang]}" : "")
|
137
|
-
end
|
138
|
-
|
139
|
-
def itu_id(node, xml)
|
140
|
-
return unless node.attr("docnumber")
|
141
|
-
|
142
|
-
xml.docidentifier **{ type: "ITU" } do |i|
|
143
|
-
i << itu_id1(node, false)
|
144
|
-
end
|
145
|
-
xml.docidentifier **{ type: "ITU-lang" } do |i|
|
146
|
-
i << itu_id1(node, true)
|
147
|
-
end
|
148
|
-
xml.docnumber { |i| i << node.attr("docnumber") }
|
149
|
-
end
|
150
|
-
|
151
|
-
def recommendation_id(node, xml)
|
152
|
-
return unless node.attr("recommendationnumber")
|
153
|
-
|
154
|
-
node.attr("recommendationnumber").split("/").each do |s|
|
155
|
-
xml.docidentifier **{ type: "ITU-Recommendation" } do |i|
|
156
|
-
i << s
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
117
|
def metadata_series(node, xml)
|
162
118
|
node.attr("series") and
|
163
119
|
xml.series **{ type: "main" } do |s|
|
@@ -191,18 +147,6 @@ module Asciidoctor
|
|
191
147
|
xml.ip_notice_received (node.attr("ip-notice-received") || "false")
|
192
148
|
end
|
193
149
|
|
194
|
-
def structured_id(node, xml)
|
195
|
-
return unless node.attr("docnumber")
|
196
|
-
|
197
|
-
xml.structuredidentifier do |i|
|
198
|
-
i.bureau node.attr("bureau") || "T"
|
199
|
-
i.docnumber node.attr("docnumber")
|
200
|
-
a = node.attr("annexid") and i.annexid a
|
201
|
-
a = node.attr("amendment-number") and i.amendment a
|
202
|
-
a = node.attr("corrigendum-number") and i.corrigendum a
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
150
|
def metadata_techreport(node, xml)
|
207
151
|
a = node.attr("meeting") and
|
208
152
|
metadata_meeting(a, node.attr("meeting-acronym"), xml)
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Asciidoctor
|
2
|
+
module ITU
|
3
|
+
class Converter < Standoc::Converter
|
4
|
+
def metadata_id(node, xml)
|
5
|
+
provisional_id(node, xml)
|
6
|
+
itu_id(node, xml)
|
7
|
+
recommendation_id(node, xml)
|
8
|
+
end
|
9
|
+
|
10
|
+
def provisional_id(node, xml)
|
11
|
+
return unless node.attr("provisional-name")
|
12
|
+
|
13
|
+
xml.docidentifier **{ type: "ITU-provisional" } do |i|
|
14
|
+
i << node.attr("provisional-name")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
ITULANG = { "en" => "E", "fr" => "F", "ar" => "A", "es" => "S",
|
19
|
+
"zh" => "C", "ru" => "R" }.freeze
|
20
|
+
|
21
|
+
def itu_id1(node, lang)
|
22
|
+
bureau = node.attr("bureau") || "T"
|
23
|
+
id = if doctype(node) == "service-publication"
|
24
|
+
@i18n.annex_to_itu_ob_abbrev.sub(/%/,
|
25
|
+
node.attr("docnumber"))
|
26
|
+
else
|
27
|
+
"ITU-#{bureau} #{node.attr('docnumber')}"
|
28
|
+
end
|
29
|
+
id + (lang ? "-#{ITULANG[@lang]}" : "")
|
30
|
+
end
|
31
|
+
|
32
|
+
def itu_id(node, xml)
|
33
|
+
return unless node.attr("docnumber")
|
34
|
+
|
35
|
+
xml.docidentifier **{ type: "ITU" } do |i|
|
36
|
+
i << itu_id1(node, false)
|
37
|
+
end
|
38
|
+
xml.docidentifier **{ type: "ITU-lang" } do |i|
|
39
|
+
i << itu_id1(node, true)
|
40
|
+
end
|
41
|
+
xml.docnumber { |i| i << node.attr("docnumber") }
|
42
|
+
end
|
43
|
+
|
44
|
+
def recommendation_id(node, xml)
|
45
|
+
return unless node.attr("recommendationnumber")
|
46
|
+
|
47
|
+
node.attr("recommendationnumber").split("/").each do |s|
|
48
|
+
xml.docidentifier **{ type: "ITU-Recommendation" } do |i|
|
49
|
+
i << s
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def structured_id(node, xml)
|
55
|
+
return unless node.attr("docnumber")
|
56
|
+
|
57
|
+
xml.structuredidentifier do |i|
|
58
|
+
i.bureau node.attr("bureau") || "T"
|
59
|
+
i.docnumber node.attr("docnumber")
|
60
|
+
a = node.attr("annexid") and i.annexid a
|
61
|
+
a = node.attr("amendment-number") and i.amendment a
|
62
|
+
a = node.attr("corrigendum-number") and i.corrigendum a
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|