isodoc 3.3.4 → 3.4.1
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/isodoc.gemspec +2 -2
- data/lib/isodoc/function/inline.rb +11 -7
- data/lib/isodoc/html_function/postprocess_cover.rb +9 -8
- data/lib/isodoc/init.rb +14 -0
- data/lib/isodoc/presentation_function/autonum.rb +6 -1
- data/lib/isodoc/presentation_function/block.rb +5 -2
- data/lib/isodoc/presentation_function/erefs.rb +3 -2
- data/lib/isodoc/presentation_function/erefs_locality.rb +3 -3
- data/lib/isodoc/presentation_function/ids.rb +3 -6
- data/lib/isodoc/presentation_function/image.rb +4 -0
- data/lib/isodoc/presentation_function/refs.rb +7 -11
- data/lib/isodoc/presentation_function/terms.rb +15 -5
- data/lib/isodoc/presentation_function/xrefs.rb +8 -5
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/lists.rb +9 -7
- data/lib/isodoc/word_function/table.rb +19 -8
- data/lib/isodoc-yaml/i18n-ar.yaml +23 -0
- data/lib/isodoc-yaml/i18n-de.yaml +23 -0
- data/lib/isodoc-yaml/i18n-en.yaml +22 -0
- data/lib/isodoc-yaml/i18n-es.yaml +23 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +23 -0
- data/lib/isodoc-yaml/i18n-ja.yaml +3 -1
- data/lib/isodoc-yaml/i18n-ru.yaml +23 -0
- data/lib/relaton/render-isodoc/config.yml +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18d33859f89e36a66412218c04370f02c727fe131dd91b73fd3671ab25cf228f
|
|
4
|
+
data.tar.gz: cc2996c38878a5acacf24932cf2719a1bef922cea11cf5c26411172e9a93032a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dde602b7132920dff5599dc3da2bb0de9ef027f5b3dd703fadc190adec9fab8e26901798bc208d3b3d279b57c5d19fa7ccbe885c37591da875e79f8dd5c364d4
|
|
7
|
+
data.tar.gz: 8d67a2d2518105cf854c7bb7f21a841de922785b0c77060e6002e6023c8de2b14efb8a9cbea25d140101183349b4b346287332eeb230b0c33aa5e0db3dcb3321
|
data/isodoc.gemspec
CHANGED
|
@@ -36,8 +36,7 @@ Gem::Specification.new do |spec|
|
|
|
36
36
|
# spec.add_dependency "metanorma-utils", "~> 1.5.0" # already in isodoc-i18n
|
|
37
37
|
spec.add_dependency "mn2pdf", ">= 2.13"
|
|
38
38
|
spec.add_dependency "mn-requirements", "~> 0.5.0"
|
|
39
|
-
|
|
40
|
-
spec.add_dependency "relaton-render", "~> 0.10.0"
|
|
39
|
+
spec.add_dependency "relaton-render", "~> 1.0.0"
|
|
41
40
|
spec.add_dependency "roman-numerals"
|
|
42
41
|
spec.add_dependency "rouge", "~> 4.0"
|
|
43
42
|
spec.add_dependency "thread_safe"
|
|
@@ -57,5 +56,6 @@ Gem::Specification.new do |spec|
|
|
|
57
56
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
|
58
57
|
spec.add_development_dependency "timecop", "~> 0.9"
|
|
59
58
|
spec.add_development_dependency "canon" , "= 0.1.3"
|
|
59
|
+
spec.add_development_dependency "openssl"
|
|
60
60
|
# spec.metadata["rubygems_mfa_required"] = "true"
|
|
61
61
|
end
|
|
@@ -44,12 +44,16 @@ module IsoDoc
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def xref_parse(node, out)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
if %w(short full).include?(node["style"])
|
|
48
|
+
no_locality_parse(node, out)
|
|
49
|
+
else
|
|
50
|
+
target = if node["target"].include?("#")
|
|
51
|
+
node["target"].sub("#", ".html#")
|
|
52
|
+
else
|
|
53
|
+
"##{node['target']}"
|
|
54
|
+
end
|
|
55
|
+
out.a(href: target) { |l| no_locality_parse(node, l) }
|
|
56
|
+
end
|
|
53
57
|
end
|
|
54
58
|
|
|
55
59
|
def suffix_url(url)
|
|
@@ -109,7 +113,7 @@ module IsoDoc
|
|
|
109
113
|
def asciimath_parse(node)
|
|
110
114
|
a = node.at(ns("./asciimath"))&.text || node.text
|
|
111
115
|
["#{@openmathdelim}#{HTMLEntities.new.encode(a)}" \
|
|
112
|
-
|
|
116
|
+
"#{@closemathdelim}", /^[[0-9,.+-]]*$/.match?(a)]
|
|
113
117
|
end
|
|
114
118
|
|
|
115
119
|
def latexmath_parse(node)
|
|
@@ -10,28 +10,29 @@ module IsoDoc
|
|
|
10
10
|
.gsub(%r{\]\]>\s*</script>}, "</script>")
|
|
11
11
|
.gsub(%r{<!\[CDATA\[\s*<script([^<>]*)>}m, "<script\\1>")
|
|
12
12
|
.gsub(%r{</script>\s*\]\]>}, "</script>")
|
|
13
|
+
.gsub(%r{<style([^<>]*)>\s*<!\[CDATA\[}m, "<style\\1>")
|
|
14
|
+
.gsub(%r{\]\]>\s*</style>}, "</style>")
|
|
15
|
+
.gsub(%r{<!\[CDATA\[\s*<style([^<>]*)>}m, "<style\\1>")
|
|
16
|
+
.gsub(%r{</style>\s*\]\]>}, "</style>")
|
|
13
17
|
end
|
|
14
18
|
|
|
15
19
|
def htmlstylesheet(file)
|
|
16
20
|
file.nil? and return
|
|
17
21
|
file.open if file.is_a?(Tempfile)
|
|
18
22
|
stylesheet = file.read
|
|
19
|
-
xml = Nokogiri::XML("<style/>")
|
|
20
|
-
xml.children.first << Nokogiri::XML::Comment
|
|
21
|
-
.new(xml, "\n#{stylesheet}\n")
|
|
22
23
|
file.close
|
|
23
24
|
file.unlink if file.is_a?(Tempfile)
|
|
24
|
-
|
|
25
|
+
stylesheet
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
def htmlstyle(docxml)
|
|
28
29
|
@htmlstylesheet or return docxml
|
|
29
30
|
head = docxml.at("//*[local-name() = 'head']")
|
|
30
|
-
head << htmlstylesheet(@htmlstylesheet)
|
|
31
|
-
s = htmlstylesheet(@htmlstylesheet_override) and head << s
|
|
31
|
+
head << Nokogiri::HTML.fragment("<style>#{htmlstylesheet(@htmlstylesheet)}</style>")
|
|
32
|
+
s = htmlstylesheet(@htmlstylesheet_override) and head << Nokogiri::HTML.fragment("<style>#{s}</style>")
|
|
32
33
|
s = @meta.get[:code_css] and
|
|
33
|
-
head << "<style
|
|
34
|
-
|
|
34
|
+
head << Nokogiri::HTML.fragment("<style>#{s.gsub(/sourcecode/,
|
|
35
|
+
'pre.sourcecode')}</style>")
|
|
35
36
|
@bare and
|
|
36
37
|
head << "<style>body {margin-left: 2em; margin-right: 2em;}</style>"
|
|
37
38
|
docxml
|
data/lib/isodoc/init.rb
CHANGED
|
@@ -58,6 +58,20 @@ module IsoDoc
|
|
|
58
58
|
@bare = options[:bare]
|
|
59
59
|
@semantic_xml_insert = options[:semanticxmlinsert] != "false"
|
|
60
60
|
@log = options[:log]
|
|
61
|
+
@log&.add_msg(log_messages)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def log_messages
|
|
65
|
+
# rubocop:disable Naming/VariableNumber
|
|
66
|
+
{
|
|
67
|
+
"STANDOC_36": { category: "Anchors",
|
|
68
|
+
error: "ID %s has already been used at line %s",
|
|
69
|
+
severity: 0 },
|
|
70
|
+
"ISODOC_1": { category: "Crossreferences",
|
|
71
|
+
error: "Anchor %s pointed to by %s " \
|
|
72
|
+
"is not defined in the document", severity: 1 },
|
|
73
|
+
}
|
|
74
|
+
# rubocop:enable Naming/VariableNumber
|
|
61
75
|
end
|
|
62
76
|
|
|
63
77
|
def init_i18n(options)
|
|
@@ -118,7 +118,7 @@ module IsoDoc
|
|
|
118
118
|
prefix_container_fmt_xref_label(container_container,
|
|
119
119
|
@xrefs.anchor(container, :xref, false))
|
|
120
120
|
l10n(connectives_spans(@i18n.nested_xref
|
|
121
|
-
.sub("%1", "<span class='fmt-xref-container'
|
|
121
|
+
.sub("%1", "<span class='fmt-xref-container'>#{esc container_label}</span>")
|
|
122
122
|
.sub("%2", xref)))
|
|
123
123
|
end
|
|
124
124
|
|
|
@@ -155,5 +155,10 @@ module IsoDoc
|
|
|
155
155
|
elsif label then label
|
|
156
156
|
end
|
|
157
157
|
end
|
|
158
|
+
|
|
159
|
+
def esc(text)
|
|
160
|
+
text.nil? || text.empty? and return text
|
|
161
|
+
"<esc>#{text}</esc>"
|
|
162
|
+
end
|
|
158
163
|
end
|
|
159
164
|
end
|
|
@@ -192,9 +192,12 @@ module IsoDoc
|
|
|
192
192
|
def source1(elem, ancestor)
|
|
193
193
|
source_elems = source1_gather(elem)
|
|
194
194
|
source_elems.each do |e|
|
|
195
|
+
e.xpath(ns(".//origin")).each do |origin|
|
|
196
|
+
origin.wrap("<esc></esc>")
|
|
197
|
+
end
|
|
195
198
|
elem << "#{source_join_delim(elem)}#{to_xml(e.remove.children).strip}"
|
|
196
199
|
end
|
|
197
|
-
source1_label(elem, to_xml(elem.children).strip, ancestor)
|
|
200
|
+
source1_label(elem, @i18n.l10n(to_xml(elem.children).strip), ancestor)
|
|
198
201
|
end
|
|
199
202
|
|
|
200
203
|
def source1_gather(elem)
|
|
@@ -211,7 +214,7 @@ module IsoDoc
|
|
|
211
214
|
end
|
|
212
215
|
|
|
213
216
|
def source1_label(elem, sources, _ancestor)
|
|
214
|
-
elem.children = l10n("[#{@i18n.source}: #{sources}]")
|
|
217
|
+
elem.children = l10n("[#{@i18n.source}: #{esc sources}]")
|
|
215
218
|
end
|
|
216
219
|
|
|
217
220
|
def source_modification(mod)
|
|
@@ -56,7 +56,7 @@ module IsoDoc
|
|
|
56
56
|
if XREF_CONNECTIVES.include?(x) || [", ", " ", ""].include?(x)
|
|
57
57
|
x
|
|
58
58
|
else
|
|
59
|
-
|
|
59
|
+
esc x
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
end
|
|
@@ -103,7 +103,8 @@ module IsoDoc
|
|
|
103
103
|
sem_xml_descendant?(e) and next
|
|
104
104
|
href = eref_target(e) or next
|
|
105
105
|
e.xpath(ns("./locality | ./localityStack")).each(&:remove)
|
|
106
|
-
if href[:type] == :anchor
|
|
106
|
+
if href[:type] == :anchor || %w(full short).include?(e["style"])
|
|
107
|
+
eref2xref(e)
|
|
107
108
|
else eref2link1(e, href)
|
|
108
109
|
end
|
|
109
110
|
end
|
|
@@ -2,7 +2,7 @@ module IsoDoc
|
|
|
2
2
|
class PresentationXMLConvert < ::IsoDoc::Convert
|
|
3
3
|
def eref_localities(refs, target, node)
|
|
4
4
|
if can_conflate_eref_rendering?(refs)
|
|
5
|
-
l10n(",
|
|
5
|
+
l10n(", #{esc(eref_localities_conflated(refs, target, node))}"
|
|
6
6
|
.gsub(/\s+/, " "), @lang, @script, { prev: target })
|
|
7
7
|
else
|
|
8
8
|
ret = resolve_eref_connectives(eref_locality_stacks(refs, target, node))
|
|
@@ -81,8 +81,8 @@ module IsoDoc
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def eref_localities1_zh(opt)
|
|
84
|
-
ret = "
|
|
85
|
-
ret += "–
|
|
84
|
+
ret = "第#{esc opt[:from]}" if opt[:from]
|
|
85
|
+
ret += "–#{esc opt[:upto]}" if opt[:upto]
|
|
86
86
|
loc = eref_locality_populate(opt[:type], opt[:node], "sg")
|
|
87
87
|
ret += " #{loc}" unless opt[:node]["droploc"] == "true"
|
|
88
88
|
ret
|
|
@@ -30,9 +30,8 @@ module IsoDoc
|
|
|
30
30
|
|
|
31
31
|
def repeat_id_validate1(elem)
|
|
32
32
|
if @doc_ids[elem["id"]]
|
|
33
|
-
@log&.add("
|
|
34
|
-
|
|
35
|
-
"used at line #{@doc_ids[elem['id']]}", severity: 0)
|
|
33
|
+
@log&.add("STANDOC_36", elem,
|
|
34
|
+
params: [elem["id"], @doc_ids[elem["id"]]])
|
|
36
35
|
end
|
|
37
36
|
@doc_ids[elem["id"]] = elem.line
|
|
38
37
|
end
|
|
@@ -71,9 +70,7 @@ module IsoDoc
|
|
|
71
70
|
node[attr].strip.empty? and return
|
|
72
71
|
@doc_ids[node[attr]] and return
|
|
73
72
|
@doc_orig_ids[node[attr]] and return
|
|
74
|
-
@log.add("
|
|
75
|
-
"Anchor #{node[attr]} pointed to by #{node.name} " \
|
|
76
|
-
"is not defined in the document", severity: 1)
|
|
73
|
+
@log.add("ISODOC_1", node, params: [node[attr], node.name])
|
|
77
74
|
end
|
|
78
75
|
|
|
79
76
|
def provide_ids(docxml)
|
|
@@ -25,6 +25,10 @@ module IsoDoc
|
|
|
25
25
|
|
|
26
26
|
def svgmap_extract(elem)
|
|
27
27
|
if elem.at(ns("./figure"))
|
|
28
|
+
if n1 = elem.next_element
|
|
29
|
+
n1.name == "semx" && n1["element"] == "svgmap" and return
|
|
30
|
+
end
|
|
31
|
+
|
|
28
32
|
n = semx_fmt_dup(elem)
|
|
29
33
|
n.xpath(ns("./target")).each(&:remove)
|
|
30
34
|
elem.next = n
|
|
@@ -24,7 +24,7 @@ module IsoDoc
|
|
|
24
24
|
identifiers = render_identifier(ids)
|
|
25
25
|
reference = docid_l10n(identifiers[:metanorma] || identifiers[:sdo] ||
|
|
26
26
|
identifiers[:ordinal] || identifiers[:doi])
|
|
27
|
-
@xrefs.get[ref["id"]] = { xref: reference }
|
|
27
|
+
@xrefs.get[ref["id"]] = { xref: esc(reference) }
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def move_norm_ref_to_sections(docxml)
|
|
@@ -61,8 +61,7 @@ module IsoDoc
|
|
|
61
61
|
prep_for_rendering(b)
|
|
62
62
|
m << to_xml(b)
|
|
63
63
|
end.join
|
|
64
|
-
@bibrender.render_all("<references>#{refs}</references>"
|
|
65
|
-
type: citestyle)
|
|
64
|
+
@bibrender.render_all("<references>#{refs}</references>")
|
|
66
65
|
end
|
|
67
66
|
|
|
68
67
|
def prep_for_rendering(bib)
|
|
@@ -97,10 +96,6 @@ module IsoDoc
|
|
|
97
96
|
end
|
|
98
97
|
end
|
|
99
98
|
|
|
100
|
-
def citestyle
|
|
101
|
-
nil
|
|
102
|
-
end
|
|
103
|
-
|
|
104
99
|
def bibliography_bibitem_number_skip(bibitem)
|
|
105
100
|
implicit_reference(bibitem) ||
|
|
106
101
|
bibitem.at(ns(".//docidentifier[@type = 'metanorma']")) ||
|
|
@@ -174,13 +169,14 @@ module IsoDoc
|
|
|
174
169
|
else norm_ref_entry_code(ordinal, idents, ids, standard, datefn,
|
|
175
170
|
bib)
|
|
176
171
|
end
|
|
177
|
-
bib.add_first_child("<biblio-tag>#{ret}</biblio-tag>")
|
|
172
|
+
bib.add_first_child("<biblio-tag>#{@i18n.l10n(ret)}</biblio-tag>")
|
|
178
173
|
end
|
|
179
174
|
|
|
180
175
|
def norm_ref_entry_code(_ordinal, idents, _ids, _standard, datefn, _bib)
|
|
181
176
|
ret = (idents[:ordinal] || idents[:metanorma] || idents[:sdo]).to_s
|
|
177
|
+
ret = esc(ret)
|
|
182
178
|
(idents[:ordinal] || idents[:metanorma]) && idents[:sdo] and
|
|
183
|
-
ret += ", #{idents[:sdo]}"
|
|
179
|
+
ret += ", #{esc idents[:sdo]}"
|
|
184
180
|
ret += datefn
|
|
185
181
|
ret.empty? and return ret
|
|
186
182
|
idents[:sdo] and ret += ","
|
|
@@ -192,10 +188,10 @@ module IsoDoc
|
|
|
192
188
|
# else, use both ordinal, as prefix, and ids
|
|
193
189
|
def biblio_ref_entry_code(ordinal, ids, _id, _standard, datefn, _bib)
|
|
194
190
|
# standard and id = nil
|
|
195
|
-
ret = ids[:ordinal] || ids[:metanorma] || "[#{ordinal}]"
|
|
191
|
+
ret = esc(ids[:ordinal]) || esc(ids[:metanorma]) || "[#{esc ordinal.to_s}]"
|
|
196
192
|
if ids[:sdo] && !ids[:sdo].empty?
|
|
197
193
|
ret = prefix_bracketed_ref(ret)
|
|
198
|
-
ret += "#{ids[:sdo]}#{datefn}, "
|
|
194
|
+
ret += "#{esc ids[:sdo]}#{datefn}, "
|
|
199
195
|
else
|
|
200
196
|
ret = prefix_bracketed_ref("#{ret}#{datefn}")
|
|
201
197
|
end
|
|
@@ -148,7 +148,8 @@ module IsoDoc
|
|
|
148
148
|
m1.replace("<modification>#{to_xml(new_m1)}</modification>")
|
|
149
149
|
end
|
|
150
150
|
|
|
151
|
-
# concatenate sources. localise the concatenation, escaping the
|
|
151
|
+
# concatenate sources. localise the concatenation, escaping the docids
|
|
152
|
+
# within the concatenands
|
|
152
153
|
# from punctuation localisation: l10n(<esc>A</esc>, <esc>B</esc>)
|
|
153
154
|
# pass the result to termsource_label, where it will be appended after
|
|
154
155
|
# "SOURCE: ", and therefore again needs to be escaped
|
|
@@ -157,9 +158,14 @@ module IsoDoc
|
|
|
157
158
|
while elem.next_element&.name == "source"
|
|
158
159
|
ret << semx_fmt_dup(elem.next_element.remove)
|
|
159
160
|
end
|
|
160
|
-
|
|
161
|
+
ret.each do |element|
|
|
162
|
+
element.xpath(ns(".//origin")).each do |origin|
|
|
163
|
+
origin.wrap("<esc></esc>")
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
s = ret.map { |x| to_xml(x) }.map(&:strip)
|
|
161
167
|
.join(termsource_join_delim(elem))
|
|
162
|
-
termsource_label(elem,
|
|
168
|
+
termsource_label(elem, @i18n.l10n(s))
|
|
163
169
|
end
|
|
164
170
|
|
|
165
171
|
def termsource_join_delim(_elem)
|
|
@@ -167,7 +173,7 @@ module IsoDoc
|
|
|
167
173
|
end
|
|
168
174
|
|
|
169
175
|
def termsource_label(elem, sources)
|
|
170
|
-
elem.replace(l10n("[#{@i18n.source}:
|
|
176
|
+
elem.replace(l10n("[#{@i18n.source}: #{esc sources}]"))
|
|
171
177
|
end
|
|
172
178
|
|
|
173
179
|
def termsource_modification(elem)
|
|
@@ -179,13 +185,17 @@ module IsoDoc
|
|
|
179
185
|
termsource_add_modification_text(mod)
|
|
180
186
|
end
|
|
181
187
|
|
|
188
|
+
def termsource_mod_text_delim(_elem)
|
|
189
|
+
" — "
|
|
190
|
+
end
|
|
191
|
+
|
|
182
192
|
def termsource_add_modification_text(mod)
|
|
183
193
|
mod or return
|
|
184
194
|
if mod.text.strip.empty?
|
|
185
195
|
mod.remove
|
|
186
196
|
return
|
|
187
197
|
end
|
|
188
|
-
mod.previous =
|
|
198
|
+
mod.previous = termsource_mod_text_delim(mod)
|
|
189
199
|
c = mod.at(ns("./semx")) || mod
|
|
190
200
|
c.elements.size == 1 and c.children = to_xml(c.elements[0].children)
|
|
191
201
|
mod.replace(mod.children)
|
|
@@ -21,8 +21,8 @@ module IsoDoc
|
|
|
21
21
|
anchor_xref(node, container, container: true),
|
|
22
22
|
node, target)
|
|
23
23
|
l10n(connectives_spans(@i18n.nested_xref
|
|
24
|
-
.sub("%1", "<span class='fmt-xref-container'
|
|
25
|
-
.sub("%2",
|
|
24
|
+
.sub("%1", "<span class='fmt-xref-container'>#{esc container_label}</span>")
|
|
25
|
+
.sub("%2", esc(linkend))))
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def anchor_value(id)
|
|
@@ -33,6 +33,9 @@ module IsoDoc
|
|
|
33
33
|
def anchor_linkend(node, linkend)
|
|
34
34
|
node["style"] == "id" and
|
|
35
35
|
return anchor_id_postproc(node)
|
|
36
|
+
node["style"] && x = @ref_renderings&.dig(node["bibitemid"], :citation,
|
|
37
|
+
node["style"].to_sym) and
|
|
38
|
+
return x.strip
|
|
36
39
|
node["citeas"].nil? && node["bibitemid"] and
|
|
37
40
|
return citeas_cleanup(@xrefs.anchor(node["bibitemid"], :xref)) || "???"
|
|
38
41
|
node.at(ns("./location")) and
|
|
@@ -70,7 +73,7 @@ module IsoDoc
|
|
|
70
73
|
def anchor_xref_short(node, target, container)
|
|
71
74
|
if (l = node["label"]) && !container
|
|
72
75
|
v = anchor_value(target)
|
|
73
|
-
@i18n.l10n(%[<span class="fmt-element-name">#{l}</span>
|
|
76
|
+
@i18n.l10n(%[<span class="fmt-element-name">#{l}</span> #{esc v}])
|
|
74
77
|
else @xrefs.anchor(target, :xref)
|
|
75
78
|
end
|
|
76
79
|
end
|
|
@@ -94,7 +97,7 @@ module IsoDoc
|
|
|
94
97
|
combine_conflated_xref_locations(locs)
|
|
95
98
|
else
|
|
96
99
|
out = locs.each do |l|
|
|
97
|
-
l[:label] =
|
|
100
|
+
l[:label] = esc(anchor_linkend1(l[:node]))
|
|
98
101
|
end
|
|
99
102
|
l10n(combine_conn(out))
|
|
100
103
|
end
|
|
@@ -116,7 +119,7 @@ module IsoDoc
|
|
|
116
119
|
def conflate_xref_locations(locs)
|
|
117
120
|
out = locs.each { |l| l[:label] = anchor_value(l[:target]) }
|
|
118
121
|
label = @i18n.inflect(locs.first[:elem], number: "pl")
|
|
119
|
-
out[0][:label] = l10n("#{label}
|
|
122
|
+
out[0][:label] = l10n("#{label} #{esc out[0][:label]}").strip
|
|
120
123
|
out
|
|
121
124
|
end
|
|
122
125
|
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -63,18 +63,20 @@ module IsoDoc
|
|
|
63
63
|
|
|
64
64
|
def dl_table_attrs(node)
|
|
65
65
|
{ id: node["id"],
|
|
66
|
-
|
|
66
|
+
style: node["class"] == "formula_dl" ? "text-align:left;" : nil,
|
|
67
67
|
class: node["class"] || "dl" }
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def dl_parse_table(node, out)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.
|
|
75
|
-
|
|
71
|
+
out.div **attr_code(align: "left") do |div|
|
|
72
|
+
list_title_parse(node, div)
|
|
73
|
+
div.table **attr_code(dl_table_attrs(node)) do |v|
|
|
74
|
+
node.elements.select { |n| dt_dd?(n) }
|
|
75
|
+
.each_slice(2) do |dt, dd|
|
|
76
|
+
dl_parse_table1(v, dt, dd)
|
|
77
|
+
end
|
|
78
|
+
dl_parse_table_notes(node, v)
|
|
76
79
|
end
|
|
77
|
-
dl_parse_table_notes(node, v)
|
|
78
80
|
end
|
|
79
81
|
end
|
|
80
82
|
|
|
@@ -72,18 +72,29 @@ module IsoDoc
|
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def table_attrs(node)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
style: "mso-table-anchor-horizontal:column;mso-table-overlap:never;" \
|
|
81
|
-
"#{style}#{keep_style(node)}",
|
|
82
|
-
class: (node.text.length > 4000 ? "MsoISOTableBig" : "MsoISOTable") }
|
|
75
|
+
style = table_border_css(node)
|
|
76
|
+
ret = { summary: node["summary"], width: node["width"],
|
|
77
|
+
class: table_class(node),
|
|
78
|
+
style: "mso-table-anchor-horizontal:column;" \
|
|
79
|
+
"mso-table-overlap:never;#{style}#{keep_style(node)}" }
|
|
83
80
|
style or ret.delete(:class)
|
|
84
81
|
super.merge(attr_code(ret))
|
|
85
82
|
end
|
|
86
83
|
|
|
84
|
+
def table_border_css(node)
|
|
85
|
+
c = node["class"]
|
|
86
|
+
style = "border-spacing:0;border-width:1px;"
|
|
87
|
+
node["style"] || node["plain"] == "true" and style = ""
|
|
88
|
+
(%w(modspec).include?(c) || !c) or style = nil
|
|
89
|
+
node["plain"] == "true" and style = ""
|
|
90
|
+
style
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def table_class(node)
|
|
94
|
+
node["plain"] == "true" and return "MsoNormalTable"
|
|
95
|
+
node.text.length > 4000 ? "MsoISOTableBig" : "MsoISOTable"
|
|
96
|
+
end
|
|
97
|
+
|
|
87
98
|
def colgroup(node, table)
|
|
88
99
|
colgroup = node.at(ns("./colgroup")) or return
|
|
89
100
|
table.colgroup do |cg|
|
|
@@ -205,3 +205,26 @@ inflection:
|
|
|
205
205
|
الطبعة:
|
|
206
206
|
grammar:
|
|
207
207
|
gender: f
|
|
208
|
+
punct:
|
|
209
|
+
colon: ":"
|
|
210
|
+
comma: ","
|
|
211
|
+
enum-comma: ","
|
|
212
|
+
semicolon: ";"
|
|
213
|
+
period: "."
|
|
214
|
+
close-paren: ")"
|
|
215
|
+
open-paren: "("
|
|
216
|
+
close-bracket: "]"
|
|
217
|
+
open-bracket: "["
|
|
218
|
+
question-mark: "?"
|
|
219
|
+
exclamation-mark: "!"
|
|
220
|
+
emphasis-mark: ""
|
|
221
|
+
em-dash: —
|
|
222
|
+
en-dash: –
|
|
223
|
+
number-en-dash: –
|
|
224
|
+
open-quote: '“'
|
|
225
|
+
close-quote: '”'
|
|
226
|
+
open-nested-quote: '‘'
|
|
227
|
+
close-nested-quote: '’'
|
|
228
|
+
ellipse: …
|
|
229
|
+
cjk-latin-separator: ""
|
|
230
|
+
|
|
@@ -217,3 +217,26 @@ inflection:
|
|
|
217
217
|
Auflage:
|
|
218
218
|
grammar:
|
|
219
219
|
gender: f
|
|
220
|
+
punct:
|
|
221
|
+
colon: ":"
|
|
222
|
+
comma: ","
|
|
223
|
+
enum-comma: ","
|
|
224
|
+
semicolon: ";"
|
|
225
|
+
period: "."
|
|
226
|
+
close-paren: ")"
|
|
227
|
+
open-paren: "("
|
|
228
|
+
close-bracket: "]"
|
|
229
|
+
open-bracket: "["
|
|
230
|
+
question-mark: "?"
|
|
231
|
+
exclamation-mark: "!"
|
|
232
|
+
emphasis-mark: ""
|
|
233
|
+
em-dash: —
|
|
234
|
+
en-dash: –
|
|
235
|
+
number-en-dash: –
|
|
236
|
+
open-quote: '„'
|
|
237
|
+
close-quote: '“'
|
|
238
|
+
open-nested-quote: '‚'
|
|
239
|
+
close-nested-quote: '‘'
|
|
240
|
+
ellipse: …
|
|
241
|
+
cjk-latin-separator: ""
|
|
242
|
+
|
|
@@ -214,3 +214,25 @@ inflection:
|
|
|
214
214
|
Page:
|
|
215
215
|
sg: Page
|
|
216
216
|
pl: Pages
|
|
217
|
+
punct:
|
|
218
|
+
colon: ":"
|
|
219
|
+
comma: ","
|
|
220
|
+
enum-comma: ","
|
|
221
|
+
semicolon: ";"
|
|
222
|
+
period: "."
|
|
223
|
+
close-paren: ")"
|
|
224
|
+
open-paren: "("
|
|
225
|
+
close-bracket: "]"
|
|
226
|
+
open-bracket: "["
|
|
227
|
+
question-mark: "?"
|
|
228
|
+
exclamation-mark: "!"
|
|
229
|
+
emphasis-mark: ""
|
|
230
|
+
em-dash: —
|
|
231
|
+
en-dash: –
|
|
232
|
+
number-en-dash: –
|
|
233
|
+
open-quote: '“'
|
|
234
|
+
close-quote: '”'
|
|
235
|
+
open-nested-quote: '‘'
|
|
236
|
+
close-nested-quote: '’'
|
|
237
|
+
ellipse: …
|
|
238
|
+
cjk-latin-separator: ""
|
|
@@ -215,3 +215,26 @@ inflection:
|
|
|
215
215
|
edición:
|
|
216
216
|
grammar:
|
|
217
217
|
gender: f
|
|
218
|
+
punct:
|
|
219
|
+
colon: ":"
|
|
220
|
+
comma: ","
|
|
221
|
+
enum-comma: ","
|
|
222
|
+
semicolon: ";"
|
|
223
|
+
period: "."
|
|
224
|
+
close-paren: ")"
|
|
225
|
+
open-paren: "("
|
|
226
|
+
close-bracket: "]"
|
|
227
|
+
open-bracket: "["
|
|
228
|
+
question-mark: "?"
|
|
229
|
+
exclamation-mark: "!"
|
|
230
|
+
emphasis-mark: ""
|
|
231
|
+
em-dash: —
|
|
232
|
+
en-dash: –
|
|
233
|
+
number-en-dash: –
|
|
234
|
+
open-quote: '«'
|
|
235
|
+
close-quote: '»'
|
|
236
|
+
open-nested-quote: '“'
|
|
237
|
+
close-nested-quote: '”'
|
|
238
|
+
ellipse: …
|
|
239
|
+
cjk-latin-separator: ""
|
|
240
|
+
|
|
@@ -213,3 +213,26 @@ inflection:
|
|
|
213
213
|
édition:
|
|
214
214
|
grammar:
|
|
215
215
|
gender: f
|
|
216
|
+
punct:
|
|
217
|
+
colon: ":"
|
|
218
|
+
comma: ","
|
|
219
|
+
enum-comma: ","
|
|
220
|
+
semicolon: ";"
|
|
221
|
+
period: "."
|
|
222
|
+
close-paren: ")"
|
|
223
|
+
open-paren: "("
|
|
224
|
+
close-bracket: "]"
|
|
225
|
+
open-bracket: "["
|
|
226
|
+
question-mark: "?"
|
|
227
|
+
exclamation-mark: "!"
|
|
228
|
+
emphasis-mark: ""
|
|
229
|
+
em-dash: —
|
|
230
|
+
en-dash: –
|
|
231
|
+
number-en-dash: –
|
|
232
|
+
open-quote: '«'
|
|
233
|
+
close-quote: '»'
|
|
234
|
+
open-nested-quote: '“'
|
|
235
|
+
close-nested-quote: '”'
|
|
236
|
+
ellipse: …
|
|
237
|
+
cjk-latin-separator: ""
|
|
238
|
+
|
|
@@ -87,7 +87,7 @@ wholeoftext: Whole of text
|
|
|
87
87
|
draft_label: draft
|
|
88
88
|
inform_annex: 参考
|
|
89
89
|
norm_annex: 規定
|
|
90
|
-
modified:
|
|
90
|
+
modified: を変更
|
|
91
91
|
adapted: 適合しました
|
|
92
92
|
deprecated: 推奨しない用語
|
|
93
93
|
source: 出典
|
|
@@ -96,6 +96,7 @@ no_identifier: (識別子なし)
|
|
|
96
96
|
all_parts: 規格群
|
|
97
97
|
edition_ordinal: "第{{ var1 }}版"
|
|
98
98
|
edition: 版
|
|
99
|
+
version: 版
|
|
99
100
|
toc_figures: List of figures
|
|
100
101
|
toc_tables: List of tables
|
|
101
102
|
toc_recommendations: List of recommendations
|
|
@@ -247,3 +248,4 @@ punct:
|
|
|
247
248
|
ellipse: ⋯⋯
|
|
248
249
|
cjk-latin-separator: " "
|
|
249
250
|
|
|
251
|
+
|
|
@@ -279,3 +279,26 @@ inflection:
|
|
|
279
279
|
издание:
|
|
280
280
|
grammar:
|
|
281
281
|
gender: n
|
|
282
|
+
punct:
|
|
283
|
+
colon: ":"
|
|
284
|
+
comma: ","
|
|
285
|
+
enum-comma: ","
|
|
286
|
+
semicolon: ";"
|
|
287
|
+
period: "."
|
|
288
|
+
close-paren: ")"
|
|
289
|
+
open-paren: "("
|
|
290
|
+
close-bracket: "]"
|
|
291
|
+
open-bracket: "["
|
|
292
|
+
question-mark: "?"
|
|
293
|
+
exclamation-mark: "!"
|
|
294
|
+
emphasis-mark: ""
|
|
295
|
+
em-dash: —
|
|
296
|
+
en-dash: –
|
|
297
|
+
number-en-dash: –
|
|
298
|
+
open-quote: '«'
|
|
299
|
+
close-quote: '»'
|
|
300
|
+
open-nested-quote: '„'
|
|
301
|
+
close-nested-quote: '“'
|
|
302
|
+
ellipse: …
|
|
303
|
+
cjk-latin-separator: ""
|
|
304
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
template:
|
|
2
2
|
# skip authoritative identifier, it is inserted in front of formattedref within metanorma
|
|
3
|
-
standard: "{% if creatornames %}{{ creatornames }} ({{ role}}){%else%}{{publisher}}{%endif%}
|
|
3
|
+
standard: "{% if creatornames %}{{ creatornames }} ({{ role}}){%else%}{{publisher}}{%endif%} $$$ <em>{{ title }}</em> $$$ {{ medium | capitalize }}$$$ {{ edition | capitalize_first }}$$$ {{date}}$$$ {{place}}: {%if creatornames %}{{publisher}}{% endif %} $$$ {{size}}$$$ {{ extent }}$$$ {{ uri }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
|
|
4
4
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: isodoc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -86,14 +86,14 @@ dependencies:
|
|
|
86
86
|
requirements:
|
|
87
87
|
- - "~>"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 0.
|
|
89
|
+
version: 1.0.0
|
|
90
90
|
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 0.
|
|
96
|
+
version: 1.0.0
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: roman-numerals
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -346,6 +346,20 @@ dependencies:
|
|
|
346
346
|
- - '='
|
|
347
347
|
- !ruby/object:Gem::Version
|
|
348
348
|
version: 0.1.3
|
|
349
|
+
- !ruby/object:Gem::Dependency
|
|
350
|
+
name: openssl
|
|
351
|
+
requirement: !ruby/object:Gem::Requirement
|
|
352
|
+
requirements:
|
|
353
|
+
- - ">="
|
|
354
|
+
- !ruby/object:Gem::Version
|
|
355
|
+
version: '0'
|
|
356
|
+
type: :development
|
|
357
|
+
prerelease: false
|
|
358
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
359
|
+
requirements:
|
|
360
|
+
- - ">="
|
|
361
|
+
- !ruby/object:Gem::Version
|
|
362
|
+
version: '0'
|
|
349
363
|
description: |
|
|
350
364
|
isodoc converts documents in the IsoDoc document model into
|
|
351
365
|
Microsoft Word and HTML.
|