metanorma-un 0.6.8 → 0.6.12
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/lib/asciidoctor/un/converter.rb +27 -27
- data/lib/asciidoctor/un/isodoc.rng +49 -11
- data/lib/asciidoctor/un/reqt.rng +15 -4
- data/lib/asciidoctor/un/validate.rb +3 -4
- data/lib/isodoc/un/html/htmlstyle.css +6 -0
- data/lib/isodoc/un/html/htmlstyle.scss +7 -0
- data/lib/isodoc/un/i18n.rb +0 -1
- data/lib/isodoc/un/init.rb +1 -2
- data/lib/isodoc/un/un.plenary-attachment.xsl +352 -61
- data/lib/isodoc/un/un.plenary.xsl +352 -61
- data/lib/isodoc/un/un.recommendation.xsl +357 -65
- data/lib/isodoc/un.rb +0 -1
- data/lib/metanorma/un/input.rb +1 -3
- data/lib/metanorma/un/processor.rb +2 -1
- data/lib/metanorma/un/version.rb +1 -1
- data/lib/metanorma/un.rb +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81239633565c9e41ab2e2dd7ac8e30b6d17306628a0038c88d400ae4d97a16cd
|
4
|
+
data.tar.gz: 5b83a51cdc3f1dc81692e8721e9a3443fb025fb9cd39ea3cd33c8904ab2a2db4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8b00137085f9cb9b4d4821475b10b36df50d3d90b8e1d1f4bc3dd4d50f346af5f9701b49c8e4f46a7eba212e4965ac7b8ec9b47086e638e7053390dff08c466
|
7
|
+
data.tar.gz: 79b6c46e6d568f014e238731e2add2ad696a0a2ae538a9d797a557eb66a7729964e24eb8ddb393da2a4663c73a794f7b795b0930cf7a0abca9ae76c52deaf4fb
|
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
@@ -17,13 +17,14 @@ module Asciidoctor
|
|
17
17
|
|
18
18
|
def metadata_committee(node, xml)
|
19
19
|
return unless node.attr("committee")
|
20
|
+
|
20
21
|
xml.editorialgroup do |a|
|
21
22
|
a.committee node.attr("committee"),
|
22
|
-
|
23
|
+
**attr_code(type: node.attr("committee-type"))
|
23
24
|
i = 2
|
24
|
-
while node.attr("committee_#{i}")
|
25
|
+
while node.attr("committee_#{i}")
|
25
26
|
a.committee node.attr("committee_#{i}"),
|
26
|
-
|
27
|
+
**attr_code(type: node.attr("committee-type_#{i}"))
|
27
28
|
i += 1
|
28
29
|
end
|
29
30
|
end
|
@@ -66,13 +67,13 @@ module Asciidoctor
|
|
66
67
|
xml.session do |session|
|
67
68
|
session.number node.attr("session") if node.attr("session")
|
68
69
|
session.date node.attr("session-date") if node.attr("session-date")
|
69
|
-
node&.attr("item-number")&.split(/,
|
70
|
+
node&.attr("item-number")&.split(/, */)&.each do |i|
|
70
71
|
session.item_number i
|
71
72
|
end
|
72
|
-
node&.attr("item-name")&.split(/,
|
73
|
+
node&.attr("item-name")&.split(/, */)&.each do |i|
|
73
74
|
session.item_name i
|
74
75
|
end
|
75
|
-
node&.attr("subitem-name")&.split(/,
|
76
|
+
node&.attr("subitem-name")&.split(/, */)&.each do |i|
|
76
77
|
session.subitem_name i
|
77
78
|
end
|
78
79
|
node.attr("collaborator") and
|
@@ -84,13 +85,13 @@ module Asciidoctor
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def metadata_language(node, xml)
|
87
|
-
languages = node&.attr("language")&.split(/,
|
88
|
+
languages = node&.attr("language")&.split(/, */) ||
|
88
89
|
%w(ar ru en fr zh es)
|
89
90
|
languages.each { |l| xml.language l }
|
90
91
|
end
|
91
92
|
|
92
93
|
def metadata_submission_language(node, xml)
|
93
|
-
languages = node&.attr("submissionlanguage")&.split(/,
|
94
|
+
languages = node&.attr("submissionlanguage")&.split(/, */) || []
|
94
95
|
languages.each { |l| xml.submissionlanguage l }
|
95
96
|
end
|
96
97
|
|
@@ -101,7 +102,7 @@ module Asciidoctor
|
|
101
102
|
metadata_submission_language(node, xml)
|
102
103
|
end
|
103
104
|
|
104
|
-
def title_validate(
|
105
|
+
def title_validate(_root)
|
105
106
|
nil
|
106
107
|
end
|
107
108
|
|
@@ -114,12 +115,11 @@ module Asciidoctor
|
|
114
115
|
|
115
116
|
def doctype(node)
|
116
117
|
d = super
|
117
|
-
unless %w{plenary recommendation addendum communication corrigendum
|
118
|
-
|
119
|
-
|
120
|
-
@log.add(
|
121
|
-
|
122
|
-
"#{d} is not a legal document type: reverting to 'recommendation'")
|
118
|
+
unless %w{plenary recommendation addendum communication corrigendum
|
119
|
+
reissue agenda budgetary sec-gen-notes expert-report
|
120
|
+
resolution plenary-attachment}.include? d
|
121
|
+
@log.add("Document Attributes", nil,
|
122
|
+
"#{d} is not a legal document type: reverting to 'recommendation'")
|
123
123
|
d = "recommendation"
|
124
124
|
end
|
125
125
|
d
|
@@ -128,11 +128,11 @@ module Asciidoctor
|
|
128
128
|
def outputs(node, ret)
|
129
129
|
File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
|
130
130
|
presentation_xml_converter(node).convert(@filename + ".xml")
|
131
|
-
html_converter(node).convert(@filename + ".presentation.xml",
|
131
|
+
html_converter(node).convert(@filename + ".presentation.xml",
|
132
132
|
nil, false, "#{@filename}.html")
|
133
|
-
doc_converter(node).convert(@filename + ".presentation.xml",
|
133
|
+
doc_converter(node).convert(@filename + ".presentation.xml",
|
134
134
|
nil, false, "#{@filename}.doc")
|
135
|
-
pdf_converter(node)&.convert(@filename + ".presentation.xml",
|
135
|
+
pdf_converter(node)&.convert(@filename + ".presentation.xml",
|
136
136
|
nil, false, "#{@filename}.pdf")
|
137
137
|
end
|
138
138
|
|
@@ -142,8 +142,8 @@ module Asciidoctor
|
|
142
142
|
File.join(File.dirname(__FILE__), "un.rng"))
|
143
143
|
end
|
144
144
|
|
145
|
-
def style(
|
146
|
-
|
145
|
+
def style(_node, _text)
|
146
|
+
nil
|
147
147
|
end
|
148
148
|
|
149
149
|
def html_extract_attributes(node)
|
@@ -168,6 +168,7 @@ module Asciidoctor
|
|
168
168
|
|
169
169
|
def pdf_converter(node)
|
170
170
|
return nil if node.attr("no-pdf")
|
171
|
+
|
171
172
|
IsoDoc::UN::PdfConvert.new(doc_extract_attributes(node))
|
172
173
|
end
|
173
174
|
|
@@ -196,25 +197,24 @@ module Asciidoctor
|
|
196
197
|
xmldoc.xpath("//clause/p | //annex/p").each do |p|
|
197
198
|
cl = Nokogiri::XML::Node.new("clause", xmldoc)
|
198
199
|
cl["id"] = p["id"]
|
199
|
-
cl["inline-header"]="true"
|
200
|
-
p["id"] = "_
|
200
|
+
cl["inline-header"] = "true"
|
201
|
+
p["id"] = "_#{UUIDTools::UUID.random_create}"
|
201
202
|
p.replace(cl)
|
202
203
|
p.parent = cl
|
203
|
-
while n = cl.next_element
|
204
|
+
while (n = cl.next_element) && !%w(p clause).include?(n.name)
|
204
205
|
n.parent = cl
|
205
206
|
end
|
206
207
|
end
|
207
208
|
end
|
208
209
|
|
209
210
|
def admonition_attrs(node)
|
210
|
-
attr_code(super.merge(
|
211
|
-
|
211
|
+
attr_code(super.merge(unnumbered: node.option?("unnumbered"),
|
212
|
+
subsequence: node.attr("subsequence")))
|
212
213
|
end
|
213
214
|
|
214
215
|
def sectiontype_streamline(ret)
|
215
216
|
case ret
|
216
|
-
when "foreword" then "donotrecognise-foreword"
|
217
|
-
when "introduction" then "donotrecognise-foreword"
|
217
|
+
when "foreword", "introduction" then "donotrecognise-foreword"
|
218
218
|
else
|
219
219
|
super
|
220
220
|
end
|
@@ -32,6 +32,18 @@
|
|
32
32
|
<ref name="DocumentType"/>
|
33
33
|
</element>
|
34
34
|
</define>
|
35
|
+
<define name="section-title">
|
36
|
+
<element name="title">
|
37
|
+
<zeroOrMore>
|
38
|
+
<ref name="TextElement"/>
|
39
|
+
</zeroOrMore>
|
40
|
+
</element>
|
41
|
+
<zeroOrMore>
|
42
|
+
<element name="variant-title">
|
43
|
+
<ref name="TypedTitleString"/>
|
44
|
+
</element>
|
45
|
+
</zeroOrMore>
|
46
|
+
</define>
|
35
47
|
<define name="hyperlink">
|
36
48
|
<element name="link">
|
37
49
|
<attribute name="target">
|
@@ -158,15 +170,17 @@
|
|
158
170
|
<data type="boolean"/>
|
159
171
|
</attribute>
|
160
172
|
</optional>
|
161
|
-
<
|
162
|
-
<
|
163
|
-
<
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
173
|
+
<optional>
|
174
|
+
<attribute name="type">
|
175
|
+
<choice>
|
176
|
+
<value>roman</value>
|
177
|
+
<value>alphabet</value>
|
178
|
+
<value>arabic</value>
|
179
|
+
<value>roman_upper</value>
|
180
|
+
<value>alphabet_upper</value>
|
181
|
+
</choice>
|
182
|
+
</attribute>
|
183
|
+
</optional>
|
170
184
|
<oneOrMore>
|
171
185
|
<ref name="li"/>
|
172
186
|
</oneOrMore>
|
@@ -976,6 +990,16 @@
|
|
976
990
|
<data type="boolean"/>
|
977
991
|
</attribute>
|
978
992
|
</optional>
|
993
|
+
<optional>
|
994
|
+
<attribute name="linkmention">
|
995
|
+
<data type="boolean"/>
|
996
|
+
</attribute>
|
997
|
+
</optional>
|
998
|
+
<optional>
|
999
|
+
<attribute name="linkref">
|
1000
|
+
<data type="boolean"/>
|
1001
|
+
</attribute>
|
1002
|
+
</optional>
|
979
1003
|
<optional>
|
980
1004
|
<element name="refterm">
|
981
1005
|
<zeroOrMore>
|
@@ -1012,6 +1036,7 @@
|
|
1012
1036
|
<ref name="svgmap"/>
|
1013
1037
|
<ref name="inputform"/>
|
1014
1038
|
<ref name="toc"/>
|
1039
|
+
<ref name="passthrough"/>
|
1015
1040
|
</choice>
|
1016
1041
|
</define>
|
1017
1042
|
<define name="toc">
|
@@ -1019,6 +1044,14 @@
|
|
1019
1044
|
<ref name="ul"/>
|
1020
1045
|
</element>
|
1021
1046
|
</define>
|
1047
|
+
<define name="passthrough">
|
1048
|
+
<element name="passthrough">
|
1049
|
+
<optional>
|
1050
|
+
<attribute name="formats"/>
|
1051
|
+
</optional>
|
1052
|
+
<text/>
|
1053
|
+
</element>
|
1054
|
+
</define>
|
1022
1055
|
<define name="inputform">
|
1023
1056
|
<element name="form">
|
1024
1057
|
<attribute name="id">
|
@@ -1686,7 +1719,9 @@
|
|
1686
1719
|
<zeroOrMore>
|
1687
1720
|
<ref name="termgrammar"/>
|
1688
1721
|
</zeroOrMore>
|
1689
|
-
<
|
1722
|
+
<oneOrMore>
|
1723
|
+
<ref name="termdefinition"/>
|
1724
|
+
</oneOrMore>
|
1690
1725
|
<zeroOrMore>
|
1691
1726
|
<ref name="termnote"/>
|
1692
1727
|
</zeroOrMore>
|
@@ -1749,7 +1784,7 @@
|
|
1749
1784
|
</oneOrMore>
|
1750
1785
|
</element>
|
1751
1786
|
</define>
|
1752
|
-
<define name="
|
1787
|
+
<define name="termdefinition">
|
1753
1788
|
<element name="definition">
|
1754
1789
|
<oneOrMore>
|
1755
1790
|
<choice>
|
@@ -1758,6 +1793,9 @@
|
|
1758
1793
|
<ref name="formula"/>
|
1759
1794
|
</choice>
|
1760
1795
|
</oneOrMore>
|
1796
|
+
<zeroOrMore>
|
1797
|
+
<ref name="termsource"/>
|
1798
|
+
</zeroOrMore>
|
1761
1799
|
</element>
|
1762
1800
|
</define>
|
1763
1801
|
<define name="termnote">
|
data/lib/asciidoctor/un/reqt.rng
CHANGED
@@ -64,9 +64,9 @@
|
|
64
64
|
<optional>
|
65
65
|
<ref name="label"/>
|
66
66
|
</optional>
|
67
|
-
<
|
67
|
+
<zeroOrMore>
|
68
68
|
<ref name="subject"/>
|
69
|
-
</
|
69
|
+
</zeroOrMore>
|
70
70
|
<zeroOrMore>
|
71
71
|
<ref name="reqinherit"/>
|
72
72
|
</zeroOrMore>
|
@@ -80,6 +80,7 @@
|
|
80
80
|
<ref name="verification"/>
|
81
81
|
<ref name="import"/>
|
82
82
|
<ref name="description"/>
|
83
|
+
<ref name="component"/>
|
83
84
|
</choice>
|
84
85
|
</zeroOrMore>
|
85
86
|
<optional>
|
@@ -105,12 +106,16 @@
|
|
105
106
|
</define>
|
106
107
|
<define name="subject">
|
107
108
|
<element name="subject">
|
108
|
-
<
|
109
|
+
<oneOrMore>
|
110
|
+
<ref name="TextElement"/>
|
111
|
+
</oneOrMore>
|
109
112
|
</element>
|
110
113
|
</define>
|
111
114
|
<define name="reqinherit">
|
112
115
|
<element name="inherit">
|
113
|
-
<
|
116
|
+
<oneOrMore>
|
117
|
+
<ref name="TextElement"/>
|
118
|
+
</oneOrMore>
|
114
119
|
</element>
|
115
120
|
</define>
|
116
121
|
<define name="measurementtarget">
|
@@ -138,6 +143,12 @@
|
|
138
143
|
<ref name="RequirementSubpart"/>
|
139
144
|
</element>
|
140
145
|
</define>
|
146
|
+
<define name="component">
|
147
|
+
<element name="component">
|
148
|
+
<attribute name="class"/>
|
149
|
+
<ref name="RequirementSubpart"/>
|
150
|
+
</element>
|
151
|
+
</define>
|
141
152
|
<define name="reqt_references">
|
142
153
|
<element name="references">
|
143
154
|
<oneOrMore>
|
@@ -13,11 +13,10 @@ module Asciidoctor
|
|
13
13
|
def stage_validate(xmldoc)
|
14
14
|
stage = xmldoc&.at("//bibdata/status/stage")&.text
|
15
15
|
%w(proposal working-draft committee-draft draft-standard final-draft
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
published withdrawn).include? stage or
|
17
|
+
@log.add("Document Attributes", nil,
|
18
|
+
"#{stage} is not a recognised status")
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
data/lib/isodoc/un/i18n.rb
CHANGED
data/lib/isodoc/un/init.rb
CHANGED
@@ -11,7 +11,7 @@ module IsoDoc
|
|
11
11
|
@meta.set(:toc, @toc)
|
12
12
|
end
|
13
13
|
|
14
|
-
def xref_init(lang, script,
|
14
|
+
def xref_init(lang, script, _klass, labels, options)
|
15
15
|
html = HtmlConvert.new(language: lang, script: script)
|
16
16
|
@xrefs = Xref.new(lang, script, html, labels, options)
|
17
17
|
end
|
@@ -26,4 +26,3 @@ module IsoDoc
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|