metanorma-bipm 2.6.8 → 2.6.9

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.
@@ -2,17 +2,18 @@ module IsoDoc
2
2
  module Bipm
3
3
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
4
4
  def doccontrol(doc)
5
- return unless doc.at(ns("//bibdata/relation[@type = 'supersedes']"))
6
-
5
+ doc.at(ns("//bibdata/relation[@type = 'supersedes']")) or return
7
6
  clause = <<~DOCCONTROL
8
- <doccontrol displayorder="999">
9
- <fmt-title>Document Control</fmt-title>
10
- <table unnumbered="true"><tbody>
11
- <tr><th>Authors:</th><td/><td>#{list_authors(doc)}</td></tr>
7
+ <clause class="doccontrol" #{add_id_text}>
8
+ <fmt-title #{add_id_text}>Document Control</fmt-title>
9
+ <table #{add_id_text} unnumbered="true"><tbody>
10
+ <tr #{add_id_text}><th #{add_id_text}>Authors:</th><td #{add_id_text}/><td #{add_id_text}>#{list_authors(doc)}</td></tr>
12
11
  #{doccontrol_row1(doc)} #{doccontrol_row2(doc)} #{list_drafts(doc)}
13
- </tbody></table></doccontrol>
12
+ </tbody></table></clause>
14
13
  DOCCONTROL
15
- doc.root << clause
14
+ ins = doc.root.at(ns("./colophon")) ||
15
+ doc.root.add_child("<colophon/>").first
16
+ ins << clause
16
17
  end
17
18
 
18
19
  def doccontrol_row1(doc)
@@ -20,8 +21,8 @@ module IsoDoc
20
21
  1) == ["", ""] && list_cochairs(doc).empty?
21
22
 
22
23
  <<~ROW
23
- <tr>#{list_draft(doc, 1)&.map { |x| "<td>#{x}</td>" }&.join}
24
- <td>#{list_cochairs(doc)}</td></tr>
24
+ <tr #{add_id_text}>#{list_draft(doc, 1)&.map { |x| "<td #{add_id_text}>#{x}</td>" }&.join}
25
+ <td #{add_id_text}>#{list_cochairs(doc)}</td></tr>
25
26
  ROW
26
27
  end
27
28
 
@@ -30,8 +31,8 @@ module IsoDoc
30
31
  return ""
31
32
 
32
33
  <<~ROW
33
- <tr>#{list_draft(docxml, 2)&.map { |x| "<td>#{x}</td>" }&.join}
34
- <td>#{list_chairs(docxml)}</td></tr>
34
+ <tr #{add_id_text}>#{list_draft(docxml, 2)&.map { |x| "<td>#{x}</td>" }&.join}
35
+ <td #{add_id_text}>#{list_chairs(docxml)}</td></tr>
35
36
  ROW
36
37
  end
37
38
 
@@ -39,9 +40,9 @@ module IsoDoc
39
40
  ret = ""
40
41
  i = 3
41
42
  while list_draft(xml, i) != ["", ""]
42
- ret += "<tr>#{list_draft(xml, i).map do |x|
43
- "<td>#{x}</td>"
44
- end.join} " \
43
+ ret += "<tr #{add_id_text}>#{list_draft(xml, i).map do |x|
44
+ "<td #{add_id_text}>#{x}</td>"
45
+ end.join} " \
45
46
  "<td/></tr>"
46
47
  i += 1
47
48
  end
@@ -51,10 +52,9 @@ module IsoDoc
51
52
  def list_draft(xml, idx)
52
53
  d = xml.at(ns("//bibdata/relation[@type = 'supersedes'][#{idx}]" \
53
54
  "/bibitem")) or return ["", ""]
54
-
55
- draft = d&.at(ns("./version/draft"))&.text and draft = "Draft #{draft}"
56
- edn = d&.at(ns("./edition"))&.text and edn = "Version #{edn}"
57
- [[draft, edn].join(" "), d&.at(ns("./date"))&.text]
55
+ draft = d.at(ns("./version/draft"))&.text and draft = "Draft #{draft}"
56
+ edn = d.at(ns("./edition"))&.text and edn = "Version #{edn}"
57
+ [[draft, edn].join(" "), d.at(ns("./date"))&.text]
58
58
  end
59
59
 
60
60
  def list_authors(xml)
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require "metanorma-generic"
3
3
  require "metanorma-iso"
