isodoc 3.4.4 → 3.4.5
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/lib/isodoc/base_style/blocks.scss +1 -1
- data/lib/isodoc/function/blocks.rb +3 -3
- data/lib/isodoc/function/blocks_example_note.rb +3 -2
- data/lib/isodoc/function/inline.rb +1 -10
- data/lib/isodoc/function/table.rb +10 -14
- data/lib/isodoc/function/to_word_html.rb +1 -1
- data/lib/isodoc/html_function/html.rb +2 -2
- data/lib/isodoc/presentation_function/autonum.rb +3 -2
- data/lib/isodoc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +17 -0
- data/lib/isodoc/word_function/inline.rb +1 -2
- data/lib/isodoc/word_function/table.rb +7 -7
- data/lib/isodoc/xref/xref_gen.rb +18 -0
- data/lib/isodoc/xref/xref_gen_seq.rb +33 -33
- data/lib/isodoc/xref/xref_sect_asset.rb +1 -0
- data/lib/isodoc-yaml/i18n-ar.yaml +1 -0
- data/lib/isodoc-yaml/i18n-de.yaml +1 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +1 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ja.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +1 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- 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: a8b88a6aed03f811db7d034a9eac97cbce2110e5efb1ba78d70c6c8666af1b66
|
|
4
|
+
data.tar.gz: 814cbba6debefab5d23c5beb9764438160aeee1937c18279a53bde60bd49c5bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de5040ab72de3052667440ac395eabc311621f0361979d9a5d637091e8e263547bf7723e3b7d19c995985252f14db4a9123eec1d0315a8f0fca0c062e0c79d3d
|
|
7
|
+
data.tar.gz: 53d2892698b75cfc7a8a40f7c921e810830b177f450b9187aa273e8479ecdaa937b0b58b9469bd616a3f7c8841d8c7ec0794a9e75185aada63c6a87580590edb
|
|
@@ -5,8 +5,8 @@ module IsoDoc
|
|
|
5
5
|
module Blocks
|
|
6
6
|
def figure_name_parse(_node, div, name)
|
|
7
7
|
name.nil? and return
|
|
8
|
-
div.
|
|
9
|
-
name
|
|
8
|
+
div.figcaption do |p|
|
|
9
|
+
children_parse(name, p)
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -23,7 +23,7 @@ module IsoDoc
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def figure_parse1(node, out)
|
|
26
|
-
out.
|
|
26
|
+
out.figure **figure_attrs(node) do |div|
|
|
27
27
|
node.children.each do |n|
|
|
28
28
|
parse(n, div) unless n.name == "fmt-name"
|
|
29
29
|
end
|
|
@@ -65,8 +65,9 @@ module IsoDoc
|
|
|
65
65
|
|
|
66
66
|
def starts_with_para?(node)
|
|
67
67
|
elem = block_body_first_elem(node) or return
|
|
68
|
-
elem.name == "p" || elem
|
|
69
|
-
|
|
68
|
+
elem.name == "p" || block_body_first_elem(elem)&.name == "p" ||
|
|
69
|
+
elem.elements.first&.name == "semx" &&
|
|
70
|
+
block_body_first_elem(elem.elements.first)&.name == "p"
|
|
70
71
|
end
|
|
71
72
|
|
|
72
73
|
def note_p_class
|
|
@@ -127,22 +127,13 @@ module IsoDoc
|
|
|
127
127
|
[HTMLEntities.new.encode(a), /^[[0-9,.+-]]*$/.match?(a)]
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
-
def
|
|
131
|
-
unless caption.nil?
|
|
132
|
-
out.p class: "FigureTitle", style: "text-align:center;" do |p|
|
|
133
|
-
p.b { |b| b << caption.to_s }
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
def image_parse(node, out, caption)
|
|
130
|
+
def image_parse(node, out)
|
|
139
131
|
attrs = { src: node["src"],
|
|
140
132
|
height: node["height"] || "auto",
|
|
141
133
|
width: node["width"] || "auto",
|
|
142
134
|
title: node["title"],
|
|
143
135
|
alt: node["alt"] }
|
|
144
136
|
image_body_parse(node, attrs, out)
|
|
145
|
-
image_title_parse(out, caption)
|
|
146
137
|
end
|
|
147
138
|
|
|
148
139
|
def image_body_parse(_node, attrs, out)
|
|
@@ -2,9 +2,15 @@ module IsoDoc
|
|
|
2
2
|
module Function
|
|
3
3
|
module Table
|
|
4
4
|
def table_title_parse(node, out)
|
|
5
|
-
name = node.at(ns("./fmt-name"))
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
name = node.at(ns("./fmt-name"))
|
|
6
|
+
summ = node["summary"]
|
|
7
|
+
name || summ or return
|
|
8
|
+
# out.p class: "TableTitle", style: "text-align:center;" do |p|
|
|
9
|
+
out.caption do |p|
|
|
10
|
+
children_parse(name, p)
|
|
11
|
+
summ and p.span style: "display:none" do |s|
|
|
12
|
+
s << summ
|
|
13
|
+
end
|
|
8
14
|
end
|
|
9
15
|
end
|
|
10
16
|
|
|
@@ -64,15 +70,6 @@ module IsoDoc
|
|
|
64
70
|
style
|
|
65
71
|
end
|
|
66
72
|
|
|
67
|
-
def tcaption(node, table)
|
|
68
|
-
node["summary"] or return
|
|
69
|
-
table.caption do |c|
|
|
70
|
-
c.span style: "display:none" do |s|
|
|
71
|
-
s << node["summary"]
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
73
|
def colgroup(node, table)
|
|
77
74
|
colgroup = node.at(ns("./colgroup")) or return
|
|
78
75
|
table.colgroup do |cg|
|
|
@@ -84,8 +81,8 @@ module IsoDoc
|
|
|
84
81
|
|
|
85
82
|
def table_parse(node, out)
|
|
86
83
|
@in_table = true
|
|
87
|
-
table_title_parse(node, out)
|
|
88
84
|
out.table **table_attrs(node) do |t|
|
|
85
|
+
table_title_parse(node, t)
|
|
89
86
|
table_parse_core(node, t)
|
|
90
87
|
table_parse_tail(node, t)
|
|
91
88
|
end
|
|
@@ -101,7 +98,6 @@ module IsoDoc
|
|
|
101
98
|
end
|
|
102
99
|
|
|
103
100
|
def table_parse_core(node, out)
|
|
104
|
-
tcaption(node, out)
|
|
105
101
|
colgroup(node, out)
|
|
106
102
|
thead_parse(node, out)
|
|
107
103
|
tbody_parse(node, out)
|
|
@@ -163,7 +163,7 @@ module IsoDoc
|
|
|
163
163
|
when "table" then table_parse(node, out)
|
|
164
164
|
when "figure" then figure_parse(node, out)
|
|
165
165
|
when "example", "termexample" then example_parse(node, out)
|
|
166
|
-
when "image" then image_parse(node, out
|
|
166
|
+
when "image" then image_parse(node, out)
|
|
167
167
|
when "sourcecode" then sourcecode_parse(node, out)
|
|
168
168
|
when "pre" then pre_parse(node, out)
|
|
169
169
|
when "callout-annotation" then annotation_parse(node, out)
|
|
@@ -106,8 +106,8 @@ module IsoDoc
|
|
|
106
106
|
def svg_supply_viewbox(svg)
|
|
107
107
|
svg["viewbox"] and return
|
|
108
108
|
svg["height"] && svg["width"] or return
|
|
109
|
-
h = svg["height"].
|
|
110
|
-
w = svg["width"].
|
|
109
|
+
h = svg["height"].to_s[/\d+/].to_s
|
|
110
|
+
w = svg["width"].to_s[/\d+/].to_s
|
|
111
111
|
h.to_i.positive? && w.to_i.positive? or return
|
|
112
112
|
svg["viewbox"] = "0 0 #{w} #{h}"
|
|
113
113
|
end
|
|
@@ -114,9 +114,9 @@ module IsoDoc
|
|
|
114
114
|
def prefix_container_fmt_xref_label(container, xref)
|
|
115
115
|
container or return xref
|
|
116
116
|
container_container = prefix_container_container(container)
|
|
117
|
+
container_xref = @xrefs.anchor(container, :xref, false)
|
|
117
118
|
container_label =
|
|
118
|
-
prefix_container_fmt_xref_label(container_container,
|
|
119
|
-
@xrefs.anchor(container, :xref, false))
|
|
119
|
+
prefix_container_fmt_xref_label(container_container, container_xref)
|
|
120
120
|
l10n(connectives_spans(@i18n.nested_xref
|
|
121
121
|
.sub("%1", "<span class='fmt-xref-container'>#{esc container_label}</span>")
|
|
122
122
|
.sub("%2", xref || "[Unknown]")))
|
|
@@ -124,6 +124,7 @@ module IsoDoc
|
|
|
124
124
|
|
|
125
125
|
def prefix_container_container(container)
|
|
126
126
|
container_container = @xrefs.anchor(container, :container, false)
|
|
127
|
+
container_container == container and return nil
|
|
127
128
|
if @xrefs.anchor(container, :type) == "bibitem"
|
|
128
129
|
p = @bibitem_lookup[container].parent
|
|
129
130
|
p and container_container ||= p["id"]
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -160,6 +160,23 @@ module IsoDoc
|
|
|
160
160
|
end
|
|
161
161
|
end
|
|
162
162
|
end
|
|
163
|
+
|
|
164
|
+
def figure_parse1(node, out)
|
|
165
|
+
out.div **figure_attrs(node) do |div|
|
|
166
|
+
node.children.each do |n|
|
|
167
|
+
parse(n, div) unless n.name == "fmt-name"
|
|
168
|
+
end
|
|
169
|
+
figure_name_parse(node, div, node.at(ns("./fmt-name")))
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def figure_name_parse(_node, div, name)
|
|
174
|
+
name.nil? and return
|
|
175
|
+
div.p class: "FigureTitle",
|
|
176
|
+
style: "text-align:center;" do |p|
|
|
177
|
+
name.children.each { |n| parse(n, p) }
|
|
178
|
+
end
|
|
179
|
+
end
|
|
163
180
|
end
|
|
164
181
|
end
|
|
165
182
|
end
|
|
@@ -41,13 +41,12 @@ module IsoDoc
|
|
|
41
41
|
save_dataimage(node["src"])
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
-
def image_parse(node, out
|
|
44
|
+
def image_parse(node, out)
|
|
45
45
|
emf_attributes(node)
|
|
46
46
|
attrs = { src: imgsrc(node),
|
|
47
47
|
height: node["height"], alt: node["alt"],
|
|
48
48
|
title: node["title"], width: node["width"] }
|
|
49
49
|
out.img **attr_code(attrs)
|
|
50
|
-
image_title_parse(out, caption)
|
|
51
50
|
end
|
|
52
51
|
|
|
53
52
|
def emf_attributes(node)
|
|
@@ -104,6 +104,13 @@ module IsoDoc
|
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
+
def table_title_parse(node, out)
|
|
108
|
+
name = node.at(ns("./fmt-name")) or return
|
|
109
|
+
out.p class: "TableTitle", style: "text-align:center;" do |p|
|
|
110
|
+
name&.children&.each { |n| parse(n, p) }
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
107
114
|
def table_parse(node, out)
|
|
108
115
|
@in_table = true
|
|
109
116
|
table_title_parse(node, out)
|
|
@@ -115,13 +122,6 @@ module IsoDoc
|
|
|
115
122
|
end
|
|
116
123
|
@in_table = false
|
|
117
124
|
end
|
|
118
|
-
|
|
119
|
-
def table_parse_core(node, out)
|
|
120
|
-
colgroup(node, out)
|
|
121
|
-
thead_parse(node, out)
|
|
122
|
-
tbody_parse(node, out)
|
|
123
|
-
tfoot_parse(node, out)
|
|
124
|
-
end
|
|
125
125
|
end
|
|
126
126
|
end
|
|
127
127
|
end
|
data/lib/isodoc/xref/xref_gen.rb
CHANGED
|
@@ -174,6 +174,24 @@ module IsoDoc
|
|
|
174
174
|
end
|
|
175
175
|
end
|
|
176
176
|
|
|
177
|
+
def para_anchor_names(sections)
|
|
178
|
+
sections.each do |s|
|
|
179
|
+
notes = s.xpath(ns("./p"))
|
|
180
|
+
para_anchor_names1(notes, Counter.new)
|
|
181
|
+
para_anchor_names(s.xpath(ns(child_sections)))
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def para_anchor_names1(notes, counter)
|
|
186
|
+
notes.noblank.each do |n|
|
|
187
|
+
counter.increment(n)
|
|
188
|
+
@anchors[n["id"]] =
|
|
189
|
+
anchor_struct(counter.print, n,
|
|
190
|
+
@labels["para_xref"], "paragraph",
|
|
191
|
+
{ container: true, unnumb: false })
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
177
195
|
def id_ancestor(node)
|
|
178
196
|
parent = nil
|
|
179
197
|
node.ancestors.each do |a|
|
|
@@ -21,10 +21,10 @@ module IsoDoc
|
|
|
21
21
|
j = 0
|
|
22
22
|
clause.xpath(ns(self.class::FIGURE_NO_CLASS)).noblank
|
|
23
23
|
.each_with_object(Counter.new) do |t, c|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
# labelled_ancestor(t, %w(figure)) and next # disable nested figure labelling
|
|
25
|
+
j = subfigure_increment(j, c, t)
|
|
26
|
+
sublabel = subfigure_label(j)
|
|
27
|
+
figure_anchor(t, sublabel, c.print, "figure", container: container)
|
|
28
28
|
end
|
|
29
29
|
sequential_figure_class_names(clause, container:)
|
|
30
30
|
end
|
|
@@ -33,11 +33,11 @@ module IsoDoc
|
|
|
33
33
|
j = 0
|
|
34
34
|
clause.xpath(ns(".//figure[@class][not(@class = 'pseudocode')]"))
|
|
35
35
|
.each_with_object({}) do |t, c|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
c[t["class"]] ||= Counter.new
|
|
37
|
+
j = subfigure_increment(j, c[t["class"]], t)
|
|
38
|
+
sublabel = subfigure_label(j)
|
|
39
|
+
figure_anchor(t, sublabel, c[t["class"]].print, t["class"],
|
|
40
|
+
container: container)
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
|
|
@@ -84,48 +84,48 @@ module IsoDoc
|
|
|
84
84
|
def sequential_table_names(clause, container: false)
|
|
85
85
|
clause.xpath(ns(".//table")).noblank
|
|
86
86
|
.each_with_object(Counter.new) do |t, c|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
@anchors[t["id"]] = anchor_struct(
|
|
88
|
+
c.increment(t).print, t, @labels["table"], "table",
|
|
89
|
+
{ unnumb: t["unnumbered"], container: container }
|
|
90
|
+
)
|
|
91
|
+
nested_notes(t)
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
def sequential_formula_names(clause, container: false)
|
|
96
96
|
clause.xpath(ns(".//formula")).noblank
|
|
97
97
|
.each_with_object(Counter.new) do |t, c|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
@anchors[t["id"]] = anchor_struct(
|
|
99
|
+
c.increment(t).print, t,
|
|
100
|
+
t["inequality"] ? @labels["inequality"] : @labels["formula"],
|
|
101
|
+
"formula", { unnumb: t["unnumbered"], container: true }
|
|
102
|
+
)
|
|
103
|
+
@anchors[t["id"]][:bare_xref] = @anchors[t["id"]][:label]
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
def sequential_permission_names(clause, container: true)
|
|
108
108
|
clause.xpath(ns(first_lvl_req)).noblank
|
|
109
109
|
.each_with_object(ReqCounter.new) do |t, c|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
m = @reqt_models.model(t["model"])
|
|
111
|
+
klass, label = reqt2class_label(t, m)
|
|
112
|
+
id = c.increment(label, t).print
|
|
113
|
+
sequential_permission_body(id, nil, t, label, klass, m,
|
|
114
|
+
container:)
|
|
115
|
+
sequential_permission_children(t, id, klass, container:)
|
|
116
116
|
end
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
def sequential_permission_children(elem, lbl, klass, container: false)
|
|
120
120
|
elem.xpath(ns(req_children)).noblank
|
|
121
121
|
.each_with_object(ReqCounter.new) do |t, c|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
m = @reqt_models.model(t["model"])
|
|
123
|
+
klass, label = reqt2class_nested_label(t, m)
|
|
124
|
+
ctr = c.increment(label, t).print
|
|
125
|
+
id = "#{lbl}#{subreqt_separator}#{ctr}"
|
|
126
|
+
sequential_permission_body(ctr, lbl, t, label, klass, m,
|
|
127
|
+
container:)
|
|
128
|
+
sequential_permission_children(t, id, klass, container:)
|
|
129
129
|
end
|
|
130
130
|
end
|
|
131
131
|
|
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.
|
|
4
|
+
version: 3.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02
|
|
11
|
+
date: 2026-03-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|