metanorma-itu 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.adoc +4 -4
- data/lib/asciidoctor/itu/basicdoc.rng +6 -8
- data/lib/asciidoctor/itu/cleanup.rb +92 -0
- data/lib/asciidoctor/itu/converter.rb +14 -52
- data/lib/asciidoctor/itu/itu.rng +48 -0
- data/lib/asciidoctor/itu/macros.rb +22 -14
- data/lib/asciidoctor/itu/validate.rb +14 -0
- data/lib/isodoc/itu/base_convert.rb +65 -77
- data/lib/isodoc/itu/html/htmlstyle.scss +12 -1
- data/lib/isodoc/itu/html/itu.scss +29 -4
- data/lib/isodoc/itu/html/word_itu_intro.html +58 -18
- data/lib/isodoc/itu/html/wordstyle.scss +73 -10
- data/lib/isodoc/itu/i18n-en.yaml +1 -0
- data/lib/isodoc/itu/terms.rb +87 -0
- data/lib/isodoc/itu/word_convert.rb +41 -6
- data/lib/metanorma/itu/version.rb +1 -1
- data/metanorma-itu.gemspec +2 -1
- metadata +32 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39299e29cd911ccc2c3ee6da83a7eb7bc2c82fae171e59f01ffc079a757d941e
|
|
4
|
+
data.tar.gz: b7dbd2216cdf8afb36d5104bff9353450e3da6617cc75c67f448c06ea94eab4d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5bb0e107c92028f5c34a11b8a0331a34a2e5adc15892703deffbe4391e4cc5d7582c95589819f917eeae1362de8adbd683fb546d193b3d8e7ae230df7e3c7fa
|
|
7
|
+
data.tar.gz: 3330e9cfb48867c2031b89eec8ac9402a01423b288d3f14e5395dba16b6f24d681d3024bf150c6cf676a6a116e5310eed03999c47b012689908f2671efceb760
|
data/README.adoc
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
= metanorma-itu: Asciidoctor processor for ITU
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/metanorma-itu.svg["Gem Version", link="https://rubygems.org/gems/metanorma-itu"]
|
|
4
|
-
image:https://travis-ci.com/metanorma/metanorma-itu.svg
|
|
4
|
+
image:https://travis-ci.com/metanorma/metanorma-itu.svg["Build Status", link="https://travis-ci.com/metanorma/metanorma-itu"]
|
|
5
|
+
image:https://ci.appveyor.com/api/projects/status/pl6lh4a9224ijbe1?svg=true["Appveyor Build Status", link="https://ci.appveyor.com/project/metanorma/metanorma-itu"]
|
|
5
6
|
image:https://codeclimate.com/github/metanorma/metanorma-itu/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-itu"]
|
|
6
|
-
image:https://
|
|
7
|
-
|
|
8
|
-
WARNING: This gem is still under development.
|
|
7
|
+
image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-itu.svg["Pull Requests", link="https://github.com/metanorma/metanorma-itu/pulls"]
|
|
8
|
+
image:https://img.shields.io/github/commits-since/metanorma/metanorma-itu/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-itu/releases"]
|
|
9
9
|
|
|
10
10
|
== Functionality
|
|
11
11
|
|
|
@@ -341,11 +341,6 @@
|
|
|
341
341
|
</oneOrMore>
|
|
342
342
|
</element>
|
|
343
343
|
</define>
|
|
344
|
-
<define name="tclass">
|
|
345
|
-
<element name="name">
|
|
346
|
-
<text/>
|
|
347
|
-
</element>
|
|
348
|
-
</define>
|
|
349
344
|
<define name="thead">
|
|
350
345
|
<element name="thead">
|
|
351
346
|
<ref name="tr"/>
|
|
@@ -515,19 +510,22 @@
|
|
|
515
510
|
<attribute name="subsequence"/>
|
|
516
511
|
</optional>
|
|
517
512
|
<optional>
|
|
518
|
-
<
|
|
513
|
+
<attribute name="class"/>
|
|
519
514
|
</optional>
|
|
520
515
|
<optional>
|
|
521
|
-
<ref name="
|
|
516
|
+
<ref name="source"/>
|
|
522
517
|
</optional>
|
|
523
518
|
<optional>
|
|
524
|
-
<ref name="
|
|
519
|
+
<ref name="tname"/>
|
|
525
520
|
</optional>
|
|
526
521
|
<choice>
|
|
527
522
|
<ref name="image"/>
|
|
528
523
|
<ref name="video"/>
|
|
529
524
|
<ref name="audio"/>
|
|
530
525
|
<ref name="pre"/>
|
|
526
|
+
<oneOrMore>
|
|
527
|
+
<ref name="paragraph-with-footnote"/>
|
|
528
|
+
</oneOrMore>
|
|
531
529
|
<zeroOrMore>
|
|
532
530
|
<ref name="figure"/>
|
|
533
531
|
</zeroOrMore>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
module Asciidoctor
|
|
2
|
+
module ITU
|
|
3
|
+
class Converter < Standoc::Converter
|
|
4
|
+
def sections_cleanup(x)
|
|
5
|
+
super
|
|
6
|
+
x.xpath("//*[@inline-header]").each do |h|
|
|
7
|
+
h.delete("inline-header")
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def cleanup(xmldoc)
|
|
12
|
+
symbols_cleanup(xmldoc)
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def smartquotes_cleanup(xmldoc)
|
|
17
|
+
return super if @smartquotes
|
|
18
|
+
xmldoc.traverse do |n|
|
|
19
|
+
next unless n.text?
|
|
20
|
+
n.replace(n.text.gsub(/\u2019|\u2018|\u201a|\u201b/, "'").
|
|
21
|
+
gsub(/\u201c|\u201d|\u201e|\u201f/, '"'))
|
|
22
|
+
end
|
|
23
|
+
xmldoc
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def termdef_cleanup(xmldoc)
|
|
27
|
+
xmldoc.xpath("//term/preferred").each do |p|
|
|
28
|
+
if ["terms defined elsewhere",
|
|
29
|
+
"terms defined in this recommendation"].include? p.text.downcase
|
|
30
|
+
p.name = "title"
|
|
31
|
+
p.parent.name = "terms"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
super
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def termdef_boilerplate_cleanup(xmldoc)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def symbols_cleanup(xmldoc)
|
|
41
|
+
sym = xmldoc.at("//definitions/title")
|
|
42
|
+
sym and sym&.next_element&.name == "dl" and
|
|
43
|
+
sym.next = "<p>#{@symbols_boilerplate}</p>"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
PUBLISHER = "./contributor[role/@type = 'publisher']/organization".freeze
|
|
47
|
+
|
|
48
|
+
def pub_class(bib)
|
|
49
|
+
return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ITU']")
|
|
50
|
+
return 1 if bib.at("#{PUBLISHER}[name = 'International Telecommunication Union']")
|
|
51
|
+
return 2 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
|
|
52
|
+
return 2 if bib.at("#{PUBLISHER}[name = 'International Organization "\
|
|
53
|
+
"for Standardization']")
|
|
54
|
+
return 3 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
|
|
55
|
+
return 3 if bib.at("#{PUBLISHER}[name = 'International "\
|
|
56
|
+
"Electrotechnical Commission']")
|
|
57
|
+
return 4 if bib.at("./docidentifier[@type][not(@type = 'DOI' or "\
|
|
58
|
+
"@type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN')]")
|
|
59
|
+
5
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def sort_biblio(bib)
|
|
63
|
+
bib.sort do |a, b|
|
|
64
|
+
sort_biblio_key(a) <=> sort_biblio_key(b)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# sort by: doc class (ITU, ISO, IEC, other standard (not DOI &c), other
|
|
69
|
+
# then standard class (docid class other than DOI &c)
|
|
70
|
+
# then alphanumeric doc id (not DOI &c)
|
|
71
|
+
# then title
|
|
72
|
+
def sort_biblio_key(bib)
|
|
73
|
+
pubclass = pub_class(bib)
|
|
74
|
+
num = bib&.at("./docnumber")&.text
|
|
75
|
+
id = bib&.at("./docidentifier[not(@type = 'DOI' or "\
|
|
76
|
+
"@type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN')]")
|
|
77
|
+
metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text
|
|
78
|
+
abbrid = metaid unless /^\[\d+\]$/.match(metaid)
|
|
79
|
+
type = id['type'] if id
|
|
80
|
+
title = bib&.at("./title[@type = 'main']")&.text ||
|
|
81
|
+
bib&.at("./title")&.text || bib&.at("./formattedref")&.text
|
|
82
|
+
"#{pubclass} :: #{type} :: #{id&.text || metaid} :: #{title}"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def biblio_reorder(xmldoc)
|
|
86
|
+
xmldoc.xpath("//references").each do |r|
|
|
87
|
+
biblio_reorder1(r)
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -3,6 +3,7 @@ require "asciidoctor/standoc/converter"
|
|
|
3
3
|
require "fileutils"
|
|
4
4
|
require_relative "./front.rb"
|
|
5
5
|
require_relative "./validate.rb"
|
|
6
|
+
require_relative "./cleanup.rb"
|
|
6
7
|
require_relative "./macros.rb"
|
|
7
8
|
|
|
8
9
|
module Asciidoctor
|
|
@@ -12,16 +13,22 @@ module Asciidoctor
|
|
|
12
13
|
# schema encapsulation of the document for validation
|
|
13
14
|
#
|
|
14
15
|
class Converter < Standoc::Converter
|
|
16
|
+
register_for "itu"
|
|
17
|
+
|
|
15
18
|
Asciidoctor::Extensions.register do
|
|
16
|
-
|
|
19
|
+
inline_macro AddMacro
|
|
20
|
+
inline_macro DelMacro
|
|
17
21
|
end
|
|
18
22
|
|
|
19
|
-
register_for "itu"
|
|
20
|
-
|
|
21
23
|
def title_validate(root)
|
|
22
24
|
nil
|
|
23
25
|
end
|
|
24
26
|
|
|
27
|
+
def init(node)
|
|
28
|
+
super
|
|
29
|
+
@smartquotes = node.attr("smartquotes") == "true"
|
|
30
|
+
end
|
|
31
|
+
|
|
25
32
|
def makexml(node)
|
|
26
33
|
result = ["<?xml version='1.0' encoding='UTF-8'?>\n<itu-standard>"]
|
|
27
34
|
@draft = node.attributes.has_key?("draft")
|
|
@@ -39,28 +46,15 @@ module Asciidoctor
|
|
|
39
46
|
node.attr("doctype") || "recommendation"
|
|
40
47
|
end
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
role = node.role || node.attr("style")
|
|
44
|
-
return pseudocode_example(node) if role == "pseudocode"
|
|
45
|
-
super
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def pseudocode_example(node)
|
|
49
|
+
def olist(node)
|
|
49
50
|
noko do |xml|
|
|
50
|
-
xml.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
wrap_in_para(node, ex)
|
|
51
|
+
xml.ol **attr_code(id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
|
|
52
|
+
class: node.attr("class")) do |xml_ol|
|
|
53
|
+
node.items.each { |item| li(xml_ol, item) }
|
|
54
54
|
end
|
|
55
55
|
end.join("\n")
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def init_indent(s)
|
|
59
|
-
/^(?<prefix>[ \t]*)(?<suffix>.*)$/ =~ s
|
|
60
|
-
prefix = prefix.gsub(/\t/, "    ").gsub(/ /, " ")
|
|
61
|
-
prefix + suffix
|
|
62
|
-
end
|
|
63
|
-
|
|
64
58
|
def clause_parse(attrs, xml, node)
|
|
65
59
|
attrs[:preface] = true if node.attr("style") == "preface"
|
|
66
60
|
super
|
|
@@ -101,18 +95,6 @@ module Asciidoctor
|
|
|
101
95
|
File.join(File.dirname(__FILE__), "itu.rng"))
|
|
102
96
|
end
|
|
103
97
|
|
|
104
|
-
def sections_cleanup(x)
|
|
105
|
-
super
|
|
106
|
-
x.xpath("//*[@inline-header]").each do |h|
|
|
107
|
-
h.delete("inline-header")
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
def cleanup(xmldoc)
|
|
112
|
-
symbols_cleanup(xmldoc)
|
|
113
|
-
super
|
|
114
|
-
end
|
|
115
|
-
|
|
116
98
|
def style(n, t)
|
|
117
99
|
return
|
|
118
100
|
end
|
|
@@ -170,20 +152,6 @@ module Asciidoctor
|
|
|
170
152
|
"Definitions"
|
|
171
153
|
end
|
|
172
154
|
|
|
173
|
-
def termdef_cleanup(xmldoc)
|
|
174
|
-
xmldoc.xpath("//term/preferred").each do |p|
|
|
175
|
-
if ["terms defined elsewhere",
|
|
176
|
-
"terms defined in this recommendation"].include? p.text.downcase
|
|
177
|
-
p.name = "title"
|
|
178
|
-
p.parent.name = "terms"
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
super
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
def termdef_boilerplate_cleanup(xmldoc)
|
|
185
|
-
end
|
|
186
|
-
|
|
187
155
|
def terms_extract(div)
|
|
188
156
|
internal = nil
|
|
189
157
|
external = nil
|
|
@@ -213,12 +181,6 @@ module Asciidoctor
|
|
|
213
181
|
|
|
214
182
|
NORM_REF = "//bibliography/references[title = 'References']".freeze
|
|
215
183
|
|
|
216
|
-
def symbols_cleanup(xmldoc)
|
|
217
|
-
sym = xmldoc.at("//definitions/title")
|
|
218
|
-
sym and sym&.next_element&.name == "dl" and
|
|
219
|
-
sym.next = "<p>#{@symbols_boilerplate}</p>"
|
|
220
|
-
end
|
|
221
|
-
|
|
222
184
|
def load_yaml(lang, script)
|
|
223
185
|
y = if @i18nyaml then YAML.load_file(@i18nyaml)
|
|
224
186
|
elsif lang == "en"
|
data/lib/asciidoctor/itu/itu.rng
CHANGED
|
@@ -49,6 +49,24 @@
|
|
|
49
49
|
</choice>
|
|
50
50
|
</element>
|
|
51
51
|
</define>
|
|
52
|
+
<define name="ol">
|
|
53
|
+
<element name="ol">
|
|
54
|
+
<attribute name="id">
|
|
55
|
+
<data type="ID"/>
|
|
56
|
+
</attribute>
|
|
57
|
+
<optional>
|
|
58
|
+
<attribute name="class">
|
|
59
|
+
<value>steps</value>
|
|
60
|
+
</attribute>
|
|
61
|
+
</optional>
|
|
62
|
+
<oneOrMore>
|
|
63
|
+
<ref name="li"/>
|
|
64
|
+
</oneOrMore>
|
|
65
|
+
<zeroOrMore>
|
|
66
|
+
<ref name="note"/>
|
|
67
|
+
</zeroOrMore>
|
|
68
|
+
</element>
|
|
69
|
+
</define>
|
|
52
70
|
<define name="DocumentType">
|
|
53
71
|
<choice>
|
|
54
72
|
<value>recommendation</value>
|
|
@@ -129,7 +147,37 @@
|
|
|
129
147
|
</oneOrMore>
|
|
130
148
|
</element>
|
|
131
149
|
</define>
|
|
150
|
+
<define name="TextElement" combine="choice">
|
|
151
|
+
<choice>
|
|
152
|
+
<ref name="add"/>
|
|
153
|
+
<ref name="del"/>
|
|
154
|
+
</choice>
|
|
155
|
+
</define>
|
|
132
156
|
</include>
|
|
157
|
+
<define name="add">
|
|
158
|
+
<element name="add">
|
|
159
|
+
<choice>
|
|
160
|
+
<ref name="PureTextElement"/>
|
|
161
|
+
<ref name="eref"/>
|
|
162
|
+
<ref name="stem"/>
|
|
163
|
+
<ref name="keyword"/>
|
|
164
|
+
<ref name="xref"/>
|
|
165
|
+
<ref name="hyperlink"/>
|
|
166
|
+
</choice>
|
|
167
|
+
</element>
|
|
168
|
+
</define>
|
|
169
|
+
<define name="del">
|
|
170
|
+
<element name="del">
|
|
171
|
+
<choice>
|
|
172
|
+
<ref name="PureTextElement"/>
|
|
173
|
+
<ref name="eref"/>
|
|
174
|
+
<ref name="stem"/>
|
|
175
|
+
<ref name="keyword"/>
|
|
176
|
+
<ref name="xref"/>
|
|
177
|
+
<ref name="hyperlink"/>
|
|
178
|
+
</choice>
|
|
179
|
+
</element>
|
|
180
|
+
</define>
|
|
133
181
|
<define name="ipnoticereceived">
|
|
134
182
|
<element name="ip-notice-received">
|
|
135
183
|
<data type="boolean"/>
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
module Asciidoctor
|
|
2
|
+
module ITU
|
|
3
|
+
class AddMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
|
4
|
+
use_dsl
|
|
5
|
+
named :add
|
|
6
|
+
parse_content_as :text
|
|
7
|
+
using_format :short
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
def process(parent, _target, attrs)
|
|
10
|
+
out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
|
|
11
|
+
%{<add>#{out}</add>}
|
|
12
|
+
end
|
|
13
|
+
end
|
|
7
14
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
class DelMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
|
16
|
+
use_dsl
|
|
17
|
+
named :del
|
|
18
|
+
parse_content_as :text
|
|
19
|
+
using_format :short
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
def process(parent, _target, attrs)
|
|
22
|
+
out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
|
|
23
|
+
%{<del>#{out}</del>}
|
|
24
|
+
end
|
|
25
|
+
end
|
|
18
26
|
end
|
|
19
27
|
end
|
|
@@ -26,6 +26,7 @@ module Asciidoctor
|
|
|
26
26
|
approval_validate(doc)
|
|
27
27
|
itu_identifier_validate(doc)
|
|
28
28
|
bibdata_validate(doc.root)
|
|
29
|
+
termdef_style(doc.root)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
def approval_validate(xmldoc)
|
|
@@ -46,6 +47,19 @@ module Asciidoctor
|
|
|
46
47
|
end
|
|
47
48
|
end
|
|
48
49
|
|
|
50
|
+
def termdef_style(xmldoc)
|
|
51
|
+
xmldoc.xpath("//term").each do |t|
|
|
52
|
+
para = t.at("./definition") || return
|
|
53
|
+
term = t.at("./preferred").text
|
|
54
|
+
termdef_warn(term, /^[A-Z][a-z]+/, term, "term is not lowercase")
|
|
55
|
+
termdef_warn(para.text, /^[a-z]/, term, "term definition does not start with capital")
|
|
56
|
+
termdef_warn(para.text, /[^.]$/, term, "term definition does not end with period")
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def termdef_warn(text, re, term, msg)
|
|
61
|
+
re.match(text) && warn("ITU style: #{term}: #{msg}")
|
|
62
|
+
end
|
|
49
63
|
end
|
|
50
64
|
end
|
|
51
65
|
end
|
|
@@ -3,6 +3,7 @@ require_relative "metadata"
|
|
|
3
3
|
require "fileutils"
|
|
4
4
|
require_relative "./ref.rb"
|
|
5
5
|
require_relative "./xref.rb"
|
|
6
|
+
require_relative "./terms.rb"
|
|
6
7
|
|
|
7
8
|
module IsoDoc
|
|
8
9
|
module ITU
|
|
@@ -40,21 +41,32 @@ module IsoDoc
|
|
|
40
41
|
""
|
|
41
42
|
end
|
|
42
43
|
|
|
43
|
-
def
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
def note_label(node)
|
|
45
|
+
n = get_anchors[node["id"]]
|
|
46
|
+
return "#{@note_lbl} – " if n.nil? || n[:label].nil? || n[:label].empty?
|
|
47
|
+
l10n("#{@note_lbl} #{n[:label]} – ")
|
|
46
48
|
end
|
|
47
49
|
|
|
48
|
-
def
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
def formula_where(dl, out)
|
|
51
|
+
return unless dl
|
|
52
|
+
out.p { |p| p << l10n("#{@where_lbl}:") }
|
|
53
|
+
parse(dl, out)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def prefix_container(container, linkend, _target)
|
|
57
|
+
l10n("#{linkend} #{@labels["in"]} #{anchor(container, :xref)}")
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def ol_depth(node)
|
|
61
|
+
return super unless node["class"] == "steps" or
|
|
62
|
+
node.at(".//ancestor::xmlns:ol[@class = 'steps']")
|
|
63
|
+
depth = node.ancestors("ul, ol").size + 1
|
|
64
|
+
type = :arabic
|
|
65
|
+
type = :alphabet if [2, 7].include? depth
|
|
66
|
+
type = :roman if [3, 8].include? depth
|
|
67
|
+
type = :alphabet_upper if [4, 9].include? depth
|
|
68
|
+
type = :roman_upper if [5, 10].include? depth
|
|
69
|
+
ol_style(type)
|
|
58
70
|
end
|
|
59
71
|
|
|
60
72
|
def annex_name(annex, name, div)
|
|
@@ -112,70 +124,6 @@ module IsoDoc
|
|
|
112
124
|
super
|
|
113
125
|
end
|
|
114
126
|
|
|
115
|
-
def terms_defs_title(node)
|
|
116
|
-
t = node.at(ns("./title")) and return t.text
|
|
117
|
-
super
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
def terms_defs(node, out, num)
|
|
121
|
-
f = node.at(ns(IsoDoc::Convert::TERM_CLAUSE)) or return num
|
|
122
|
-
out.div **attr_code(id: f["id"]) do |div|
|
|
123
|
-
num = num + 1
|
|
124
|
-
clause_name(num, terms_defs_title(f), div, nil)
|
|
125
|
-
if f.at(ns("./clause | ./terms | ./term")).nil? then out.p "None."
|
|
126
|
-
else
|
|
127
|
-
f.children.reject { |c1| c1.name == "title" }.each do |c1|
|
|
128
|
-
parse(c1, div)
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
num
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def terms_parse(node, out)
|
|
136
|
-
out.div **attr_code(id: node["id"]) do |div|
|
|
137
|
-
clause_parse_title(node, div, node.at(ns("./title")), out)
|
|
138
|
-
title = node.at(ns("./title"))&.text&.downcase
|
|
139
|
-
title == "terms defined elsewhere" and
|
|
140
|
-
out.p @labels["elsewhere_terms"]
|
|
141
|
-
title == "terms defined in this recommendation" and
|
|
142
|
-
out.p @labels["here_terms"]
|
|
143
|
-
if node.at(ns("./clause | ./term")).nil? then out.p "None."
|
|
144
|
-
else
|
|
145
|
-
node.children.reject { |c1| c1.name == "title" }.each do |c1|
|
|
146
|
-
parse(c1, div)
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
def termdef_parse1(node, div, term, defn, source)
|
|
153
|
-
div.p **{ class: "TermNum", id: node["id"] } do |p|
|
|
154
|
-
p.b do |b|
|
|
155
|
-
b << anchor(node["id"], :label)
|
|
156
|
-
insert_tab(b, 1)
|
|
157
|
-
term.children.each { |n| parse(n, b) }
|
|
158
|
-
end
|
|
159
|
-
source and p << " [#{source.value}]"
|
|
160
|
-
p << ": "
|
|
161
|
-
end
|
|
162
|
-
defn and defn.children.each { |n| parse(n, div) }
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
def termdef_parse(node, out)
|
|
166
|
-
term = node.at(ns("./preferred"))
|
|
167
|
-
defn = node.at(ns("./definition"))
|
|
168
|
-
source = node.at(ns("./termsource/origin/@citeas"))
|
|
169
|
-
out.div **attr_code(id: node["id"]) do |div|
|
|
170
|
-
termdef_parse1(node, div, term, defn, source)
|
|
171
|
-
set_termdomain("")
|
|
172
|
-
node.children.each do |n|
|
|
173
|
-
next if %w(preferred definition termsource title).include? n.name
|
|
174
|
-
parse(n, out)
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
|
|
179
127
|
def get_eref_linkend(node)
|
|
180
128
|
link = "[#{anchor_linkend(node, docid_l10n(node["target"] || node["citeas"]))}]"
|
|
181
129
|
link += eref_localities(node.xpath(ns("./locality")), link)
|
|
@@ -211,6 +159,46 @@ module IsoDoc
|
|
|
211
159
|
insert_tab(s, 1)
|
|
212
160
|
end
|
|
213
161
|
end
|
|
162
|
+
|
|
163
|
+
def add_parse(node, out)
|
|
164
|
+
out.span **{class: "addition"} do |e|
|
|
165
|
+
node.children.each { |n| parse(n, e) }
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def del_parse(node, out)
|
|
170
|
+
out.span **{class: "deletion"} do |e|
|
|
171
|
+
node.children.each { |n| parse(n, e) }
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def error_parse(node, out)
|
|
176
|
+
case node.name
|
|
177
|
+
when "add" then add_parse(node, out)
|
|
178
|
+
when "del" then del_parse(node, out)
|
|
179
|
+
else
|
|
180
|
+
super
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def note_p_parse(node, div)
|
|
185
|
+
div.p do |p|
|
|
186
|
+
p.span **{ class: "note_label" } do |s|
|
|
187
|
+
s << note_label(node)
|
|
188
|
+
end
|
|
189
|
+
node.first_element_child.children.each { |n| parse(n, p) }
|
|
190
|
+
end
|
|
191
|
+
node.element_children[1..-1].each { |n| parse(n, div) }
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def note_parse1(node, div)
|
|
195
|
+
div.p do |p|
|
|
196
|
+
p.span **{ class: "note_label" } do |s|
|
|
197
|
+
s << note_label(node)
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
node.children.each { |n| parse(n, div) }
|
|
201
|
+
end
|
|
214
202
|
end
|
|
215
203
|
end
|
|
216
204
|
end
|
|
@@ -680,8 +680,10 @@ p.Biblio, p.NormRef {
|
|
|
680
680
|
margin-left:-1.5em;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
.example .Sourcecode {
|
|
683
|
+
.example .Sourcecode, .example .pseudocode {
|
|
684
684
|
background: none;
|
|
685
|
+
margin: 0;
|
|
686
|
+
padding: 0 0 0 2em;
|
|
685
687
|
}
|
|
686
688
|
|
|
687
689
|
.pseudocode {
|
|
@@ -841,6 +843,15 @@ h2 p {
|
|
|
841
843
|
display: inline;
|
|
842
844
|
}
|
|
843
845
|
|
|
846
|
+
.addition {
|
|
847
|
+
color: blue;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.deletion {
|
|
851
|
+
color: red;
|
|
852
|
+
text-decoration: line-through;
|
|
853
|
+
}
|
|
854
|
+
|
|
844
855
|
|
|
845
856
|
/*
|
|
846
857
|
4.0 Page header
|
|
@@ -14,6 +14,22 @@ p.Sourcecode, li.Sourcecode, div.Sourcecode, pre.Sourcecode, pre
|
|
|
14
14
|
mso-fareast-font-family:Calibri;
|
|
15
15
|
mso-bidi-font-family:"Courier New";
|
|
16
16
|
mso-ansi-language:EN-GB;}
|
|
17
|
+
p.pseudocode, li.pseudocode, div.pseudocode
|
|
18
|
+
{mso-style-unhide:no;
|
|
19
|
+
mso-style-qformat:yes;
|
|
20
|
+
mso-style-parent:"";
|
|
21
|
+
margin-top:6.0pt;
|
|
22
|
+
margin-right:0cm;
|
|
23
|
+
margin-bottom:6.0pt;
|
|
24
|
+
margin-left:0cm;
|
|
25
|
+
text-align:left;
|
|
26
|
+
mso-pagination:widow-orphan;
|
|
27
|
+
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
|
|
28
|
+
font-size:10.0pt;
|
|
29
|
+
font-family:$bodyfont;
|
|
30
|
+
mso-fareast-font-family:Calibri;
|
|
31
|
+
mso-bidi-font-family:"Courier New";
|
|
32
|
+
mso-ansi-language:EN-GB;}
|
|
17
33
|
p.annex_obligation, li.annex_obligation, div.annex_obligation
|
|
18
34
|
{mso-style-unhide:no;
|
|
19
35
|
mso-style-qformat:yes;
|
|
@@ -171,8 +187,6 @@ p.TableFootnote, div.TableFootnote, li.TableFootnote
|
|
|
171
187
|
margin-left:14.2pt;
|
|
172
188
|
text-indent:-14.2pt;
|
|
173
189
|
margin-bottom:.0001pt;
|
|
174
|
-
text-align:justify;
|
|
175
|
-
text-justify:inter-ideograph;
|
|
176
190
|
mso-pagination:widow-orphan;
|
|
177
191
|
tab-stops:39.7pt 59.55pt 79.4pt 99.25pt;
|
|
178
192
|
mso-layout-grid-align:none;
|
|
@@ -748,6 +762,13 @@ p.RecNo, li.RecNo, div.RecNo
|
|
|
748
762
|
mso-fareast-language:EN-US;
|
|
749
763
|
font-weight:bold;
|
|
750
764
|
mso-bidi-font-weight:normal;}
|
|
765
|
+
span.addition {
|
|
766
|
+
color: blue;
|
|
767
|
+
}
|
|
768
|
+
span.deletion {
|
|
769
|
+
color: red;
|
|
770
|
+
text-decoration: line-through;
|
|
771
|
+
}
|
|
751
772
|
|
|
752
773
|
@page {
|
|
753
774
|
mso-page-border-surround-header:no;
|
|
@@ -836,7 +857,7 @@ table.MsoISOTable td
|
|
|
836
857
|
mso-border-alt:solid windowtext 1pt;
|
|
837
858
|
padding:0cm 2.85pt 0cm 2.85pt;}
|
|
838
859
|
table.MsoISOTable p
|
|
839
|
-
{font-size:11.0pt;}
|
|
860
|
+
{font-size:11.0pt; }
|
|
840
861
|
table.MsoTableGrid
|
|
841
862
|
{mso-style-name:"Table Grid";
|
|
842
863
|
mso-tstyle-rowband-size:0;
|
|
@@ -929,9 +950,13 @@ div.example p.MsoListParagraph {
|
|
|
929
950
|
font-size: 10.0pt;
|
|
930
951
|
}
|
|
931
952
|
|
|
953
|
+
div.Note p.MsoListParagraph {
|
|
954
|
+
font-size: 11.0pt;
|
|
955
|
+
}
|
|
956
|
+
|
|
932
957
|
span.note_label, span.example_label, td.example_label, td.note_label
|
|
933
958
|
{
|
|
934
|
-
font-size:
|
|
959
|
+
font-size: 11.0pt;
|
|
935
960
|
font-family:$bodyfont;
|
|
936
961
|
}
|
|
937
962
|
|
|
@@ -18,24 +18,64 @@
|
|
|
18
18
|
<p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=FR-CH
|
|
19
19
|
style='mso-ansi-language:FR-CH'><o:p> </o:p></span></span></p>
|
|
20
20
|
|
|
21
|
-
<p class=MsoNormal><
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
style='
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
<p class=MsoNormal><o:wrapblock><v:shapetype id="_x0000_t202"
|
|
22
|
+
coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
|
|
23
|
+
<v:stroke joinstyle="miter"/>
|
|
24
|
+
<v:path gradientshapeok="t" o:connecttype="rect"/>
|
|
25
|
+
</v:shapetype><v:shape id="Text_x0020_Box_x0020_1" o:spid="_x0000_s1026"
|
|
26
|
+
type="#_x0000_t202" style='position:absolute;margin-left:-8pt;margin-top:141.75pt;
|
|
27
|
+
width:448.15pt;height:69.8pt;z-index:-251657216;visibility:visible;
|
|
28
|
+
mso-wrap-style:square;mso-width-percent:0;mso-height-percent:0;
|
|
29
|
+
mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
|
|
30
|
+
mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;
|
|
31
|
+
mso-position-horizontal-relative:text;mso-position-vertical:absolute;
|
|
32
|
+
mso-position-vertical-relative:top-margin-area;mso-width-percent:0;
|
|
33
|
+
mso-height-percent:0;mso-width-relative:margin;mso-height-relative:margin;
|
|
34
|
+
v-text-anchor:top' o:gfxdata="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
|
|
64
|
+
" o:allowoverlap="f" filled="f" stroked="f" strokeweight=".5pt">
|
|
65
|
+
<v:fill o:detectmouseclick="t"/>
|
|
66
|
+
<v:textbox style='mso-fit-shape-to-text:t'>
|
|
67
|
+
<div id="abstractbox">
|
|
68
|
+
</div>
|
|
69
|
+
</v:textbox>
|
|
70
|
+
<w:wrap type="topAndBottom" anchory="margin"/>
|
|
71
|
+
<w:anchorlock/>
|
|
72
|
+
</v:shape></o:wrapblock><br
|
|
73
|
+
style='mso-ignore:vglayout' clear=ALL>
|
|
74
|
+
<span lang=EN-US style='mso-ansi-language:EN-US'><o:p></o:p></span></p>
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
39
79
|
|
|
40
80
|
<p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
|
|
41
81
|
style='mso-ansi-language:EN-US'><o:p> </o:p></span></span></p>
|
|
@@ -296,18 +296,18 @@ a:link, span.MsoHyperlink
|
|
|
296
296
|
{mso-style-unhide:no;
|
|
297
297
|
mso-style-parent:"";
|
|
298
298
|
color:blue;
|
|
299
|
-
|
|
300
|
-
font-size:8pt;
|
|
301
|
-
text-decoration:underline;
|
|
302
|
-
text-underline:single;}
|
|
299
|
+
}
|
|
303
300
|
a:visited, span.MsoHyperlinkFollowed
|
|
304
301
|
{mso-style-unhide:no;
|
|
305
302
|
mso-style-parent:"";
|
|
303
|
+
color:purple;}
|
|
304
|
+
a.url {
|
|
306
305
|
font-family:"Arial",sans-serif;
|
|
307
306
|
font-size:8pt;
|
|
308
|
-
color:purple;
|
|
309
307
|
text-decoration:underline;
|
|
310
|
-
text-underline:single;
|
|
308
|
+
text-underline:single;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
311
|
p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject
|
|
312
312
|
{mso-style-noshow:yes;
|
|
313
313
|
mso-style-unhide:no;
|
|
@@ -466,7 +466,6 @@ p.h1Preface
|
|
|
466
466
|
text-indent:-39.7pt;
|
|
467
467
|
mso-pagination:widow-orphan lines-together;
|
|
468
468
|
page-break-after:avoid;
|
|
469
|
-
mso-outline-level:1;
|
|
470
469
|
tab-stops:39.7pt 59.55pt 79.4pt 99.25pt;
|
|
471
470
|
mso-layout-grid-align:none;
|
|
472
471
|
punctuation-wrap:simple;
|
|
@@ -853,7 +852,6 @@ p.MsoToc1, li.MsoToc1, div.MsoToc1
|
|
|
853
852
|
mso-fareast-font-family:$bodyfont;
|
|
854
853
|
mso-bidi-font-family:$bodyfont;
|
|
855
854
|
mso-ansi-language:EN-GB;
|
|
856
|
-
font-weight:bold;
|
|
857
855
|
mso-bidi-font-weight:normal;}
|
|
858
856
|
p.MsoToc2, li.MsoToc2, div.MsoToc2
|
|
859
857
|
{mso-style-noshow:yes;
|
|
@@ -1042,8 +1040,7 @@ span.MsoFootnoteReference
|
|
|
1042
1040
|
position:relative;
|
|
1043
1041
|
top:-3.0pt;
|
|
1044
1042
|
mso-text-raise:3.0pt;
|
|
1045
|
-
mso-style-priority:99;
|
|
1046
|
-
vertical-align:super;}
|
|
1043
|
+
mso-style-priority:99;}
|
|
1047
1044
|
p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
|
|
1048
1045
|
{mso-style-noshow:yes;
|
|
1049
1046
|
mso-style-priority:99;
|
|
@@ -1523,6 +1520,72 @@ p.Tablebody, li.Tablebody, div.Tablebody
|
|
|
1523
1520
|
mso-level-number-position:left;
|
|
1524
1521
|
margin-left:178.65pt;
|
|
1525
1522
|
text-indent:-19.85pt;}
|
|
1523
|
+
/* steps ordered list */
|
|
1524
|
+
@list l4
|
|
1525
|
+
{mso-list-id:525294608;
|
|
1526
|
+
mso-list-template-ids:676331812}
|
|
1527
|
+
@list l4:level1
|
|
1528
|
+
{mso-level-text:"%1\)";
|
|
1529
|
+
mso-level-tab-stop:none;
|
|
1530
|
+
mso-level-number-position:left;
|
|
1531
|
+
margin-left:18.0pt;
|
|
1532
|
+
text-indent:-18.0pt;}
|
|
1533
|
+
@list l4:level2
|
|
1534
|
+
{mso-level-text:"%2\)";
|
|
1535
|
+
mso-level-number-format:alpha-lower;
|
|
1536
|
+
mso-level-tab-stop:none;
|
|
1537
|
+
mso-level-number-position:left;
|
|
1538
|
+
margin-left:36.0pt;
|
|
1539
|
+
text-indent:-18.0pt;}
|
|
1540
|
+
@list l4:level3
|
|
1541
|
+
{mso-level-number-format:roman-lower;
|
|
1542
|
+
mso-level-text:"%3\)";
|
|
1543
|
+
mso-level-tab-stop:none;
|
|
1544
|
+
mso-level-number-position:left;
|
|
1545
|
+
margin-left:54.0pt;
|
|
1546
|
+
text-indent:-18.0pt;}
|
|
1547
|
+
@list l4:level4
|
|
1548
|
+
{mso-level-number-format:alpha-upper;
|
|
1549
|
+
mso-level-text:"%4\)";
|
|
1550
|
+
mso-level-tab-stop:none;
|
|
1551
|
+
mso-level-number-position:left;
|
|
1552
|
+
margin-left:72.0pt;
|
|
1553
|
+
text-indent:-18.0pt;}
|
|
1554
|
+
@list l4:level5
|
|
1555
|
+
{mso-level-number-format:roman-upper;
|
|
1556
|
+
mso-level-text:"%5\)";
|
|
1557
|
+
mso-level-tab-stop:none;
|
|
1558
|
+
mso-level-number-position:left;
|
|
1559
|
+
margin-left:90.0pt;
|
|
1560
|
+
text-indent:-18.0pt;}
|
|
1561
|
+
@list l4:level6
|
|
1562
|
+
{mso-level-text:"%6\)";
|
|
1563
|
+
mso-level-tab-stop:none;
|
|
1564
|
+
mso-level-number-position:left;
|
|
1565
|
+
margin-left:108.0pt;
|
|
1566
|
+
text-indent:-18.0pt;}
|
|
1567
|
+
@list l4:level7
|
|
1568
|
+
{mso-level-tab-stop:none;
|
|
1569
|
+
mso-level-number-format:alpha-lower;
|
|
1570
|
+
mso-level-text:"%7\)";
|
|
1571
|
+
mso-level-number-position:left;
|
|
1572
|
+
margin-left:126.0pt;
|
|
1573
|
+
text-indent:-18.0pt;}
|
|
1574
|
+
@list l4:level8
|
|
1575
|
+
{mso-level-number-format:roman-lower;
|
|
1576
|
+
mso-level-text:"%8\)";
|
|
1577
|
+
mso-level-tab-stop:none;
|
|
1578
|
+
mso-level-number-position:left;
|
|
1579
|
+
margin-left:144.0pt;
|
|
1580
|
+
text-indent:-18.0pt;}
|
|
1581
|
+
@list l4:level9
|
|
1582
|
+
{mso-level-number-format:alpha-upper;
|
|
1583
|
+
mso-level-text:"%9\)";
|
|
1584
|
+
mso-level-tab-stop:none;
|
|
1585
|
+
mso-level-number-position:left;
|
|
1586
|
+
margin-left:162.0pt;
|
|
1587
|
+
text-indent:-18.0pt;}
|
|
1588
|
+
|
|
1526
1589
|
|
|
1527
1590
|
p.ListContLevel1, li.ListContLevel1, div.ListContLevel1
|
|
1528
1591
|
{mso-style-priority:34;
|
data/lib/isodoc/itu/i18n-en.yaml
CHANGED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
module IsoDoc
|
|
2
|
+
module ITU
|
|
3
|
+
module BaseConvert
|
|
4
|
+
def terms_defs_title(node)
|
|
5
|
+
t = node.at(ns("./title")) and return t.text
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def terms_defs(node, out, num)
|
|
10
|
+
f = node.at(ns(IsoDoc::Convert::TERM_CLAUSE)) or return num
|
|
11
|
+
out.div **attr_code(id: f["id"]) do |div|
|
|
12
|
+
num = num + 1
|
|
13
|
+
clause_name(num, terms_defs_title(f), div, nil)
|
|
14
|
+
if f.at(ns("./clause | ./terms | ./term")).nil? then out.p "None."
|
|
15
|
+
else
|
|
16
|
+
f.children.reject { |c1| c1.name == "title" }.each do |c1|
|
|
17
|
+
parse(c1, div)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
num
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def terms_parse(node, out)
|
|
25
|
+
out.div **attr_code(id: node["id"]) do |div|
|
|
26
|
+
clause_parse_title(node, div, node.at(ns("./title")), out)
|
|
27
|
+
if node.at(ns("./clause | ./term")).nil? then out.p "None."
|
|
28
|
+
else
|
|
29
|
+
node.children.reject { |c1| c1.name == "title" }.each do |c1|
|
|
30
|
+
parse(c1, div)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def termdef_parse1(node, div, term, defn, source)
|
|
37
|
+
div.p **{ class: "TermNum", id: node["id"] } do |p|
|
|
38
|
+
p.b do |b|
|
|
39
|
+
b << anchor(node["id"], :label)
|
|
40
|
+
insert_tab(b, 1)
|
|
41
|
+
term.children.each { |n| parse(n, b) }
|
|
42
|
+
end
|
|
43
|
+
source and p << " [#{source.value}]"
|
|
44
|
+
p << ": "
|
|
45
|
+
end
|
|
46
|
+
defn and defn.children.each { |n| parse(n, div) }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def termdef_parse(node, out)
|
|
50
|
+
term = node.at(ns("./preferred"))
|
|
51
|
+
defn = node.at(ns("./definition"))
|
|
52
|
+
source = node.at(ns("./termsource/origin/@citeas"))
|
|
53
|
+
out.div **attr_code(id: node["id"]) do |div|
|
|
54
|
+
termdef_parse1(node, div, term, defn, source)
|
|
55
|
+
set_termdomain("")
|
|
56
|
+
node.children.each do |n|
|
|
57
|
+
next if %w(preferred definition termsource title).include? n.name
|
|
58
|
+
parse(n, out)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def termnote_parse(node, out)
|
|
64
|
+
out.div **{ class: "Note" } do |div|
|
|
65
|
+
first = node.first_element_child
|
|
66
|
+
div.p do |p|
|
|
67
|
+
p << note_label(node) # "#{anchor(node['id'], :label) || '???'}: "
|
|
68
|
+
para_then_remainder(first, node, p, div)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def termnote_anchor_names(docxml)
|
|
74
|
+
docxml.xpath(ns("//term[descendant::termnote]")).each do |t|
|
|
75
|
+
c = IsoDoc::Function::XrefGen::Counter.new
|
|
76
|
+
notes = t.xpath(ns(".//termnote"))
|
|
77
|
+
notes.each do |n|
|
|
78
|
+
return if n["id"].nil? || n["id"].empty?
|
|
79
|
+
idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
|
|
80
|
+
@anchors[n["id"]] = anchor_struct(idx, n, @note_xref_lbl,
|
|
81
|
+
"termnote", false)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -151,16 +151,51 @@ module IsoDoc
|
|
|
151
151
|
olstyle: "l2", }
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
-
def
|
|
155
|
-
super
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
def make_tr_attr(td, row, totalrows, header)
|
|
155
|
+
super.merge(valign: "top")
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def ol_parse(node, out)
|
|
159
|
+
out.ol **attr_code(class: node["class"], id: node["id"] ) do |ol|
|
|
160
|
+
node.children.each { |n| parse(n, ol) }
|
|
158
161
|
end
|
|
159
162
|
end
|
|
160
163
|
|
|
161
|
-
def
|
|
162
|
-
|
|
164
|
+
def toWord(result, filename, dir, header)
|
|
165
|
+
result = populate_template(result, :word)
|
|
166
|
+
result = from_xhtml(word_cleanup(to_xhtml(result)))
|
|
167
|
+
Html2Doc.process(result, filename: filename, stylesheet: @wordstylesheet,
|
|
168
|
+
header_file: header, dir: dir,
|
|
169
|
+
asciimathdelims: [@openmathdelim, @closemathdelim],
|
|
170
|
+
liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" })
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
=begin
|
|
174
|
+
def eref_parse(node, out)
|
|
175
|
+
linkend = get_linkend(node)
|
|
176
|
+
if node["type"] == "footnote"
|
|
177
|
+
out.sup { |s| s << linkend }
|
|
178
|
+
else
|
|
179
|
+
out << linkend
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def xref_parse(node, out)
|
|
184
|
+
#target = /#/.match(node["target"]) ? node["target"].sub(/#/, ".html#") :
|
|
185
|
+
# "##{node["target"]}"
|
|
186
|
+
out << get_linkend(node)
|
|
163
187
|
end
|
|
188
|
+
=end
|
|
189
|
+
|
|
190
|
+
def link_parse(node, out)
|
|
191
|
+
out.a **attr_code(href: node["target"], title: node["alt"], class: "url") do |l|
|
|
192
|
+
if node.text.empty?
|
|
193
|
+
l << node["target"].sub(/^mailto:/, "")
|
|
194
|
+
else
|
|
195
|
+
node.children.each { |n| parse(n, l) }
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
164
199
|
|
|
165
200
|
include BaseConvert
|
|
166
201
|
end
|
data/metanorma-itu.gemspec
CHANGED
|
@@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.require_paths = ["lib"]
|
|
25
25
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
|
26
26
|
|
|
27
|
-
spec.add_dependency "asciidoctor", "~> 1.5.7"
|
|
28
27
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
|
29
28
|
spec.add_dependency "ruby-jing"
|
|
30
29
|
spec.add_dependency "metanorma-standoc", "~> 1.3.0"
|
|
@@ -41,4 +40,6 @@ Gem::Specification.new do |spec|
|
|
|
41
40
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
|
42
41
|
spec.add_development_dependency "timecop", "~> 0.9"
|
|
43
42
|
spec.add_development_dependency "metanorma", "~> 0.3.0"
|
|
43
|
+
spec.add_development_dependency "vcr", "~> 5.0.0"
|
|
44
|
+
spec.add_development_dependency "webmock"
|
|
44
45
|
end
|
metadata
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-itu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-11-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: asciidoctor
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 1.5.7
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: 1.5.7
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: htmlentities
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -234,6 +220,34 @@ dependencies:
|
|
|
234
220
|
- - "~>"
|
|
235
221
|
- !ruby/object:Gem::Version
|
|
236
222
|
version: 0.3.0
|
|
223
|
+
- !ruby/object:Gem::Dependency
|
|
224
|
+
name: vcr
|
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
|
226
|
+
requirements:
|
|
227
|
+
- - "~>"
|
|
228
|
+
- !ruby/object:Gem::Version
|
|
229
|
+
version: 5.0.0
|
|
230
|
+
type: :development
|
|
231
|
+
prerelease: false
|
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
233
|
+
requirements:
|
|
234
|
+
- - "~>"
|
|
235
|
+
- !ruby/object:Gem::Version
|
|
236
|
+
version: 5.0.0
|
|
237
|
+
- !ruby/object:Gem::Dependency
|
|
238
|
+
name: webmock
|
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
|
240
|
+
requirements:
|
|
241
|
+
- - ">="
|
|
242
|
+
- !ruby/object:Gem::Version
|
|
243
|
+
version: '0'
|
|
244
|
+
type: :development
|
|
245
|
+
prerelease: false
|
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
247
|
+
requirements:
|
|
248
|
+
- - ">="
|
|
249
|
+
- !ruby/object:Gem::Version
|
|
250
|
+
version: '0'
|
|
237
251
|
description: 'Metanorma for the ITU.
|
|
238
252
|
|
|
239
253
|
'
|
|
@@ -260,6 +274,7 @@ files:
|
|
|
260
274
|
- lib/asciidoctor/itu.rb
|
|
261
275
|
- lib/asciidoctor/itu/basicdoc.rng
|
|
262
276
|
- lib/asciidoctor/itu/biblio.rng
|
|
277
|
+
- lib/asciidoctor/itu/cleanup.rb
|
|
263
278
|
- lib/asciidoctor/itu/converter.rb
|
|
264
279
|
- lib/asciidoctor/itu/front.rb
|
|
265
280
|
- lib/asciidoctor/itu/i18n-en.yaml
|
|
@@ -289,6 +304,7 @@ files:
|
|
|
289
304
|
- lib/isodoc/itu/metadata.rb
|
|
290
305
|
- lib/isodoc/itu/pdf_convert.rb
|
|
291
306
|
- lib/isodoc/itu/ref.rb
|
|
307
|
+
- lib/isodoc/itu/terms.rb
|
|
292
308
|
- lib/isodoc/itu/word_convert.rb
|
|
293
309
|
- lib/isodoc/itu/xref.rb
|
|
294
310
|
- lib/metanorma-itu.rb
|