metanorma-bipm 1.1.9 → 1.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/bipm/isodoc.rng +9 -0
- data/lib/isodoc/bipm/base_convert.rb +12 -1
- data/lib/isodoc/bipm/bipm.brochure.xsl +273 -39
- data/lib/isodoc/bipm/bipm.guide.xsl +273 -39
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +273 -39
- data/lib/isodoc/bipm/bipm.rapport.xsl +273 -39
- data/lib/isodoc/bipm/html_convert.rb +4 -5
- data/lib/isodoc/bipm/jcgm.standard.xsl +154 -8
- data/lib/isodoc/bipm/presentation_xml_convert.rb +31 -16
- data/lib/isodoc/bipm/xref.rb +10 -9
- data/lib/metanorma/bipm/version.rb +1 -1
- metadata +2 -2
@@ -2581,13 +2581,20 @@
|
|
2581
2581
|
|
2582
2582
|
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
2583
2583
|
|
2584
|
-
</xsl:attribute-set><xsl:
|
2584
|
+
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
2585
|
+
<xsl:attribute name="line-height">135%</xsl:attribute>
|
2586
|
+
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
|
2585
2587
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
2586
2588
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
2587
2589
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
2588
2590
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
|
2589
2591
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
|
2590
|
-
</xsl:template><xsl:template name="
|
2592
|
+
</xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
|
2593
|
+
<xsl:for-each select="/*/*[local-name()='preface']/*">
|
2594
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2595
|
+
<xsl:apply-templates select="." mode="contents"/>
|
2596
|
+
</xsl:for-each>
|
2597
|
+
</xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
|
2591
2598
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
2592
2599
|
|
2593
2600
|
<!-- Normative references -->
|
@@ -2600,13 +2607,33 @@
|
|
2600
2607
|
<!-- Bibliography -->
|
2601
2608
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
2602
2609
|
|
2603
|
-
</xsl:template><xsl:template name="
|
2610
|
+
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
2611
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
2612
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2613
|
+
<xsl:apply-templates select="." mode="contents"/>
|
2614
|
+
</xsl:for-each>
|
2615
|
+
|
2616
|
+
<xsl:for-each select="/*/*[local-name()='annex']">
|
2617
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2618
|
+
<xsl:apply-templates select="." mode="contents"/>
|
2619
|
+
</xsl:for-each>
|
2620
|
+
|
2621
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
2622
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2623
|
+
<xsl:apply-templates select="." mode="contents"/>
|
2624
|
+
</xsl:for-each>
|
2625
|
+
</xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
|
2604
2626
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
2605
2627
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
2606
2628
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
|
2607
2629
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
|
2608
2630
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
|
2609
|
-
</xsl:template><xsl:template name="
|
2631
|
+
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
2632
|
+
<xsl:for-each select="/*/*[local-name()='preface']/*">
|
2633
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2634
|
+
<xsl:apply-templates select="."/>
|
2635
|
+
</xsl:for-each>
|
2636
|
+
</xsl:template><xsl:template name="OLD_processMainSectionsDefault">
|
2610
2637
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
|
2611
2638
|
|
2612
2639
|
<!-- Normative references -->
|
@@ -2618,6 +2645,22 @@
|
|
2618
2645
|
<xsl:apply-templates select="/*/*[local-name()='annex']"/>
|
2619
2646
|
<!-- Bibliography -->
|
2620
2647
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
|
2648
|
+
</xsl:template><xsl:template name="processMainSectionsDefault">
|
2649
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
2650
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2651
|
+
<xsl:apply-templates select="."/>
|
2652
|
+
|
2653
|
+
</xsl:for-each>
|
2654
|
+
|
2655
|
+
<xsl:for-each select="/*/*[local-name()='annex']">
|
2656
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2657
|
+
<xsl:apply-templates select="."/>
|
2658
|
+
</xsl:for-each>
|
2659
|
+
|
2660
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
2661
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2662
|
+
<xsl:apply-templates select="."/>
|
2663
|
+
</xsl:for-each>
|
2621
2664
|
</xsl:template><xsl:template match="text()">
|
2622
2665
|
<xsl:value-of select="."/>
|
2623
2666
|
</xsl:template><xsl:template match="*[local-name()='br']">
|
@@ -5248,6 +5291,13 @@
|
|
5248
5291
|
</xsl:attribute>
|
5249
5292
|
<xsl:apply-templates mode="svg_update"/>
|
5250
5293
|
</xsl:copy>
|
5294
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
|
5295
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
5296
|
+
<xsl:for-each select="*[local-name() = 'svg']">
|
5297
|
+
<xsl:call-template name="image_svg">
|
5298
|
+
<xsl:with-param name="name" select="$name"/>
|
5299
|
+
</xsl:call-template>
|
5300
|
+
</xsl:for-each>
|
5251
5301
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
5252
5302
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
5253
5303
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -5352,7 +5402,7 @@
|
|
5352
5402
|
</fo:basic-link>
|
5353
5403
|
</fo:block>
|
5354
5404
|
</fo:block-container>
|
5355
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
5405
|
+
</xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
5356
5406
|
<xsl:apply-templates mode="contents"/>
|
5357
5407
|
<xsl:text> </xsl:text>
|
5358
5408
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
@@ -6037,20 +6087,22 @@
|
|
6037
6087
|
</xsl:if>
|
6038
6088
|
</xsl:template><xsl:variable name="localized.source">
|
6039
6089
|
<xsl:call-template name="getLocalizedString">
|
6040
|
-
|
6041
|
-
|
6090
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
6091
|
+
</xsl:call-template>
|
6042
6092
|
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
6043
6093
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
6044
6094
|
<xsl:if test="normalize-space(@citeas) = ''">
|
6045
6095
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
6046
6096
|
</xsl:if>
|
6047
6097
|
|
6098
|
+
|
6048
6099
|
<fo:inline>
|
6049
6100
|
|
6050
6101
|
|
6051
6102
|
|
6052
6103
|
|
6053
6104
|
|
6105
|
+
|
6054
6106
|
<xsl:value-of select="$localized.source"/>
|
6055
6107
|
<xsl:text> </xsl:text>
|
6056
6108
|
|
@@ -6061,6 +6113,7 @@
|
|
6061
6113
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
6062
6114
|
<xsl:apply-templates/>
|
6063
6115
|
</fo:inline>
|
6116
|
+
|
6064
6117
|
</fo:basic-link>
|
6065
6118
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
6066
6119
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
@@ -6137,6 +6190,9 @@
|
|
6137
6190
|
|
6138
6191
|
</xsl:if>
|
6139
6192
|
|
6193
|
+
<xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
|
6194
|
+
<xsl:variable name="text" select="normalize-space()"/>
|
6195
|
+
|
6140
6196
|
|
6141
6197
|
|
6142
6198
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
@@ -6149,7 +6205,9 @@
|
|
6149
6205
|
|
6150
6206
|
|
6151
6207
|
</xsl:if>
|
6152
|
-
|
6208
|
+
|
6209
|
+
|
6210
|
+
|
6153
6211
|
<xsl:apply-templates/>
|
6154
6212
|
</fo:basic-link>
|
6155
6213
|
|
@@ -6660,9 +6718,97 @@
|
|
6660
6718
|
<fo:block-container border="1pt solid black" width="50%">
|
6661
6719
|
<fo:block> </fo:block>
|
6662
6720
|
</fo:block-container>
|
6721
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']">
|
6722
|
+
<xsl:param name="colwidths"/>
|
6723
|
+
<xsl:variable name="colwidths_">
|
6724
|
+
<xsl:choose>
|
6725
|
+
<xsl:when test="not($colwidths)">
|
6726
|
+
<xsl:variable name="toc_table_simple">
|
6727
|
+
<tbody>
|
6728
|
+
<xsl:apply-templates mode="toc_table_width"/>
|
6729
|
+
</tbody>
|
6730
|
+
</xsl:variable>
|
6731
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
|
6732
|
+
<xsl:call-template name="calculate-column-widths">
|
6733
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
6734
|
+
<xsl:with-param name="table" select="$toc_table_simple"/>
|
6735
|
+
</xsl:call-template>
|
6736
|
+
</xsl:when>
|
6737
|
+
<xsl:otherwise>
|
6738
|
+
<xsl:copy-of select="$colwidths"/>
|
6739
|
+
</xsl:otherwise>
|
6740
|
+
</xsl:choose>
|
6741
|
+
</xsl:variable>
|
6742
|
+
<fo:block role="TOCI" space-after="16pt">
|
6743
|
+
<fo:table width="100%" table-layout="fixed">
|
6744
|
+
<xsl:for-each select="xalan:nodeset($colwidths_)/column">
|
6745
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
6746
|
+
</xsl:for-each>
|
6747
|
+
<fo:table-body>
|
6748
|
+
<xsl:apply-templates/>
|
6749
|
+
</fo:table-body>
|
6750
|
+
</fo:table>
|
6751
|
+
</fo:block>
|
6752
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
|
6753
|
+
<fo:table-row min-height="5mm">
|
6754
|
+
<xsl:apply-templates/>
|
6755
|
+
</fo:table-row>
|
6756
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
|
6757
|
+
<xsl:apply-templates/>
|
6758
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
|
6759
|
+
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
6760
|
+
<xsl:variable name="target" select="@target"/>
|
6761
|
+
<xsl:for-each select="*[local-name() = 'tab']">
|
6762
|
+
<xsl:variable name="current_id" select="generate-id()"/>
|
6763
|
+
<fo:table-cell>
|
6764
|
+
<fo:block>
|
6765
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
6766
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
6767
|
+
<xsl:choose>
|
6768
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
6769
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
6770
|
+
</xsl:choose>
|
6771
|
+
</xsl:for-each>
|
6772
|
+
</fo:basic-link>
|
6773
|
+
</fo:block>
|
6774
|
+
</fo:table-cell>
|
6775
|
+
</xsl:for-each>
|
6776
|
+
<!-- last column - for page numbers -->
|
6777
|
+
<fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
|
6778
|
+
<fo:block>
|
6779
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
6780
|
+
<fo:page-number-citation ref-id="{$target}"/>
|
6781
|
+
</fo:basic-link>
|
6782
|
+
</fo:block>
|
6783
|
+
</fo:table-cell>
|
6784
|
+
</xsl:template><xsl:template match="*" mode="toc_table_width">
|
6785
|
+
<xsl:apply-templates mode="toc_table_width"/>
|
6786
|
+
</xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
|
6787
|
+
<tr>
|
6788
|
+
<xsl:apply-templates mode="toc_table_width"/>
|
6789
|
+
</tr>
|
6790
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
|
6791
|
+
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
6792
|
+
<xsl:for-each select="*[local-name() = 'tab']">
|
6793
|
+
<xsl:variable name="current_id" select="generate-id()"/>
|
6794
|
+
<td>
|
6795
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
6796
|
+
<xsl:copy-of select="."/>
|
6797
|
+
</xsl:for-each>
|
6798
|
+
</td>
|
6799
|
+
</xsl:for-each>
|
6800
|
+
<td>333</td> <!-- page number, just for fill -->
|
6663
6801
|
</xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
6664
6802
|
<fo:inline padding-right="5mm"> </fo:inline>
|
6665
6803
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
6804
|
+
</xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
|
6805
|
+
<fo:inline padding-right="2.5mm" baseline-shift="5%">
|
6806
|
+
<fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
|
6807
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
|
6808
|
+
<rect x="0" y="0" width="2" height="2" fill="black"/>
|
6809
|
+
</svg>
|
6810
|
+
</fo:instream-foreign-object>
|
6811
|
+
</fo:inline>
|
6666
6812
|
</xsl:template><xsl:template name="convertDate">
|
6667
6813
|
<xsl:param name="date"/>
|
6668
6814
|
<xsl:param name="format" select="'short'"/>
|
@@ -18,16 +18,13 @@ module IsoDoc
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def eref_localities1(target, type, from, to, delim, n, lang = "en")
|
21
|
-
|
22
|
-
@iso.eref_localities1(target, type, from, to, delim, n, lang)
|
23
|
-
|
24
|
-
super
|
25
|
-
end
|
21
|
+
@jcgm and
|
22
|
+
return @iso.eref_localities1(target, type, from, to, delim, n, lang)
|
23
|
+
super
|
26
24
|
end
|
27
25
|
|
28
26
|
def table1(elem)
|
29
|
-
return if labelled_ancestor(elem)
|
30
|
-
return if elem["unnumbered"]
|
27
|
+
return if labelled_ancestor(elem) || elem["unnumbered"]
|
31
28
|
|
32
29
|
n = @xrefs.anchor(elem["id"], :label, false)
|
33
30
|
prefix_name(elem, ".<tab/>",
|
@@ -47,19 +44,18 @@ module IsoDoc
|
|
47
44
|
return if elem["unnumbered"] == "true"
|
48
45
|
|
49
46
|
lbl = @xrefs.anchor(elem["id"], :label)
|
50
|
-
|
47
|
+
t = elem.at(ns("./title")) and
|
51
48
|
t.children = "<strong>#{t.children.to_xml}</strong>"
|
52
|
-
end
|
53
49
|
prefix_name(elem, ".<tab/>", lbl, "title")
|
54
50
|
end
|
55
51
|
|
56
52
|
def clause(docxml)
|
53
|
+
quotedtitles(docxml)
|
57
54
|
super
|
58
|
-
|
55
|
+
@jcgm and
|
59
56
|
docxml.xpath(ns("//preface/introduction[clause]")).each do |f|
|
60
57
|
clause1(f)
|
61
58
|
end
|
62
|
-
end
|
63
59
|
end
|
64
60
|
|
65
61
|
def clause1(elem)
|
@@ -69,6 +65,21 @@ module IsoDoc
|
|
69
65
|
super
|
70
66
|
end
|
71
67
|
|
68
|
+
def prefix_name(node, delim, number, elem)
|
69
|
+
return if number.nil? || number.empty?
|
70
|
+
|
71
|
+
unless name = node.at(ns("./#{elem}[not(@type = 'quoted')]"))
|
72
|
+
return if node.at(ns("./#{elem}[@type = 'quoted']"))
|
73
|
+
|
74
|
+
node.children.empty? and node.add_child("<#{elem}></#{elem}>") or
|
75
|
+
node.children.first.previous = "<#{elem}></#{elem}>"
|
76
|
+
name = node.children.first
|
77
|
+
end
|
78
|
+
if name.children.empty? then name.add_child(number)
|
79
|
+
else (name.children.first.previous = "#{number}#{delim}")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
72
83
|
def conversions(docxml)
|
73
84
|
super
|
74
85
|
doccontrol docxml
|
@@ -168,8 +179,7 @@ module IsoDoc
|
|
168
179
|
end
|
169
180
|
|
170
181
|
def twitter_cldr_localiser_symbols
|
171
|
-
{ group: " ", fraction_group: " ",
|
172
|
-
fraction_group_digits: 3 }
|
182
|
+
{ group: " ", fraction_group: " ", fraction_group_digits: 3 }
|
173
183
|
end
|
174
184
|
|
175
185
|
def mathml1(elem, locale)
|
@@ -210,9 +220,7 @@ module IsoDoc
|
|
210
220
|
def jcgm_eref(docxml, xpath)
|
211
221
|
return unless @jcgm
|
212
222
|
|
213
|
-
docxml.xpath(ns(xpath)).each
|
214
|
-
extract_brackets(x)
|
215
|
-
end
|
223
|
+
docxml.xpath(ns(xpath)).each { |x| extract_brackets(x) }
|
216
224
|
# merge adjacent text nodes
|
217
225
|
docxml.root.replace(Nokogiri::XML(docxml.root.to_xml).root)
|
218
226
|
docxml.xpath(ns(xpath)).each do |x| # rubocop: disable Style/CombinableLoops
|
@@ -235,6 +243,13 @@ module IsoDoc
|
|
235
243
|
end
|
236
244
|
end
|
237
245
|
|
246
|
+
def quotedtitles(docxml)
|
247
|
+
docxml.xpath(ns("//variant-title[@type = 'quoted']")).each do |t|
|
248
|
+
t.name = "title"
|
249
|
+
t.children.first.previous = "<blacksquare/>"
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
238
253
|
include Init
|
239
254
|
end
|
240
255
|
end
|
data/lib/isodoc/bipm/xref.rb
CHANGED
@@ -61,16 +61,16 @@ module IsoDoc
|
|
61
61
|
end
|
62
62
|
|
63
63
|
NUMBERED_SUBCLAUSES = "./clause[not(@unnumbered = 'true')] | "\
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
"./references[not(@unnumbered = 'true')] | "\
|
65
|
+
"./term[not(@unnumbered = 'true')] | "\
|
66
|
+
"./terms[not(@unnumbered = 'true')] | "\
|
67
|
+
"./definitions[not(@unnumbered = 'true')]".freeze
|
68
68
|
|
69
69
|
UNNUMBERED_SUBCLAUSES = "./clause[@unnumbered = 'true'] | "\
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
70
|
+
"./references[@unnumbered = 'true'] | "\
|
71
|
+
"./term[@unnumbered = 'true'] | "\
|
72
|
+
"./terms[@unnumbered = 'true'] | "\
|
73
|
+
"./definitions[@unnumbered = 'true']".freeze
|
74
74
|
|
75
75
|
def section_name_anchors(clause, num, lvl)
|
76
76
|
lbl = @jcgm ? "clause_jcgm" : "clause"
|
@@ -157,9 +157,10 @@ module IsoDoc
|
|
157
157
|
annex_names1(a, num.to_s, 1)
|
158
158
|
else
|
159
159
|
i = Counter.new
|
160
|
+
prefix = @jcgm ? "" : "A"
|
160
161
|
clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
|
161
162
|
i.increment(c)
|
162
|
-
annex_names1(c, "#{num}.#{i.print}", 2)
|
163
|
+
annex_names1(c, "#{prefix}#{num}.#{i.print}", 2)
|
163
164
|
end
|
164
165
|
clause.xpath(ns(UNNUMBERED_SUBCLAUSES))
|
165
166
|
.each { |c| unnumbered_annex_names1(c, 2) }
|
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: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|