isodoc 3.7.4 → 3.7.6
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 +1 -2
- data/lib/isodoc/function/footnotes.rb +3 -3
- data/lib/isodoc/html_function/postprocess.rb +2 -2
- data/lib/isodoc/html_function/postprocess_cover.rb +1 -1
- data/lib/isodoc/presentation_function/autonum.rb +1 -1
- data/lib/isodoc/presentation_function/ids.rb +2 -2
- data/lib/isodoc/presentation_function/refs.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_gen.rb +15 -4
- metadata +6 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53a0846d73af6d9b85e2ab844e73b7f136e7fdff0bed55e952f0538359dee5e8
|
|
4
|
+
data.tar.gz: d2b73567291b752c28d06228fe58cd1b1bb8dfea3df5acd727d8aa2db63cd541
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a0a325e3e20a885a95cdabd6bc53a90b4537be2ec20315173ec8d6f48beb7c9af89f9cea4966db4b20edfd08a22878d704ece90495cd3a8c600b37572d81c38
|
|
7
|
+
data.tar.gz: ffb5f000b1363a094e4142091eb189bdcbba7d4dc4a3f55374b2b4eb6fecff9686af7898925842246e8c33c485c1716a7bd71b269e92fc31f9979163ef32ccc2
|
data/isodoc.gemspec
CHANGED
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.add_dependency "bigdecimal"
|
|
33
33
|
spec.add_dependency "html2doc", "~> 1.12"
|
|
34
34
|
# spec.add_dependency "isodoc-i18n", "~> 1.5" # already in relaton-render and mn-requirements
|
|
35
|
-
spec.add_dependency "relaton-cli", "
|
|
35
|
+
spec.add_dependency "relaton-cli", "~> 3.0"
|
|
36
36
|
# std_docid_semantic parses through the pubid monogem's flavor
|
|
37
37
|
# registry (Pubid.eager_load_flavors!) — 2.x API, no per-flavor gems
|
|
38
38
|
spec.add_dependency "pubid", "~> 2.0"
|
|
@@ -45,7 +45,6 @@ Gem::Specification.new do |spec|
|
|
|
45
45
|
# flavor stacks boot against it.
|
|
46
46
|
# Released isodoc lines keep resolving relaton-render 1.3.0; only a
|
|
47
47
|
# stack on this floor co-resolves the relaton 3.0 line.
|
|
48
|
-
spec.add_dependency "relaton-render", "~> 3.0", "< 5"
|
|
49
48
|
spec.add_dependency "roman-numerals"
|
|
50
49
|
spec.add_dependency "rouge", "~> 4.0"
|
|
51
50
|
# lib/isodoc/css.rb requires sassc-embedded (SassC::Engine) at
|
|
@@ -12,7 +12,7 @@ module IsoDoc
|
|
|
12
12
|
def get_table_ancestor_id(node)
|
|
13
13
|
table = node.ancestors("table")
|
|
14
14
|
table.empty? and table = node.ancestors("figure")
|
|
15
|
-
table.empty? and return [nil,
|
|
15
|
+
table.empty? and return [nil, Metanorma::Utils.random_uuid]
|
|
16
16
|
[table.last, table.last["id"]]
|
|
17
17
|
end
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ module IsoDoc
|
|
|
20
20
|
# do not output footnote text if we have already seen it for this table
|
|
21
21
|
|
|
22
22
|
def table_footnote_parse(node, out)
|
|
23
|
-
fn = node["reference"] ||
|
|
23
|
+
fn = node["reference"] || Metanorma::Utils.random_uuid
|
|
24
24
|
table, tid = get_table_ancestor_id(node)
|
|
25
25
|
make_table_footnote_link(out, tid + fn, node.at(ns("./fmt-fn-label")))
|
|
26
26
|
# do not output footnote text if we have already seen it for this table
|
|
@@ -49,7 +49,7 @@ module IsoDoc
|
|
|
49
49
|
|
|
50
50
|
def footnote_parse(node, out)
|
|
51
51
|
table_footnote?(node) and return table_footnote_parse(node, out)
|
|
52
|
-
fn = node["target"] # ||
|
|
52
|
+
fn = node["target"] # || Metanorma::Utils.random_uuid
|
|
53
53
|
attrs = { class: "FootnoteRef", href: "#fn:#{fn}" }
|
|
54
54
|
f = node.at(ns("./fmt-fn-label"))
|
|
55
55
|
out.a(**attrs) do |a|
|
|
@@ -118,7 +118,7 @@ module IsoDoc
|
|
|
118
118
|
|
|
119
119
|
def move_image1(img)
|
|
120
120
|
suffix = image_suffix(img)
|
|
121
|
-
uuid =
|
|
121
|
+
uuid = Metanorma::Utils.random_uuid
|
|
122
122
|
fname = "#{uuid}.#{suffix}"
|
|
123
123
|
new_full_filename = File.join(tmpimagedir, fname)
|
|
124
124
|
local_filename = image_localfile(img)
|
|
@@ -131,7 +131,7 @@ module IsoDoc
|
|
|
131
131
|
docxml.xpath("//p[@class = 'TermNum'][../#{h}]").each do |p|
|
|
132
132
|
p.name = "h#{h[1].to_i + 1}"
|
|
133
133
|
id = p["id"]
|
|
134
|
-
p["id"] = "_#{
|
|
134
|
+
p["id"] = "_#{Metanorma::Utils.random_uuid}"
|
|
135
135
|
p.wrap("<div id='#{id}'></div>")
|
|
136
136
|
end
|
|
137
137
|
end
|
|
@@ -154,7 +154,7 @@ module IsoDoc
|
|
|
154
154
|
def html_toc_entries_prep(docxml, path)
|
|
155
155
|
docxml.xpath(path.join(" | "))
|
|
156
156
|
.each_with_index.with_object({}) do |(h, i), m|
|
|
157
|
-
h["id"] ||= "_#{
|
|
157
|
+
h["id"] ||= "_#{Metanorma::Utils.random_uuid}"
|
|
158
158
|
m[h["id"]] = i
|
|
159
159
|
end
|
|
160
160
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module IsoDoc
|
|
2
2
|
class PresentationXMLConvert < ::IsoDoc::Convert
|
|
3
3
|
def add_id_text
|
|
4
|
-
id = "_#{
|
|
4
|
+
id = "_#{Metanorma::Utils.random_uuid}"
|
|
5
5
|
@new_ids[id] = nil
|
|
6
6
|
%(id="#{id}")
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def add_id(elem)
|
|
10
10
|
elem["id"] and return
|
|
11
|
-
id = "_#{
|
|
11
|
+
id = "_#{Metanorma::Utils.random_uuid}"
|
|
12
12
|
elem["id"] = id
|
|
13
13
|
@new_ids[id] = nil
|
|
14
14
|
end
|
|
@@ -195,7 +195,7 @@ module IsoDoc
|
|
|
195
195
|
ret = ident_fn(bib)
|
|
196
196
|
date_note = bibnote_extract(bib, "Unpublished-Status")
|
|
197
197
|
date_note.empty? and return ret
|
|
198
|
-
id = "_#{
|
|
198
|
+
id = "_#{Metanorma::Utils.random_uuid}"
|
|
199
199
|
@new_ids[id] = nil
|
|
200
200
|
<<~XML
|
|
201
201
|
#{ret}<fn id='#{id}' reference='#{id}'><p>#{date_note.first.content}</p></fn>
|
data/lib/isodoc/version.rb
CHANGED
data/lib/isodoc/xref/xref_gen.rb
CHANGED
|
@@ -118,13 +118,25 @@ module IsoDoc
|
|
|
118
118
|
def note_anchor_names(sections)
|
|
119
119
|
sections.each do |s|
|
|
120
120
|
notes = s.xpath(child_asset_path("note")) -
|
|
121
|
-
s.xpath(ns(".//figure//note | .//table//note
|
|
122
|
-
|
|
121
|
+
s.xpath(ns(".//figure//note | .//table//note")) -
|
|
122
|
+
requirement_nested_notes(s)
|
|
123
123
|
note_anchor_names1(notes, Counter.new)
|
|
124
124
|
note_anchor_names(s.xpath(ns(child_sections)))
|
|
125
125
|
end
|
|
126
126
|
end
|
|
127
127
|
|
|
128
|
+
# Notes under requirement-class blocks are excluded from per-section
|
|
129
|
+
# asset numbering everywhere. The set is document-wide and constant
|
|
130
|
+
# for the whole xref pass: an absolute // xpath evaluated on a node
|
|
131
|
+
# scans the entire document, so re-running it per visited section is
|
|
132
|
+
# quadratic on sectioned documents (vocabulary corpora carry
|
|
133
|
+
# thousands of term clauses).
|
|
134
|
+
def requirement_nested_notes(source)
|
|
135
|
+
@requirement_nested_notes ||= source.document.xpath(
|
|
136
|
+
ns("//permission//note | //recommendation//note | //requirement//note")
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
|
|
128
140
|
def note_anchor_names1(notes, counter)
|
|
129
141
|
notes.noblank.each do |n|
|
|
130
142
|
@anchors[n["id"]] =
|
|
@@ -167,8 +179,7 @@ module IsoDoc
|
|
|
167
179
|
def example_anchor_names(sections)
|
|
168
180
|
sections.each do |s|
|
|
169
181
|
notes = s.xpath(child_asset_path("example")) -
|
|
170
|
-
s
|
|
171
|
-
"//recommendation//note | //requirement//note"))
|
|
182
|
+
requirement_nested_notes(s)
|
|
172
183
|
example_anchor_names1(notes, Counter.new)
|
|
173
184
|
example_anchor_names(s.xpath(ns(child_sections)))
|
|
174
185
|
end
|
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.7.
|
|
4
|
+
version: 3.7.6
|
|
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-10-
|
|
11
|
+
date: 2026-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -56,22 +56,16 @@ dependencies:
|
|
|
56
56
|
name: relaton-cli
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - "
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: 3.0.0
|
|
62
|
-
- - "<"
|
|
59
|
+
- - "~>"
|
|
63
60
|
- !ruby/object:Gem::Version
|
|
64
|
-
version: '3.
|
|
61
|
+
version: '3.0'
|
|
65
62
|
type: :runtime
|
|
66
63
|
prerelease: false
|
|
67
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
68
65
|
requirements:
|
|
69
|
-
- - "
|
|
70
|
-
- !ruby/object:Gem::Version
|
|
71
|
-
version: 3.0.0
|
|
72
|
-
- - "<"
|
|
66
|
+
- - "~>"
|
|
73
67
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '3.
|
|
68
|
+
version: '3.0'
|
|
75
69
|
- !ruby/object:Gem::Dependency
|
|
76
70
|
name: pubid
|
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,26 +108,6 @@ dependencies:
|
|
|
114
108
|
- - "~>"
|
|
115
109
|
- !ruby/object:Gem::Version
|
|
116
110
|
version: 0.5.0
|
|
117
|
-
- !ruby/object:Gem::Dependency
|
|
118
|
-
name: relaton-render
|
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
|
120
|
-
requirements:
|
|
121
|
-
- - "~>"
|
|
122
|
-
- !ruby/object:Gem::Version
|
|
123
|
-
version: '3.0'
|
|
124
|
-
- - "<"
|
|
125
|
-
- !ruby/object:Gem::Version
|
|
126
|
-
version: '5'
|
|
127
|
-
type: :runtime
|
|
128
|
-
prerelease: false
|
|
129
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
130
|
-
requirements:
|
|
131
|
-
- - "~>"
|
|
132
|
-
- !ruby/object:Gem::Version
|
|
133
|
-
version: '3.0'
|
|
134
|
-
- - "<"
|
|
135
|
-
- !ruby/object:Gem::Version
|
|
136
|
-
version: '5'
|
|
137
111
|
- !ruby/object:Gem::Dependency
|
|
138
112
|
name: roman-numerals
|
|
139
113
|
requirement: !ruby/object:Gem::Requirement
|