metanorma-bipm 2.6.7 → 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.
- checksums.yaml +4 -4
- data/lib/isodoc/bipm/base_convert.rb +14 -12
- data/lib/isodoc/bipm/bipm.brochure.xsl +818 -1322
- data/lib/isodoc/bipm/bipm.guide.xsl +818 -1322
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +818 -1322
- data/lib/isodoc/bipm/bipm.rapport.xsl +818 -1322
- data/lib/isodoc/bipm/html/htmlstyle.css +0 -2
- data/lib/isodoc/bipm/html_convert.rb +8 -8
- data/lib/isodoc/bipm/jcgm.standard.xsl +754 -1290
- data/lib/isodoc/bipm/{doccontrol.rb → presentation_doccontrol.rb} +19 -19
- data/lib/isodoc/bipm/presentation_xml_convert.rb +21 -9
- data/lib/metanorma/bipm/isodoc.rng +14 -1
- data/lib/metanorma/bipm/version.rb +1 -1
- metadata +3 -3
@@ -2,17 +2,18 @@ module IsoDoc
|
|
2
2
|
module Bipm
|
3
3
|
class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
|
4
4
|
def doccontrol(doc)
|
5
|
-
|
6
|
-
|
5
|
+
doc.at(ns("//bibdata/relation[@type = 'supersedes']")) or return
|
7
6
|
clause = <<~DOCCONTROL
|
8
|
-
<
|
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></
|
12
|
+
</tbody></table></clause>
|
14
13
|
DOCCONTROL
|
15
|
-
doc.root
|
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
|
-
|
44
|
-
|
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
|
-
|
56
|
-
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 "
|
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
|
58
|
-
|
59
|
-
|
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("▀", 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 = "
|
150
|
+
t.children.first.previous = "▀"
|
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
|
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,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<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">
|
3
|
-
<!-- VERSION v2.0.
|
3
|
+
<!-- VERSION v2.0.6 -->
|
4
4
|
|
5
5
|
<!--
|
6
6
|
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
@@ -801,6 +801,12 @@ titlecase, or lowercase</a:documentation>
|
|
801
801
|
<a:documentation>User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
|
802
802
|
</attribute>
|
803
803
|
</optional>
|
804
|
+
<optional>
|
805
|
+
<attribute name="source">
|
806
|
+
<a:documentation>Sourcing of the current element in an external data model</a:documentation>
|
807
|
+
<ref name="IdRefType"/>
|
808
|
+
</attribute>
|
809
|
+
</optional>
|
804
810
|
</define>
|
805
811
|
<define name="OptionalId" combine="interleave">
|
806
812
|
<optional>
|
@@ -808,6 +814,12 @@ titlecase, or lowercase</a:documentation>
|
|
808
814
|
<a:documentation> User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
|
809
815
|
</attribute>
|
810
816
|
</optional>
|
817
|
+
<optional>
|
818
|
+
<attribute name="source">
|
819
|
+
<a:documentation>Sourcing of the current element in an external data model</a:documentation>
|
820
|
+
<ref name="IdRefType"/>
|
821
|
+
</attribute>
|
822
|
+
</optional>
|
811
823
|
</define>
|
812
824
|
<define name="ObligationType">
|
813
825
|
<a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
|
@@ -954,6 +966,7 @@ titlecase, or lowercase</a:documentation>
|
|
954
966
|
is used in particular to capture mutually agreed definitions of codepoints in Unicode Private Use Area</a:documentation>
|
955
967
|
</attribute>
|
956
968
|
</optional>
|
969
|
+
<ref name="OptionalId"/>
|
957
970
|
<oneOrMore>
|
958
971
|
<ref name="TextElement">
|
959
972
|
<a:documentation>Textual content of span</a:documentation>
|
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.
|
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-
|
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
|