metanorma-bipm 2.3.0 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/lib/isodoc/bipm/base_convert.rb +1 -2
- data/lib/isodoc/bipm/bipm.brochure.xsl +37 -18
- data/lib/isodoc/bipm/bipm.guide.xsl +37 -18
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +37 -18
- data/lib/isodoc/bipm/bipm.rapport.xsl +37 -18
- data/lib/isodoc/bipm/init.rb +5 -2
- data/lib/isodoc/bipm/jcgm.standard.xsl +34 -15
- data/lib/isodoc/bipm/pdf_convert.rb +1 -1
- data/lib/isodoc/bipm/xref.rb +50 -54
- data/lib/metanorma/bipm/isodoc.rng +4 -1
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74d22bd2ec25abd1d2e9ea90f2dd72a86780f17bcaf2e653a3cea2582c1ef27c
|
4
|
+
data.tar.gz: 58a3bdc9eaabfd10993dbac2a318a1034d2457233d5bfe1c426f5d8cd13b69bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a2858e02d293335de27882979c1b158b66f79be55497ba2b7ec5b5a268c43144df07048aac00fc5815477c5292f43cd3071f3b4e05b84480a189f3a23e6ba05
|
7
|
+
data.tar.gz: db8fd283bdebfcc0273ba4009545713a140fb4639018f4e839bd27eaede78b7ed0219ff22eec9fcc1a5c254951542ee487eda6ab497ea4e8fb71a5a48ad0be88
|
data/.gitignore
CHANGED
@@ -36,8 +36,7 @@ module IsoDoc
|
|
36
36
|
|
37
37
|
def implicit_reference(bib)
|
38
38
|
b = bib.at(ns("./docidentifier[@primary = 'true'][@type = 'BIPM']"))
|
39
|
-
doctype
|
40
|
-
return true if doctype == "brochure" && /^(CGPM|CIPM|CCDS|CCTF)[ ]
|
39
|
+
return true if @doctype == "brochure" && /^(CGPM|CIPM|CCDS|CCTF)[ ]
|
41
40
|
(Resolution|Recommendation|Declaration|Decision|Recommendation|Meeting)/x
|
42
41
|
.match?(b&.text)
|
43
42
|
|
@@ -4188,11 +4188,26 @@
|
|
4188
4188
|
<xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
|
4189
4189
|
</xsl:if>
|
4190
4190
|
|
4191
|
-
<xsl:
|
4191
|
+
<xsl:variable name="font_family" select="."/>
|
4192
4192
|
|
4193
|
-
<xsl:
|
4194
|
-
<xsl:
|
4195
|
-
|
4193
|
+
<xsl:choose>
|
4194
|
+
<xsl:when test="$additional_fonts = ''">
|
4195
|
+
<xsl:value-of select="$font_family"/>
|
4196
|
+
</xsl:when>
|
4197
|
+
<xsl:otherwise> <!-- $additional_fonts != '' -->
|
4198
|
+
<xsl:choose>
|
4199
|
+
<xsl:when test="contains($font_family, ',')">
|
4200
|
+
<xsl:value-of select="substring-before($font_family, ',')"/>
|
4201
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4202
|
+
<xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
|
4203
|
+
</xsl:when>
|
4204
|
+
<xsl:otherwise>
|
4205
|
+
<xsl:value-of select="$font_family"/>
|
4206
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4207
|
+
</xsl:otherwise>
|
4208
|
+
</xsl:choose>
|
4209
|
+
</xsl:otherwise>
|
4210
|
+
</xsl:choose>
|
4196
4211
|
</xsl:attribute>
|
4197
4212
|
</xsl:when>
|
4198
4213
|
<xsl:otherwise>
|
@@ -6786,25 +6801,25 @@
|
|
6786
6801
|
|
6787
6802
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
|
6788
6803
|
|
6789
|
-
|
6804
|
+
<fo:block xsl:use-attribute-sets="table-note-style">
|
6790
6805
|
|
6791
|
-
|
6806
|
+
<xsl:call-template name="refine_table-note-style"/>
|
6792
6807
|
|
6793
|
-
|
6794
|
-
|
6808
|
+
<!-- Table's note/example name (NOTE, for example) -->
|
6809
|
+
<fo:inline xsl:use-attribute-sets="table-note-name-style">
|
6795
6810
|
|
6796
|
-
|
6811
|
+
<xsl:call-template name="refine_table-note-name-style"/>
|
6797
6812
|
|
6798
|
-
|
6813
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
6799
6814
|
|
6800
|
-
|
6815
|
+
</fo:inline>
|
6801
6816
|
|
6802
|
-
|
6803
|
-
|
6804
|
-
|
6817
|
+
<xsl:if test="ancestor::bipm:preface">
|
6818
|
+
<fo:block> </fo:block>
|
6819
|
+
</xsl:if>
|
6805
6820
|
|
6806
|
-
|
6807
|
-
|
6821
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6822
|
+
</fo:block>
|
6808
6823
|
|
6809
6824
|
</xsl:template> <!-- table/note -->
|
6810
6825
|
|
@@ -9982,8 +9997,12 @@
|
|
9982
9997
|
<xsl:variable name="isAdded" select="../@added"/>
|
9983
9998
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
9984
9999
|
<xsl:choose>
|
9985
|
-
<xsl:when test="ancestor::*[local-name() = 'title']">
|
10000
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
9986
10001
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
10002
|
+
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
10003
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
10004
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
10005
|
+
</xsl:if>
|
9987
10006
|
<xsl:variable name="src">
|
9988
10007
|
<xsl:call-template name="image_src"/>
|
9989
10008
|
</xsl:variable>
|
@@ -10016,7 +10035,7 @@
|
|
10016
10035
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
10017
10036
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
10018
10037
|
|
10019
|
-
<xsl:if test="@width != '' and @width != 'auto'">
|
10038
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
10020
10039
|
<xsl:attribute name="width">
|
10021
10040
|
<xsl:value-of select="@width"/>
|
10022
10041
|
</xsl:attribute>
|
@@ -4188,11 +4188,26 @@
|
|
4188
4188
|
<xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
|
4189
4189
|
</xsl:if>
|
4190
4190
|
|
4191
|
-
<xsl:
|
4191
|
+
<xsl:variable name="font_family" select="."/>
|
4192
4192
|
|
4193
|
-
<xsl:
|
4194
|
-
<xsl:
|
4195
|
-
|
4193
|
+
<xsl:choose>
|
4194
|
+
<xsl:when test="$additional_fonts = ''">
|
4195
|
+
<xsl:value-of select="$font_family"/>
|
4196
|
+
</xsl:when>
|
4197
|
+
<xsl:otherwise> <!-- $additional_fonts != '' -->
|
4198
|
+
<xsl:choose>
|
4199
|
+
<xsl:when test="contains($font_family, ',')">
|
4200
|
+
<xsl:value-of select="substring-before($font_family, ',')"/>
|
4201
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4202
|
+
<xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
|
4203
|
+
</xsl:when>
|
4204
|
+
<xsl:otherwise>
|
4205
|
+
<xsl:value-of select="$font_family"/>
|
4206
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4207
|
+
</xsl:otherwise>
|
4208
|
+
</xsl:choose>
|
4209
|
+
</xsl:otherwise>
|
4210
|
+
</xsl:choose>
|
4196
4211
|
</xsl:attribute>
|
4197
4212
|
</xsl:when>
|
4198
4213
|
<xsl:otherwise>
|
@@ -6786,25 +6801,25 @@
|
|
6786
6801
|
|
6787
6802
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
|
6788
6803
|
|
6789
|
-
|
6804
|
+
<fo:block xsl:use-attribute-sets="table-note-style">
|
6790
6805
|
|
6791
|
-
|
6806
|
+
<xsl:call-template name="refine_table-note-style"/>
|
6792
6807
|
|
6793
|
-
|
6794
|
-
|
6808
|
+
<!-- Table's note/example name (NOTE, for example) -->
|
6809
|
+
<fo:inline xsl:use-attribute-sets="table-note-name-style">
|
6795
6810
|
|
6796
|
-
|
6811
|
+
<xsl:call-template name="refine_table-note-name-style"/>
|
6797
6812
|
|
6798
|
-
|
6813
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
6799
6814
|
|
6800
|
-
|
6815
|
+
</fo:inline>
|
6801
6816
|
|
6802
|
-
|
6803
|
-
|
6804
|
-
|
6817
|
+
<xsl:if test="ancestor::bipm:preface">
|
6818
|
+
<fo:block> </fo:block>
|
6819
|
+
</xsl:if>
|
6805
6820
|
|
6806
|
-
|
6807
|
-
|
6821
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6822
|
+
</fo:block>
|
6808
6823
|
|
6809
6824
|
</xsl:template> <!-- table/note -->
|
6810
6825
|
|
@@ -9982,8 +9997,12 @@
|
|
9982
9997
|
<xsl:variable name="isAdded" select="../@added"/>
|
9983
9998
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
9984
9999
|
<xsl:choose>
|
9985
|
-
<xsl:when test="ancestor::*[local-name() = 'title']">
|
10000
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
9986
10001
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
10002
|
+
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
10003
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
10004
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
10005
|
+
</xsl:if>
|
9987
10006
|
<xsl:variable name="src">
|
9988
10007
|
<xsl:call-template name="image_src"/>
|
9989
10008
|
</xsl:variable>
|
@@ -10016,7 +10035,7 @@
|
|
10016
10035
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
10017
10036
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
10018
10037
|
|
10019
|
-
<xsl:if test="@width != '' and @width != 'auto'">
|
10038
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
10020
10039
|
<xsl:attribute name="width">
|
10021
10040
|
<xsl:value-of select="@width"/>
|
10022
10041
|
</xsl:attribute>
|
@@ -4188,11 +4188,26 @@
|
|
4188
4188
|
<xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
|
4189
4189
|
</xsl:if>
|
4190
4190
|
|
4191
|
-
<xsl:
|
4191
|
+
<xsl:variable name="font_family" select="."/>
|
4192
4192
|
|
4193
|
-
<xsl:
|
4194
|
-
<xsl:
|
4195
|
-
|
4193
|
+
<xsl:choose>
|
4194
|
+
<xsl:when test="$additional_fonts = ''">
|
4195
|
+
<xsl:value-of select="$font_family"/>
|
4196
|
+
</xsl:when>
|
4197
|
+
<xsl:otherwise> <!-- $additional_fonts != '' -->
|
4198
|
+
<xsl:choose>
|
4199
|
+
<xsl:when test="contains($font_family, ',')">
|
4200
|
+
<xsl:value-of select="substring-before($font_family, ',')"/>
|
4201
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4202
|
+
<xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
|
4203
|
+
</xsl:when>
|
4204
|
+
<xsl:otherwise>
|
4205
|
+
<xsl:value-of select="$font_family"/>
|
4206
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4207
|
+
</xsl:otherwise>
|
4208
|
+
</xsl:choose>
|
4209
|
+
</xsl:otherwise>
|
4210
|
+
</xsl:choose>
|
4196
4211
|
</xsl:attribute>
|
4197
4212
|
</xsl:when>
|
4198
4213
|
<xsl:otherwise>
|
@@ -6786,25 +6801,25 @@
|
|
6786
6801
|
|
6787
6802
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
|
6788
6803
|
|
6789
|
-
|
6804
|
+
<fo:block xsl:use-attribute-sets="table-note-style">
|
6790
6805
|
|
6791
|
-
|
6806
|
+
<xsl:call-template name="refine_table-note-style"/>
|
6792
6807
|
|
6793
|
-
|
6794
|
-
|
6808
|
+
<!-- Table's note/example name (NOTE, for example) -->
|
6809
|
+
<fo:inline xsl:use-attribute-sets="table-note-name-style">
|
6795
6810
|
|
6796
|
-
|
6811
|
+
<xsl:call-template name="refine_table-note-name-style"/>
|
6797
6812
|
|
6798
|
-
|
6813
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
6799
6814
|
|
6800
|
-
|
6815
|
+
</fo:inline>
|
6801
6816
|
|
6802
|
-
|
6803
|
-
|
6804
|
-
|
6817
|
+
<xsl:if test="ancestor::bipm:preface">
|
6818
|
+
<fo:block> </fo:block>
|
6819
|
+
</xsl:if>
|
6805
6820
|
|
6806
|
-
|
6807
|
-
|
6821
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6822
|
+
</fo:block>
|
6808
6823
|
|
6809
6824
|
</xsl:template> <!-- table/note -->
|
6810
6825
|
|
@@ -9982,8 +9997,12 @@
|
|
9982
9997
|
<xsl:variable name="isAdded" select="../@added"/>
|
9983
9998
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
9984
9999
|
<xsl:choose>
|
9985
|
-
<xsl:when test="ancestor::*[local-name() = 'title']">
|
10000
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
9986
10001
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
10002
|
+
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
10003
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
10004
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
10005
|
+
</xsl:if>
|
9987
10006
|
<xsl:variable name="src">
|
9988
10007
|
<xsl:call-template name="image_src"/>
|
9989
10008
|
</xsl:variable>
|
@@ -10016,7 +10035,7 @@
|
|
10016
10035
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
10017
10036
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
10018
10037
|
|
10019
|
-
<xsl:if test="@width != '' and @width != 'auto'">
|
10038
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
10020
10039
|
<xsl:attribute name="width">
|
10021
10040
|
<xsl:value-of select="@width"/>
|
10022
10041
|
</xsl:attribute>
|
@@ -4188,11 +4188,26 @@
|
|
4188
4188
|
<xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
|
4189
4189
|
</xsl:if>
|
4190
4190
|
|
4191
|
-
<xsl:
|
4191
|
+
<xsl:variable name="font_family" select="."/>
|
4192
4192
|
|
4193
|
-
<xsl:
|
4194
|
-
<xsl:
|
4195
|
-
|
4193
|
+
<xsl:choose>
|
4194
|
+
<xsl:when test="$additional_fonts = ''">
|
4195
|
+
<xsl:value-of select="$font_family"/>
|
4196
|
+
</xsl:when>
|
4197
|
+
<xsl:otherwise> <!-- $additional_fonts != '' -->
|
4198
|
+
<xsl:choose>
|
4199
|
+
<xsl:when test="contains($font_family, ',')">
|
4200
|
+
<xsl:value-of select="substring-before($font_family, ',')"/>
|
4201
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4202
|
+
<xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
|
4203
|
+
</xsl:when>
|
4204
|
+
<xsl:otherwise>
|
4205
|
+
<xsl:value-of select="$font_family"/>
|
4206
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
4207
|
+
</xsl:otherwise>
|
4208
|
+
</xsl:choose>
|
4209
|
+
</xsl:otherwise>
|
4210
|
+
</xsl:choose>
|
4196
4211
|
</xsl:attribute>
|
4197
4212
|
</xsl:when>
|
4198
4213
|
<xsl:otherwise>
|
@@ -6786,25 +6801,25 @@
|
|
6786
6801
|
|
6787
6802
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
|
6788
6803
|
|
6789
|
-
|
6804
|
+
<fo:block xsl:use-attribute-sets="table-note-style">
|
6790
6805
|
|
6791
|
-
|
6806
|
+
<xsl:call-template name="refine_table-note-style"/>
|
6792
6807
|
|
6793
|
-
|
6794
|
-
|
6808
|
+
<!-- Table's note/example name (NOTE, for example) -->
|
6809
|
+
<fo:inline xsl:use-attribute-sets="table-note-name-style">
|
6795
6810
|
|
6796
|
-
|
6811
|
+
<xsl:call-template name="refine_table-note-name-style"/>
|
6797
6812
|
|
6798
|
-
|
6813
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
6799
6814
|
|
6800
|
-
|
6815
|
+
</fo:inline>
|
6801
6816
|
|
6802
|
-
|
6803
|
-
|
6804
|
-
|
6817
|
+
<xsl:if test="ancestor::bipm:preface">
|
6818
|
+
<fo:block> </fo:block>
|
6819
|
+
</xsl:if>
|
6805
6820
|
|
6806
|
-
|
6807
|
-
|
6821
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6822
|
+
</fo:block>
|
6808
6823
|
|
6809
6824
|
</xsl:template> <!-- table/note -->
|
6810
6825
|
|
@@ -9982,8 +9997,12 @@
|
|
9982
9997
|
<xsl:variable name="isAdded" select="../@added"/>
|
9983
9998
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
9984
9999
|
<xsl:choose>
|
9985
|
-
<xsl:when test="ancestor::*[local-name() = 'title']">
|
10000
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
9986
10001
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
10002
|
+
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
10003
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
10004
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
10005
|
+
</xsl:if>
|
9987
10006
|
<xsl:variable name="src">
|
9988
10007
|
<xsl:call-template name="image_src"/>
|
9989
10008
|
</xsl:variable>
|
@@ -10016,7 +10035,7 @@
|
|
10016
10035
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
10017
10036
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
10018
10037
|
|
10019
|
-
<xsl:if test="@width != '' and @width != 'auto'">
|
10038
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
10020
10039
|
<xsl:attribute name="width">
|
10021
10040
|
<xsl:value-of select="@width"/>
|
10022
10041
|
</xsl:attribute>
|
data/lib/isodoc/bipm/init.rb
CHANGED
@@ -2045,11 +2045,26 @@
|
|
2045
2045
|
<xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
|
2046
2046
|
</xsl:if>
|
2047
2047
|
|
2048
|
-
<xsl:
|
2048
|
+
<xsl:variable name="font_family" select="."/>
|
2049
2049
|
|
2050
|
-
<xsl:
|
2051
|
-
<xsl:
|
2052
|
-
|
2050
|
+
<xsl:choose>
|
2051
|
+
<xsl:when test="$additional_fonts = ''">
|
2052
|
+
<xsl:value-of select="$font_family"/>
|
2053
|
+
</xsl:when>
|
2054
|
+
<xsl:otherwise> <!-- $additional_fonts != '' -->
|
2055
|
+
<xsl:choose>
|
2056
|
+
<xsl:when test="contains($font_family, ',')">
|
2057
|
+
<xsl:value-of select="substring-before($font_family, ',')"/>
|
2058
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
2059
|
+
<xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
|
2060
|
+
</xsl:when>
|
2061
|
+
<xsl:otherwise>
|
2062
|
+
<xsl:value-of select="$font_family"/>
|
2063
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
2064
|
+
</xsl:otherwise>
|
2065
|
+
</xsl:choose>
|
2066
|
+
</xsl:otherwise>
|
2067
|
+
</xsl:choose>
|
2053
2068
|
</xsl:attribute>
|
2054
2069
|
</xsl:when>
|
2055
2070
|
<xsl:otherwise>
|
@@ -4646,21 +4661,21 @@
|
|
4646
4661
|
|
4647
4662
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
|
4648
4663
|
|
4649
|
-
|
4664
|
+
<fo:block xsl:use-attribute-sets="table-note-style">
|
4650
4665
|
|
4651
|
-
|
4666
|
+
<xsl:call-template name="refine_table-note-style"/>
|
4652
4667
|
|
4653
|
-
|
4654
|
-
|
4668
|
+
<!-- Table's note/example name (NOTE, for example) -->
|
4669
|
+
<fo:inline xsl:use-attribute-sets="table-note-name-style">
|
4655
4670
|
|
4656
|
-
|
4671
|
+
<xsl:call-template name="refine_table-note-name-style"/>
|
4657
4672
|
|
4658
|
-
|
4673
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
4659
4674
|
|
4660
|
-
|
4675
|
+
</fo:inline>
|
4661
4676
|
|
4662
|
-
|
4663
|
-
|
4677
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
4678
|
+
</fo:block>
|
4664
4679
|
|
4665
4680
|
</xsl:template> <!-- table/note -->
|
4666
4681
|
|
@@ -7798,8 +7813,12 @@
|
|
7798
7813
|
<xsl:variable name="isAdded" select="../@added"/>
|
7799
7814
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
7800
7815
|
<xsl:choose>
|
7801
|
-
<xsl:when test="ancestor::*[local-name() = 'title']">
|
7816
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7802
7817
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
7818
|
+
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7819
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
7820
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
7821
|
+
</xsl:if>
|
7803
7822
|
<xsl:variable name="src">
|
7804
7823
|
<xsl:call-template name="image_src"/>
|
7805
7824
|
</xsl:variable>
|
@@ -7832,7 +7851,7 @@
|
|
7832
7851
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
7833
7852
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
7834
7853
|
|
7835
|
-
<xsl:if test="@width != '' and @width != 'auto'">
|
7854
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
7836
7855
|
<xsl:attribute name="width">
|
7837
7856
|
<xsl:value-of select="@width"/>
|
7838
7857
|
</xsl:attribute>
|
@@ -19,7 +19,7 @@ module IsoDoc
|
|
19
19
|
&.value == "JCGM" and
|
20
20
|
return "jcgm.standard.xsl"
|
21
21
|
|
22
|
-
doctype =
|
22
|
+
doctype = @doctype
|
23
23
|
doctype = "brochure" unless %w(guide mise-en-pratique rapport)
|
24
24
|
.include? doctype
|
25
25
|
"bipm.#{doctype}.xsl"
|
data/lib/isodoc/bipm/xref.rb
CHANGED
@@ -12,8 +12,8 @@ module IsoDoc
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def parse(docxml)
|
15
|
-
@jcgm = docxml
|
16
|
-
|
15
|
+
@jcgm = docxml.at(ns("//bibdata/ext/editorialgroup/committee/" \
|
16
|
+
"@acronym"))&.value == "JCGM"
|
17
17
|
@annexlbl =
|
18
18
|
if @jcgm then @labels["iso_annex"]
|
19
19
|
elsif docxml.at(ns("//bibdata/ext/structuredidentifier/appendix"))
|
@@ -33,32 +33,30 @@ module IsoDoc
|
|
33
33
|
@anchors[ref["id"]][:xref] = wrap_brackets(@anchors[ref["id"]][:xref])
|
34
34
|
end
|
35
35
|
|
36
|
-
def clause_names(docxml, sect_num)
|
37
|
-
if @jcgm then clause_names_jcgm(docxml, sect_num)
|
38
|
-
else clause_names_bipm(docxml, sect_num)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def clause_names_jcgm(docxml, sect_num)
|
43
|
-
docxml.xpath(ns("//clause[parent::sections][not(@type = 'scope')]" \
|
44
|
-
"[not(descendant::terms)][not(descendant::references)]"))
|
45
|
-
.each do |c|
|
46
|
-
section_names(c, sect_num, 1)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
36
|
UNNUM = "@unnumbered = 'true'".freeze
|
51
37
|
|
52
|
-
def
|
38
|
+
def clause_order_main(docxml)
|
39
|
+
@jcgm and return @iso.clause_order_main(docxml)
|
40
|
+
[{ path: "//sections/clause[not(#{UNNUM})] | " \
|
41
|
+
"//sections/terms[not(#{UNNUM})] | " \
|
42
|
+
"//sections/definitions[not(#{UNNUM})] | " \
|
43
|
+
"//sections/references[not(#{UNNUM})]", multi: true },
|
44
|
+
{ path: "//sections/clause[#{UNNUM}] | " \
|
45
|
+
"//sections/terms[#{UNNUM}] | " \
|
46
|
+
"//sections/definitions[#{UNNUM}] | " \
|
47
|
+
"//sections/references[#{UNNUM}]", multi: true }]
|
48
|
+
end
|
49
|
+
|
50
|
+
def main_anchor_names(xml)
|
51
|
+
@jcgm and return super
|
52
|
+
t = clause_order_main(xml)
|
53
53
|
n = Counter.new
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
"//sections/definitions[#{UNNUM}]"))
|
61
|
-
.each { |c| unnumbered_section_names(c, 1) }
|
54
|
+
t.each_with_index do |a, i|
|
55
|
+
xml.xpath(ns(a[:path])).each do |c|
|
56
|
+
i.zero? ? section_names(c, n, 1) : unnumbered_section_names(c, 1)
|
57
|
+
a[:multi] or break
|
58
|
+
end
|
59
|
+
end
|
62
60
|
end
|
63
61
|
|
64
62
|
NUMBERED_SUBCLAUSES =
|
@@ -79,8 +77,7 @@ module IsoDoc
|
|
79
77
|
end
|
80
78
|
|
81
79
|
def section_names(clause, num, lvl)
|
82
|
-
|
83
|
-
|
80
|
+
clause.nil? and return num
|
84
81
|
num.increment(clause)
|
85
82
|
@anchors[clause["id"]] = section_name_anchors(clause, num, lvl)
|
86
83
|
i = Counter.new
|
@@ -95,9 +92,8 @@ module IsoDoc
|
|
95
92
|
end
|
96
93
|
|
97
94
|
def unnumbered_section_names(clause, lvl)
|
98
|
-
|
99
|
-
|
100
|
-
lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
|
95
|
+
clause.nil? and return num
|
96
|
+
lbl = clause.at(ns("./title"))&.text || "[#{clause['id']}]"
|
101
97
|
@anchors[clause["id"]] = { label: lbl, xref: l10n(%{"#{lbl}"}),
|
102
98
|
level: lvl, type: "clause" }
|
103
99
|
clause.xpath(ns(SUBCLAUSES)).each do |c|
|
@@ -125,7 +121,7 @@ module IsoDoc
|
|
125
121
|
end
|
126
122
|
|
127
123
|
def unnumbered_section_names1(clause, level)
|
128
|
-
lbl = clause
|
124
|
+
lbl = clause.at(ns("./title"))&.text || "[#{clause['id']}]"
|
129
125
|
@anchors[clause["id"]] =
|
130
126
|
{ label: lbl, xref: l10n(%{"#{lbl}"}), level: level, type: "clause" }
|
131
127
|
clause.xpath(ns(SUBCLAUSES)).each do |c|
|
@@ -133,16 +129,22 @@ module IsoDoc
|
|
133
129
|
end
|
134
130
|
end
|
135
131
|
|
136
|
-
def
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
132
|
+
def clause_order_annex(_docxml)
|
133
|
+
[{ path: "//annex[not(#{UNNUM})]", multi: true },
|
134
|
+
{ path: "//annex[#{UNNUM}]", multi: true }]
|
135
|
+
end
|
136
|
+
|
137
|
+
def annex_anchor_names(docxml)
|
138
|
+
n = @jcgm ? Counter.new("@", skip_i: true) : Counter.new(0)
|
139
|
+
clause_order_annex(docxml).each_with_index do |a, i|
|
140
|
+
docxml.xpath(ns(a[:path])).each do |c|
|
141
|
+
if i.zero?
|
142
|
+
n.increment(c)
|
143
|
+
annex_names(c, n.print)
|
144
|
+
else unnumbered_annex_names(c) end
|
145
|
+
a[:multi] or break
|
146
|
+
end
|
142
147
|
end
|
143
|
-
docxml.xpath(ns("//annex[#{UNNUM}]"))
|
144
|
-
.each { |c| unnumbered_annex_names(c) }
|
145
|
-
docxml.xpath(ns("//indexsect")).each { |b| preface_names(b) }
|
146
148
|
end
|
147
149
|
|
148
150
|
def annex_name_anchors(clause, num)
|
@@ -174,7 +176,7 @@ module IsoDoc
|
|
174
176
|
end
|
175
177
|
|
176
178
|
def unnumbered_annex_names(clause)
|
177
|
-
lbl = clause
|
179
|
+
lbl = clause.at(ns("./title"))&.text || "[#{clause['id']}]"
|
178
180
|
@anchors[clause["id"]] = unnumbered_annex_anchors(lbl)
|
179
181
|
if @klass.single_term_clause?(clause)
|
180
182
|
annex_names1(clause.at(ns("./references | ./terms | ./definitions")),
|
@@ -217,9 +219,7 @@ module IsoDoc
|
|
217
219
|
|
218
220
|
def sequential_formula_names(clause)
|
219
221
|
c = Counter.new
|
220
|
-
clause.xpath(ns(".//formula")).each do |t|
|
221
|
-
next if t["id"].nil? || t["id"].empty?
|
222
|
-
|
222
|
+
clause.xpath(ns(".//formula")).noblank.each do |t|
|
223
223
|
@anchors[t["id"]] = anchor_struct(
|
224
224
|
c.increment(t).print, nil,
|
225
225
|
t["inequality"] ? @labels["inequality"] : @labels["formula"],
|
@@ -237,19 +237,15 @@ module IsoDoc
|
|
237
237
|
end
|
238
238
|
|
239
239
|
def sequential_figure_names(clause)
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
else super
|
244
|
-
end
|
240
|
+
@jcgm or return super
|
241
|
+
@iso.sequential_figure_names(clause)
|
242
|
+
@anchors.merge!(@iso.get)
|
245
243
|
end
|
246
244
|
|
247
245
|
def hierarchical_figure_names(clause, num)
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
else super
|
252
|
-
end
|
246
|
+
@jcgm or return super
|
247
|
+
@iso.hierarchical_figure_names(clause, num)
|
248
|
+
@anchors.merge!(@iso.get)
|
253
249
|
end
|
254
250
|
end
|
255
251
|
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.2.
|
20
|
+
<!-- VERSION v1.2.4 -->
|
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">
|
@@ -2068,6 +2068,9 @@
|
|
2068
2068
|
</define>
|
2069
2069
|
<define name="termdefinition">
|
2070
2070
|
<element name="definition">
|
2071
|
+
<optional>
|
2072
|
+
<attribute name="type"/>
|
2073
|
+
</optional>
|
2071
2074
|
<choice>
|
2072
2075
|
<ref name="verbaldefinition"/>
|
2073
2076
|
<ref name="nonverbalrep"/>
|
data/metanorma-bipm.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
29
29
|
|
30
|
-
spec.add_dependency "metanorma-generic", "~> 2.5.
|
31
|
-
spec.add_dependency "metanorma-iso", "~> 2.5.
|
30
|
+
spec.add_dependency "metanorma-generic", "~> 2.5.2"
|
31
|
+
spec.add_dependency "metanorma-iso", "~> 2.5.2"
|
32
32
|
|
33
33
|
spec.add_development_dependency "debug"
|
34
34
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
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.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.5.
|
19
|
+
version: 2.5.2
|
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.5.
|
26
|
+
version: 2.5.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: metanorma-iso
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.5.
|
33
|
+
version: 2.5.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.5.
|
40
|
+
version: 2.5.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: debug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|