metanorma-ieee 1.5.5 → 1.5.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/lib/html2doc/ieee/lists.rb +4 -6
- data/lib/isodoc/ieee/html/htmlstyle.css +1 -1
- data/lib/isodoc/ieee/html/htmlstyle.scss +1 -1
- data/lib/isodoc/ieee/ieee.amendment.xsl +295 -337
- data/lib/isodoc/ieee/ieee.standard.xsl +295 -337
- data/lib/isodoc/ieee/init.rb +2 -2
- data/lib/isodoc/ieee/presentation_ref.rb +1 -1
- data/lib/isodoc/ieee/presentation_xml_convert.rb +20 -20
- data/lib/metanorma/ieee/cleanup_ref.rb +2 -15
- data/lib/metanorma/ieee/version.rb +1 -1
- metadata +2 -2
data/lib/isodoc/ieee/init.rb
CHANGED
@@ -53,7 +53,7 @@ module IsoDoc
|
|
53
53
|
node["style"] == "no-biblio-tag" or tag = bib[:ord]
|
54
54
|
if !c1.empty?
|
55
55
|
c2.each(&:remove)
|
56
|
-
c1.map(&:to_xml).join
|
56
|
+
[c1.map(&:to_xml).join, tag].compact.join(" ")
|
57
57
|
elsif node.at(ns("./location"))
|
58
58
|
linkend
|
59
59
|
elsif node["citeas"] == bib[:ord] then node["citeas"]
|
@@ -87,32 +87,43 @@ module IsoDoc
|
|
87
87
|
docxml.xpath(ns("//ol/li")).each { |f| ol_label(f) }
|
88
88
|
end
|
89
89
|
|
90
|
-
def
|
91
|
-
|
90
|
+
def ol_numbering_containers
|
91
|
+
"//clause | //annex | //foreword | //acknowledgements | " \
|
92
92
|
"//introduction | //preface/abstract | //appendix | //terms | " \
|
93
93
|
"//term | //definitions | //references | //colophon"
|
94
|
-
|
94
|
+
end
|
95
|
+
|
96
|
+
def ol_numbering(docxml)
|
97
|
+
docxml.xpath(ns(ol_numbering_containers)).each do |c|
|
98
|
+
i = -1
|
95
99
|
(c.xpath(ns(".//ol")) -
|
96
100
|
c.xpath(ns("./clause//ol | ./appendix//ol | ./term//ol | " \
|
97
101
|
"./terms//ol | ./definitions//ol | " \
|
98
|
-
"/references//ol | ./colophon//ol")))
|
99
|
-
.
|
102
|
+
"/references//ol | ./colophon//ol"))).each do |o|
|
103
|
+
(o.ancestors("ol").size + o.ancestors("ul").size).zero? and
|
104
|
+
i += 1 # ol root list
|
100
105
|
ol_numbering1(o, i)
|
101
106
|
end
|
102
107
|
end
|
103
108
|
end
|
104
109
|
|
105
110
|
def ol_numbering1(elem, idx)
|
106
|
-
|
111
|
+
ancestors = elem.ancestors.map(&:name).reverse
|
112
|
+
ul_loc = ancestors.index("ul")
|
113
|
+
ol_loc = ancestors.index("ol")
|
114
|
+
# is this a ul//ol list? if so, ignore idx of list in labelling
|
115
|
+
ul_root = ul_loc && (!ol_loc || ul_loc < ol_loc)
|
116
|
+
elem["type"] = ol_depth_rotate(elem, ul_root ? 0 : idx).to_s
|
107
117
|
end
|
108
118
|
|
109
119
|
# overrides IsoDoc:: XrefGen::OlTypeProvider: we trigger
|
110
120
|
# @xrefs.list_anchor_names after this is called, with elem["type"] set
|
121
|
+
# use the order of the ol in the clause to rotate the labelling
|
111
122
|
def ol_depth_rotate(node, idx)
|
112
|
-
depth = node.ancestors("ol").size + idx
|
123
|
+
depth = node.ancestors("ol").size + node.ancestors("ul").size + idx
|
113
124
|
type = :alphabet
|
114
|
-
type = :arabic if [
|
115
|
-
type = :roman if [
|
125
|
+
type = :arabic if [1, 4, 7].include? depth
|
126
|
+
type = :roman if [2, 5, 8].include? depth
|
116
127
|
type
|
117
128
|
end
|
118
129
|
|
@@ -125,17 +136,6 @@ module IsoDoc
|
|
125
136
|
end
|
126
137
|
end
|
127
138
|
|
128
|
-
# KILL
|
129
|
-
def middle_title_body
|
130
|
-
ret = "<p class='zzSTDTitle1'>#{@meta.get[:full_doctitle]}"
|
131
|
-
@meta.get[:amd] || @meta.get[:corr] and ret += "<br/>"
|
132
|
-
@meta.get[:amd] and ret += "Amendment #{@meta.get[:amd]}"
|
133
|
-
@meta.get[:amd] && @meta.get[:corr] and ret += " "
|
134
|
-
@meta.get[:corr] and ret += "Corrigenda #{@meta.get[:corr]}"
|
135
|
-
ret += "</p>"
|
136
|
-
ret
|
137
|
-
end
|
138
|
-
|
139
139
|
def middle_title_template
|
140
140
|
<<~OUTPUT
|
141
141
|
<p class='zzSTDTitle1'>{{ full_doctitle -}}
|
@@ -147,21 +147,9 @@ module Metanorma
|
|
147
147
|
|
148
148
|
def bibitem_cleanup(xmldoc)
|
149
149
|
super
|
150
|
-
supply_designations(xmldoc)
|
151
150
|
supply_withdrawn_notes(xmldoc)
|
152
151
|
end
|
153
152
|
|
154
|
-
# force existence of a designation for standards
|
155
|
-
def supply_designations(xmldoc)
|
156
|
-
xmldoc.xpath("//references/bibitem[@type = 'standard']").each do |b|
|
157
|
-
b.at("./docidentifier[not(@type = 'metanorma' or @type = 'DOI' or " \
|
158
|
-
"@type = 'metanorma-ordinal')]") and next
|
159
|
-
t = b.at("./title") or next
|
160
|
-
b.at("./title[last()]").next =
|
161
|
-
"<docidentifier type='title' primary='true'>#{t.text}</docidentifier>"
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
153
|
def supply_withdrawn_notes(xmldoc)
|
166
154
|
f = File.join(File.dirname(__FILE__), "ieee-footnotes.yaml")
|
167
155
|
@provenance_notes = YAML.safe_load(File.read(f))
|
@@ -178,9 +166,8 @@ module Metanorma
|
|
178
166
|
.map(&:text)
|
179
167
|
end
|
180
168
|
|
181
|
-
def
|
182
|
-
|
183
|
-
super
|
169
|
+
def empty_docid_to_title?(bibitem)
|
170
|
+
bibitem["type"] == "standard"
|
184
171
|
end
|
185
172
|
end
|
186
173
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-ieee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|