metanorma-un 0.3.10 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +0 -1
- data/.github/workflows/ubuntu.yml +10 -7
- data/.github/workflows/windows.yml +0 -1
- data/Rakefile +2 -0
- data/lib/asciidoctor/un/biblio.rng +1 -1
- data/lib/asciidoctor/un/converter.rb +11 -16
- data/lib/asciidoctor/un/isodoc.rng +427 -0
- data/lib/asciidoctor/un/reqt.rng +23 -0
- data/lib/asciidoctor/un/un.rng +8 -0
- data/lib/isodoc/un.rb +1 -0
- data/lib/isodoc/un/base_convert.rb +24 -4
- data/lib/isodoc/un/html/htmlstyle.css +1096 -0
- data/lib/isodoc/un/html/unece.css +818 -0
- data/lib/isodoc/un/html/wordstyle.css +1237 -0
- data/lib/isodoc/un/html/wordstyle.scss +0 -1
- data/lib/isodoc/un/html_convert.rb +2 -2
- data/lib/isodoc/un/pdf_convert.rb +0 -14
- data/lib/isodoc/un/presentation_xml_convert.rb +10 -0
- data/lib/isodoc/un/un.plenary-attachment.xsl +733 -281
- data/lib/isodoc/un/un.plenary.xsl +733 -281
- data/lib/isodoc/un/un.recommendation.xsl +732 -266
- data/lib/isodoc/un/word_convert.rb +2 -2
- data/lib/isodoc/un/xref.rb +11 -13
- data/lib/metanorma/un/processor.rb +6 -8
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +2 -1
- metadata +26 -9
@@ -98,8 +98,8 @@ module IsoDoc
|
|
98
98
|
if node["inline-header"] == "true"
|
99
99
|
inline_header_title(out, node, c1)
|
100
100
|
else
|
101
|
-
div.send "h#{anchor(node['id'], :level, false) || '1'}" do |h|
|
102
|
-
lbl = anchor(node['id'], :label, false)
|
101
|
+
div.send "h#{@xrefs.anchor(node['id'], :level, false) || '1'}" do |h|
|
102
|
+
lbl = @xrefs.anchor(node['id'], :label, false)
|
103
103
|
if lbl && !@suppressheadingnumbers
|
104
104
|
h << "#{lbl}. "
|
105
105
|
insert_tab(h, 1)
|
data/lib/isodoc/un/xref.rb
CHANGED
@@ -2,9 +2,7 @@ require "roman-numerals"
|
|
2
2
|
|
3
3
|
module IsoDoc
|
4
4
|
module UN
|
5
|
-
|
6
|
-
MIDDLE_CLAUSE = "//clause[parent::sections]".freeze
|
7
|
-
|
5
|
+
class Xref < IsoDoc::Xref
|
8
6
|
def initial_anchor_names(d)
|
9
7
|
preface_names(d.at(ns("//preface/abstract")))
|
10
8
|
preface_names(d.at(ns("//foreword")))
|
@@ -75,7 +73,7 @@ module IsoDoc
|
|
75
73
|
num = num + 1
|
76
74
|
lbl = levelnumber(num, 1)
|
77
75
|
@anchors[clause["id"]] = { label: lbl, level: lvl, type: "clause",
|
78
|
-
xref: l10n("#{@
|
76
|
+
xref: l10n("#{@labels['clause']} #{lbl}") }
|
79
77
|
i = 1
|
80
78
|
clause.xpath(ns(NONTERMINAL)).each do |c|
|
81
79
|
next if c["unnumbered"] == "true"
|
@@ -89,7 +87,7 @@ module IsoDoc
|
|
89
87
|
leaf_section?(clause) and label_leaf_section(clause, level) and return
|
90
88
|
/\.(?<leafnum>[^.]+$)/ =~ num
|
91
89
|
@anchors[clause["id"]] = { label: leafnum, level: level, type: "clause",
|
92
|
-
xref: l10n("#{@
|
90
|
+
xref: l10n("#{@labels['clause']} #{num}") }
|
93
91
|
i = 1
|
94
92
|
clause.xpath(ns(NONTERMINAL)).each do |c|
|
95
93
|
next if c["unnumbered"] == "true"
|
@@ -99,11 +97,11 @@ module IsoDoc
|
|
99
97
|
end
|
100
98
|
|
101
99
|
def annex_name_lbl(clause, num)
|
102
|
-
l10n("<b>#{@
|
100
|
+
l10n("<b>#{@labels['annex']} #{num}</b>")
|
103
101
|
end
|
104
102
|
|
105
103
|
SUBCLAUSES =
|
106
|
-
|
104
|
+
"./clause | ./references | ./term | ./terms | ./definitions".freeze
|
107
105
|
|
108
106
|
|
109
107
|
def annex_names(clause, num)
|
@@ -112,13 +110,13 @@ module IsoDoc
|
|
112
110
|
label_annex_leaf_section(clause, num, 1) and return
|
113
111
|
@anchors[clause["id"]] = { label: annex_name_lbl(clause, num),
|
114
112
|
type: "clause",
|
115
|
-
xref: "#{@
|
113
|
+
xref: "#{@labels['annex']} #{num}", level: 1 }
|
116
114
|
if a = single_annex_special_section(clause)
|
117
115
|
annex_names1(a, "#{num}", 1)
|
118
116
|
else
|
119
117
|
i = 1
|
120
118
|
clause.xpath(ns(SUBCLAUSES)).each do |c|
|
121
|
-
|
119
|
+
next if c["unnumbered"] == "true"
|
122
120
|
annex_names1(c, "#{num}.#{annex_levelnum(i, 2)}", 2)
|
123
121
|
i += 1 if !leaf_section?(c)
|
124
122
|
end
|
@@ -129,8 +127,8 @@ module IsoDoc
|
|
129
127
|
leaf_section?(clause) and
|
130
128
|
label_annex_leaf_section(clause, num, level) and return
|
131
129
|
/\.(?<leafnum>[^.]+$)/ =~ num
|
132
|
-
@anchors[clause["id"]] = { label: leafnum, xref: "#{@
|
133
|
-
|
130
|
+
@anchors[clause["id"]] = { label: leafnum, xref: "#{@labels['annex']} #{num}",
|
131
|
+
level: level, type: "clause" }
|
134
132
|
i = 1
|
135
133
|
clause.xpath(ns("./clause | ./references")).each do |c|
|
136
134
|
next if c["unnumbered"] == "true"
|
@@ -158,7 +156,7 @@ module IsoDoc
|
|
158
156
|
clause.xpath(ns(".//admonition")).each do |t|
|
159
157
|
next if t["id"].nil? || t["id"].empty?
|
160
158
|
i += 1 unless t["unnumbered"] == "true"
|
161
|
-
@anchors[t["id"]] = anchor_struct(i.to_s, nil, @
|
159
|
+
@anchors[t["id"]] = anchor_struct(i.to_s, nil, @labels["admonition"],
|
162
160
|
"box", t["unnumbered"])
|
163
161
|
end
|
164
162
|
end
|
@@ -169,7 +167,7 @@ module IsoDoc
|
|
169
167
|
next if t["id"].nil? || t["id"].empty?
|
170
168
|
i += 1 unless t["unnumbered"] == "true"
|
171
169
|
@anchors[t["id"]] =
|
172
|
-
anchor_struct("#{num}.#{i}", nil, @
|
170
|
+
anchor_struct("#{num}.#{i}", nil, @labels["admonition"], "box",
|
173
171
|
t["unnumbered"])
|
174
172
|
end
|
175
173
|
end
|
@@ -30,18 +30,16 @@ module Metanorma
|
|
30
30
|
"Metanorma::UN #{Metanorma::UN::VERSION}"
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
Metanorma::UN::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
|
35
|
-
end
|
36
|
-
|
37
|
-
def output(isodoc_node, outname, format, options={})
|
33
|
+
def output(isodoc_node, inname, outname, format, options={})
|
38
34
|
case format
|
39
35
|
when :html
|
40
|
-
IsoDoc::UN::HtmlConvert.new(options).convert(
|
36
|
+
IsoDoc::UN::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
41
37
|
when :doc
|
42
|
-
IsoDoc::UN::WordConvert.new(options).convert(
|
38
|
+
IsoDoc::UN::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
43
39
|
when :pdf
|
44
|
-
IsoDoc::UN::PdfConvert.new(options).convert(
|
40
|
+
IsoDoc::UN::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
41
|
+
when :presentation
|
42
|
+
IsoDoc::UN::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
45
43
|
else
|
46
44
|
super
|
47
45
|
end
|
data/lib/metanorma/un/version.rb
CHANGED
data/metanorma-unece.gemspec
CHANGED
@@ -33,9 +33,10 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_dependency "iso-639"
|
34
34
|
|
35
35
|
spec.add_dependency "metanorma-standoc", "~> 1.4.0"
|
36
|
-
spec.add_dependency "isodoc", "~> 1.
|
36
|
+
spec.add_dependency "isodoc", "~> 1.1.0"
|
37
37
|
|
38
38
|
spec.add_development_dependency "byebug", "~> 9.1"
|
39
|
+
spec.add_development_dependency "sassc", "2.4.0"
|
39
40
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
40
41
|
spec.add_development_dependency "guard", "~> 2.14"
|
41
42
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-un
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.1.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.1.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: byebug
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '9.1'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: sassc
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.4.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.4.0
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: equivalent-xml
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,17 +287,21 @@ files:
|
|
273
287
|
- lib/isodoc/un/html/html_unece_intro.html
|
274
288
|
- lib/isodoc/un/html/html_unece_plenary_titlepage.html
|
275
289
|
- lib/isodoc/un/html/html_unece_titlepage.html
|
290
|
+
- lib/isodoc/un/html/htmlstyle.css
|
276
291
|
- lib/isodoc/un/html/htmlstyle.scss
|
277
292
|
- lib/isodoc/un/html/logo.jpg
|
278
293
|
- lib/isodoc/un/html/scripts.html
|
294
|
+
- lib/isodoc/un/html/unece.css
|
279
295
|
- lib/isodoc/un/html/unece.scss
|
280
296
|
- lib/isodoc/un/html/word_unece_intro.html
|
281
297
|
- lib/isodoc/un/html/word_unece_plenary_titlepage.html
|
282
298
|
- lib/isodoc/un/html/word_unece_titlepage.html
|
299
|
+
- lib/isodoc/un/html/wordstyle.css
|
283
300
|
- lib/isodoc/un/html/wordstyle.scss
|
284
301
|
- lib/isodoc/un/html_convert.rb
|
285
302
|
- lib/isodoc/un/metadata.rb
|
286
303
|
- lib/isodoc/un/pdf_convert.rb
|
304
|
+
- lib/isodoc/un/presentation_xml_convert.rb
|
287
305
|
- lib/isodoc/un/un.plenary-attachment.xsl
|
288
306
|
- lib/isodoc/un/un.plenary.xsl
|
289
307
|
- lib/isodoc/un/un.recommendation.xsl
|
@@ -300,7 +318,7 @@ homepage: https://github.com/metanorma/metanorma-un
|
|
300
318
|
licenses:
|
301
319
|
- BSD-2-Clause
|
302
320
|
metadata: {}
|
303
|
-
post_install_message:
|
321
|
+
post_install_message:
|
304
322
|
rdoc_options: []
|
305
323
|
require_paths:
|
306
324
|
- lib
|
@@ -315,9 +333,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
333
|
- !ruby/object:Gem::Version
|
316
334
|
version: '0'
|
317
335
|
requirements: []
|
318
|
-
|
319
|
-
|
320
|
-
signing_key:
|
336
|
+
rubygems_version: 3.0.3
|
337
|
+
signing_key:
|
321
338
|
specification_version: 4
|
322
339
|
summary: Metanorma for UN.
|
323
340
|
test_files: []
|