metanorma-ieee 1.3.2 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,8 +10,7 @@ module IsoDoc
10
10
  c = IsoDoc::XrefGen::Counter.new("@")
11
11
  elem.xpath(ns("./definition")).each do |d|
12
12
  c.increment(d)
13
- d.elements.first.children.first.previous =
14
- "<strong>(#{c.print})</strong>&#xa0;"
13
+ d.elements.first.add_first_child "<strong>(#{c.print})</strong>&#xa0;"
15
14
  end
16
15
  end
17
16
 
@@ -214,6 +213,13 @@ module IsoDoc
214
213
  end
215
214
  end
216
215
 
216
+ # domain is rendered in designation_field instead
217
+ def termdomain(elem)
218
+ d = elem.at(ns(".//domain")) or return
219
+ d["hidden"] = "true"
220
+ end
221
+
222
+ # TODO wrap domain not in <domain>, but <span class="domain"> or equivalent
217
223
  def designation_field(desgn, name)
218
224
  if desgn.name == "preferred"
219
225
  f = desgn.xpath(ns("./../domain | ./../subject")).map(&:remove)
@@ -235,11 +241,20 @@ module IsoDoc
235
241
  pref << " (#{tail})"
236
242
  end
237
243
 
244
+ def termnote_delim(_elem)
245
+ "&#x2014;"
246
+ end
247
+
238
248
  def termnote1(elem)
239
- lbl = l10n(@xrefs.anchor(elem["id"], :label)&.strip || "???")
249
+ lbl = termnote_label(elem)
240
250
  prefix_name(elem, block_delim, lower2cap(lbl), "name")
241
251
  end
242
252
 
253
+ def termnote_label(elem)
254
+ lbl = l10n(@xrefs.anchor(elem["id"], :label)&.strip || "???")
255
+ l10n "#{lbl}#{termnote_delim(elem)}"
256
+ end
257
+
243
258
  def term(docxml); end
244
259
 
245
260
  def concept1(node)
@@ -18,8 +18,9 @@ module IsoDoc
18
18
  ret = resolve_eref_connectives(eref_locality_stacks(refs, target,
19
19
  node))
20
20
  node["droploc"] = droploc
21
+ p = prefix_clause(target, refs.first.at(ns("./locality")))
21
22
  eref_localities1({ target: target, number: "pl",
22
- type: prefix_clause(target, refs.first.at(ns("./locality"))),
23
+ type: p,
23
24
  from: l10n(ret[1..-1].join), node: node,
24
25
  lang: @lang })
25
26
  end
@@ -72,13 +73,8 @@ module IsoDoc
72
73
  "&#x2014;"
73
74
  end
74
75
 
75
- def note1(elem)
76
- elem.parent.name == "bibitem" || elem["notag"] == "true" and return
77
- n = @xrefs.get[elem["id"]]
78
- lbl = if n.nil? || n[:label].nil? || n[:label].empty? then @i18n.note
79
- else l10n("#{@i18n.note} #{n[:label]}")
80
- end
81
- prefix_name(elem, block_delim, lbl, "name")
76
+ def note_delim(_elem)
77
+ "&#x2014;"
82
78
  end
83
79
 
84
80
  def annex1(elem)
@@ -95,7 +91,7 @@ module IsoDoc
95
91
  t.name = "variant-title"
96
92
  t["type"] = "sub"
97
93
  end
98
- elem.children.first.previous = "<title>#{lbl}</title>"
94
+ elem.add_first_child "<title>#{lbl}</title>"
99
95
  end
100
96
 
101
97
  def annex1_default(elem)
@@ -216,6 +212,13 @@ module IsoDoc
216
212
  dest.children.first.next = source
217
213
  end
218
214
 
215
+ def example1(elem)
216
+ super
217
+ n = elem.at(ns("./name")) or return
218
+ n << l10n(":")
219
+ n.children.wrap("<em></em>")
220
+ end
221
+
219
222
  include Init
220
223
  end
221
224
  end
@@ -153,9 +153,9 @@ module IsoDoc
153
153
  def feedback_style1(div, idx)
154
154
  div.xpath(".//p").each_with_index do |p, j|
155
155
  p["class"] = idx == 4 ? "IEEEStdsCRTextItal" : "IEEEStdsCRTextReg"
156
- j.zero? && idx.zero? and
157
- p.children.first.previous =
158
- '<a style="mso-footnote-id:ftn0" href="#_ftnref0" name="_ftn0" title=""/>'
156
+ j.zero? && idx.zero? and p.add_first_child <<~XML
157
+ <a style="mso-footnote-id:ftn0" href="#_ftnref0" name="_ftn0" title=""/>
158
+ XML
159
159
  end
160
160
  end
161
161
 
@@ -203,9 +203,9 @@ module IsoDoc
203
203
  end
204
204
 
205
205
  def abstract_header(dest)
206
- dest.elements.first.children.first.previous =
207
- "<span class='IEEEStdsAbstractHeader'><span lang='EN-US'>" \
208
- "Abstract:</span></span> "
206
+ dest.elements.first.add_first_child <<~XML
207
+ <span class='IEEEStdsAbstractHeader'><span lang='EN-US'>Abstract:</span></span>
208
+ XML
209
209
  end
210
210
 
211
211
  def introduction_cleanup(docxml)
@@ -99,7 +99,6 @@ module IsoDoc
99
99
 
100
100
  def example_caption(docxml)
101
101
  docxml.xpath("//p[@class = 'example-title']").each do |s|
102
- s.children = "<em>#{to_xml(s.children)}</em>"
103
102
  s["class"] = stylesmap[:MsoNormal]
104
103
  end
105
104
  end
@@ -191,7 +191,6 @@ module IsoDoc
191
191
  def termnote_label(para, name)
192
192
  para.span class: "note_label" do |s|
193
193
  name.children.each { |n| parse(n, s) }
194
- s << termnote_delim
195
194
  end
196
195
  end
197
196
 
@@ -100,7 +100,6 @@ module IsoDoc
100
100
  out.div **figure_attrs(node) do |div|
101
101
  figure_name_parse(node, div, node.at(ns("./name")))
102
102
  node.children.each do |n|
103
- figure_key(out) if n.name == "dl"
104
103
  parse(n, div) unless n.name == "name"
105
104
  end
106
105
  end
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.3.4 -->
20
+ <!-- VERSION v1.4.0 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ieee
3
- VERSION = "1.3.2".freeze
3
+ VERSION = "1.3.4".freeze
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
27
27
 
28
- spec.add_dependency "metanorma-standoc", "~> 2.9.6"
28
+ spec.add_dependency "metanorma-standoc", "~> 2.10.0"
29
29
  spec.add_dependency "mnconvert", "~> 1.20"
30
30
  spec.add_dependency "pubid"
31
31
 
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.3.2
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.9.6
19
+ version: 2.10.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.9.6
26
+ version: 2.10.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mnconvert
29
29
  requirement: !ruby/object:Gem::Requirement