4
4
  require_relative "init"
5
- require_relative "doccontrol"
5
+ require_relative "presentation_doccontrol"
6
6
  require_relative "../../relaton/render/general"
7
7
  require_relative "presentation_blocks"
8
8
  require_relative "presentation_biblio"
@@ -39,7 +39,7 @@ module IsoDoc
39
39
  end
40
40
 
41
41
  def clause(docxml)
42
- quotedtitles(docxml)
42
+ # quotedtitles(docxml)
43
43
  super
44
44
  @jcgm and
45
45
  docxml.xpath(ns("//preface/introduction[clause]")).each do |f|
@@ -54,16 +54,26 @@ module IsoDoc
54
54
  end
55
55
 
56
56
  def prefix_name(node, delims, number, elem)
57
- if n = node.at(ns("./#{elem}[@type = 'quoted']"))
58
- n1 = n.dup
59
- n1.name = "fmt-#{elem}"
60
- n.next = n1
61
- prefix_name_postprocess(node, elem)
57
+ if elem == "title" &&
58
+ n = node.at(ns("./variant-#{elem}[@type = 'quoted']"))
59
+ quoted_title_render(node, elem, n)
62
60
  else
63
61
  super
64
62
  end
65
63
  end
66
64
 
65
+ def quoted_title_render(node, elem, variant_title)
66
+ add_id(variant_title)
67
+ variant_title.next =
68
+ fmt_caption("&#x2580;", elem, variant_title, {}, {})
69
+ if s = variant_title.next.at(ns("./semx[@element='title']"))
70
+ s["source"] = variant_title["id"]
71
+ end
72
+ # to prevent it rendering, as Semantic XML element
73
+ variant_title.name = "title"
74
+ prefix_name_postprocess(node, elem)
75
+ end
76
+
67
77
  def conversions(docxml)
68
78
  doccontrol docxml
69
79
  super
@@ -133,10 +143,11 @@ module IsoDoc
133
143
  node.next = "]"
134
144
  end
135
145
 
146
+ # KILL
136
147
  def quotedtitles(docxml)
137
148
  docxml.xpath(ns("//variant-title[@type = 'quoted']")).each do |t|
138
149
  t.name = "title"
139
- t.children.first.previous = "<blacksquare/>"
150
+ t.children.first.previous = "&#x2580;"
140
151
  end
141
152
  end
142
153
 
@@ -146,7 +157,8 @@ module IsoDoc
146
157
 
147
158
  def index1(docxml, indexsect, index)
148
159
  index.keys.sort.each do |k|
149
- c = indexsect.add_child "<clause #{add_id}><title>#{k}</title><ul></ul></clause>"
160
+ c = indexsect
161
+ .add_child "<clause #{add_id_text}><title #{add_id_text}>#{k}</title><ul></ul></clause>"
150
162
  words = index[k].keys.each_with_object({}) do |w, v|
151
163
  v[sortable(w).downcase] = w
152
164
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Bipm
3
- VERSION = "2.6.8".freeze
3
+ VERSION = "2.6.9".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.8
4
+ version: 2.6.9
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-05-26 00:00:00.000000000 Z
11
+ date: 2025-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -257,7 +257,6 @@ files:
257
257
  - lib/isodoc/bipm/bipm.guide.xsl
258
258
  - lib/isodoc/bipm/bipm.mise-en-pratique.xsl
259
259
  - lib/isodoc/bipm/bipm.rapport.xsl
260
- - lib/isodoc/bipm/doccontrol.rb
261
260
  - lib/isodoc/bipm/html/html_bipm_intro.html
262
261
  - lib/isodoc/bipm/html/html_bipm_titlepage.html
263
262
  - lib/isodoc/bipm/html/htmlstyle.css
@@ -286,6 +285,7 @@ files:
286
285
  - lib/isodoc/bipm/pdf_convert.rb
287
286
  - lib/isodoc/bipm/presentation_biblio.rb
288
287
  - lib/isodoc/bipm/presentation_blocks.rb
288
+ - lib/isodoc/bipm/presentation_doccontrol.rb
289
289
  - lib/isodoc/bipm/presentation_footnotes.rb
290
290
  - lib/isodoc/bipm/presentation_xml_convert.rb
291
291
  - lib/isodoc/bipm/xref.rb