metanorma-bipm 2.7.1 → 2.7.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad65231e2c60636b8ddb3dcceca5cc8935151f6873eb7964c0787d662874553c
4
- data.tar.gz: 81a16168046a619da81c5c9598386889ff8cae291e29631b713b91b141599974
3
+ metadata.gz: 30ab2c5c62662e56c25c618f99307735e0a2ee573bcbdc29435ffa2a46d69b3a
4
+ data.tar.gz: c369b13eb1a7d9320d89db146624081b3bcb00288e18c22169486c00470db035
5
5
  SHA512:
6
- metadata.gz: b36f2a8a8ffb26c22912b4bc3743249c0fbf40ed3ca03e79ed730368aee91bfdbc98a7f8e021a2549e553dce343a27427bae866a8865fb99a7b7dffcfff21f97
7
- data.tar.gz: 545719bca99fb1d7222196c351c83dcdcad98cd81cc75bccd8c441882be3d98baab029bb19ecae5394d6caa33a208d26043dcb8343e8c52fd48f5b3118191cfc
6
+ metadata.gz: 2c6a1215d446f6d41433ebde77298a85d593981f44534208831f62729cdb22619a0aababfc805b4b8b574249a34c0d5148e0d94a52a0a9193390d02e0ee73a8e
7
+ data.tar.gz: '09dbc4b0a81a4e86b556f2d3f10df2697f979cd7b417e2f6415526e4583cc4078f95ca32985b737a89ea216d8425b372e8ec9cd8449d9eaeeaf218f8b395d5f9'
data/README.adoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-bipm.svg["Gem Version", link="https://rubygems.org/gems/metanorma-bipm"]
4
4
  image:https://github.com/metanorma/metanorma-bipm/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-bipm/actions?workflow=rake"]
5
- image:https://codeclimate.com/github/metanorma/metanorma-bipm/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-bipm"]
5
+ // image:https://codeclimate.com/github/metanorma/metanorma-bipm/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-bipm"]
6
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-bipm.svg["Pull Requests", link="https://github.com/metanorma/metanorma-bipm/pulls"]
7
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-bipm/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-bipm/releases"]
8
8
 
@@ -432,7 +432,9 @@
432
432
  </redirect:write>
433
433
  </xsl:if>
434
434
 
435
- <xsl:message>START flatxml_</xsl:message>
435
+ <xsl:if test="$debug = 'true'">
436
+ <xsl:message>START flatxml_</xsl:message>
437
+ </xsl:if>
436
438
  <xsl:variable name="startTime2" select="java:getTime(java:java.util.Date.new())"/>
437
439
  <xsl:variable name="flatxml__">
438
440
  <!-- <xsl:apply-templates select="xalan:nodeset($title_eref)" mode="flatxml"/> -->
@@ -451,16 +453,44 @@
451
453
  <xsl:with-param name="filepath" select="$updated_flatxml_filename"/>
452
454
  </xsl:call-template>
453
455
  <xsl:variable name="endTime2" select="java:getTime(java:java.util.Date.new())"/>
456
+ <xsl:if test="$debug = 'true'">
457
+ <xsl:message>DEBUG: processing time <xsl:value-of select="$endTime2 - $startTime2"/> msec.</xsl:message>
458
+ <xsl:message>END flatxml_</xsl:message>
459
+ </xsl:if>
460
+
461
+ <xsl:if test="$debug = 'true'">
462
+ <redirect:write file="flatxml.xml">
463
+ <xsl:copy-of select="xalan:nodeset($flatxml_)"/>
464
+ </redirect:write>
465
+ </xsl:if>
454
466
 
467
+ <xsl:if test="$debug = 'true'">
468
+ <xsl:message>START flatxml</xsl:message>
469
+ </xsl:if>
470
+ <xsl:variable name="startTime3" select="java:getTime(java:java.util.Date.new())"/>
455
471
  <xsl:variable name="flatxml">
456
472
  <xsl:apply-templates select="xalan:nodeset($flatxml_)" mode="pagebreak"/>
457
473
  </xsl:variable>
474
+ <xsl:variable name="endTime3" select="java:getTime(java:java.util.Date.new())"/>
475
+ <xsl:if test="$debug = 'true'">
476
+ <xsl:message>DEBUG: processing time <xsl:value-of select="$endTime3 - $startTime3"/> msec.</xsl:message>
477
+ <xsl:message>END flatxml</xsl:message>
478
+ </xsl:if>
458
479
 
459
480
  <!-- flatxml=<xsl:copy-of select="$flatxml"/> -->
460
481
 
482
+ <xsl:if test="$debug = 'true'">
483
+ <xsl:message>START bipm-standard</xsl:message>
484
+ </xsl:if>
485
+ <xsl:variable name="startTime4" select="java:getTime(java:java.util.Date.new())"/>
461
486
  <xsl:apply-templates select="xalan:nodeset($flatxml)/mn:metanorma" mode="bipm-standard">
462
487
  <xsl:with-param name="curr_docnum" select="$num"/>
463
488
  </xsl:apply-templates>
489
+ <xsl:variable name="endTime4" select="java:getTime(java:java.util.Date.new())"/>
490
+ <xsl:if test="$debug = 'true'">
491
+ <xsl:message>DEBUG: processing time <xsl:value-of select="$endTime4 - $startTime4"/> msec.</xsl:message>
492
+ <xsl:message>END bipm-standard</xsl:message>
493
+ </xsl:if>
464
494
 
465
495
  </xsl:for-each>
466
496
  </xsl:when>
@@ -1025,7 +1055,7 @@
1025
1055
  </xsl:attribute>
1026
1056
  </xsl:if>
1027
1057
 
1028
- <xsl:call-template name="insertFootnoteSeparator"/>
1058
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1029
1059
 
1030
1060
  <xsl:call-template name="insertHeaderDraftWatermark">
1031
1061
  <xsl:with-param name="lang" select="$curr_lang"/>
@@ -1101,7 +1131,7 @@
1101
1131
 
1102
1132
  <xsl:if test="mn:preface/*[not(self::mn:note or self::mn:admonition)]">
1103
1133
  <fo:page-sequence master-reference="document" force-page-count="no-force">
1104
- <xsl:call-template name="insertFootnoteSeparator"/>
1134
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1105
1135
 
1106
1136
  <xsl:variable name="header-title">
1107
1137
  <xsl:choose>
@@ -1130,7 +1160,7 @@
1130
1160
  </xsl:variable>
1131
1161
 
1132
1162
  <fo:page-sequence master-reference="document" force-page-count="no-force">
1133
- <xsl:call-template name="insertFootnoteSeparator"/>
1163
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1134
1164
 
1135
1165
  <xsl:variable name="title-toc">
1136
1166
  <fo:inline>
@@ -1145,74 +1175,10 @@
1145
1175
 
1146
1176
  <fo:flow flow-name="xsl-region-body">
1147
1177
 
1148
- <!-- <fo:block-container margin-left="-14mm" margin-right="0mm">
1149
- <fo:block-container margin-left="0mm" margin-right="0mm"> -->
1150
- <fo:block xsl:use-attribute-sets="toc-title-style">
1151
- <fo:inline><xsl:value-of select="//mn:metanorma/mn:bibdata/mn:title[@language = $curr_lang and @type='title-main']"/></fo:inline>
1152
- <fo:inline keep-together.within-line="always">
1153
- <fo:leader leader-pattern="space"/>
1154
- <fo:inline>
1155
- <xsl:value-of select="$title-toc"/>
1156
- </fo:inline>
1157
- </fo:inline>
1158
- </fo:block>
1159
- <!-- </fo:block-container>
1160
- </fo:block-container> -->
1161
-
1162
- <fo:block-container xsl:use-attribute-sets="toc-style">
1163
- <fo:block role="TOC">
1164
- <!-- <xsl:copy-of select="$contents"/> -->
1165
-
1166
- <xsl:if test="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true']">
1167
- <fo:table table-layout="fixed" width="100%" id="__internal_layout__toc_{generate-id()}" role="SKIP">
1168
- <fo:table-column column-width="127mm"/>
1169
- <fo:table-column column-width="12mm"/>
1170
- <fo:table-body role="SKIP">
1171
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and not(@type = 'annex') and not(@type = 'index') and not(@parent = 'annex')]">
1172
- <xsl:call-template name="insertContentItem"/>
1173
- </xsl:for-each>
1174
- <!-- insert page break between main sections and appendixes in ToC -->
1175
- <!-- <xsl:if test="$doctype ='brochure'">
1176
- <fo:table-row>
1177
- <fo:table-cell number-columns-spanned="2">
1178
- <fo:block break-after="page"/>
1179
- </fo:table-cell>
1180
- </fo:table-row>
1181
- </xsl:if> -->
1182
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'annex')]"> <!-- or (@level = 2 and @parent = 'annex') -->
1183
- <xsl:call-template name="insertContentItem">
1184
- <xsl:with-param name="keep-with-next">true</xsl:with-param>
1185
- </xsl:call-template>
1186
- </xsl:for-each>
1187
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'index')]">
1188
- <xsl:call-template name="insertContentItem"/>
1189
- </xsl:for-each>
1190
-
1191
- <!-- List of Tables -->
1192
- <xsl:if test="$contents/mnx:doc[@id = $docid]//mnx:tables/mnx:table">
1193
- <xsl:call-template name="insertListOf_Title">
1194
- <xsl:with-param name="title" select="$title-list-tables"/>
1195
- </xsl:call-template>
1196
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:tables/mnx:table">
1197
- <xsl:call-template name="insertListOf_Item"/>
1198
- </xsl:for-each>
1199
- </xsl:if>
1200
-
1201
- <!-- List of Figures -->
1202
- <xsl:if test="$contents/doc[@id = $docid]//mnx:figures/mnx:figure">
1203
- <xsl:call-template name="insertListOf_Title">
1204
- <xsl:with-param name="title" select="$title-list-figures"/>
1205
- </xsl:call-template>
1206
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:figures/mnx:figure">
1207
- <xsl:call-template name="insertListOf_Item"/>
1208
- </xsl:for-each>
1209
- </xsl:if>
1210
-
1211
- </fo:table-body>
1212
- </fo:table>
1213
- </xsl:if>
1214
- </fo:block>
1215
- </fo:block-container>
1178
+ <xsl:call-template name="toc">
1179
+ <xsl:with-param name="docid" select="$docid"/>
1180
+ <xsl:with-param name="curr_lang" select="$curr_lang"/>
1181
+ </xsl:call-template>
1216
1182
 
1217
1183
  </fo:flow>
1218
1184
 
@@ -1237,6 +1203,7 @@
1237
1203
  <!-- Document Control -->
1238
1204
  <xsl:apply-templates select="mn:doccontrol | mn:colophon" mode="sections"/>
1239
1205
 
1206
+ <!-- indexes=<xsl:copy-of select="$indexes"/> -->
1240
1207
  <!-- Index -->
1241
1208
  <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//mn:indexsect" mode="index">
1242
1209
  <xsl:with-param name="isDraft" select="normalize-space(//mn:metanorma/mn:bibdata/mn:version/mn:draft or contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'draft') or contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'projet'))"/>
@@ -1894,6 +1861,82 @@
1894
1861
  </xsl:choose>
1895
1862
  </xsl:template>
1896
1863
 
1864
+ <xsl:template name="toc">
1865
+ <xsl:param name="curr_lang"/>
1866
+ <xsl:param name="docid"/>
1867
+
1868
+ <xsl:variable name="title-toc"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">table_of_contents</xsl:with-param></xsl:call-template></xsl:variable>
1869
+
1870
+ <!-- <fo:block-container margin-left="-14mm" margin-right="0mm">
1871
+ <fo:block-container margin-left="0mm" margin-right="0mm"> -->
1872
+ <fo:block xsl:use-attribute-sets="toc-title-style">
1873
+ <fo:inline><xsl:value-of select="//mn:metanorma/mn:bibdata/mn:title[@language = $curr_lang and @type='title-main']"/></fo:inline>
1874
+ <fo:inline keep-together.within-line="always">
1875
+ <fo:leader leader-pattern="space"/>
1876
+ <fo:inline>
1877
+ <xsl:value-of select="$title-toc"/>
1878
+ </fo:inline>
1879
+ </fo:inline>
1880
+ </fo:block>
1881
+ <!-- </fo:block-container>
1882
+ </fo:block-container> -->
1883
+
1884
+ <fo:block-container xsl:use-attribute-sets="toc-style">
1885
+ <fo:block role="TOC">
1886
+ <!-- <xsl:copy-of select="$contents"/> -->
1887
+
1888
+ <xsl:if test="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true']">
1889
+ <fo:table table-layout="fixed" width="100%" id="__internal_layout__toc_{generate-id()}" role="SKIP">
1890
+ <fo:table-column column-width="127mm"/>
1891
+ <fo:table-column column-width="12mm"/>
1892
+ <fo:table-body role="SKIP">
1893
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and not(@type = 'annex') and not(@type = 'index') and not(@parent = 'annex')]">
1894
+ <xsl:call-template name="insertContentItem"/>
1895
+ </xsl:for-each>
1896
+ <!-- insert page break between main sections and appendixes in ToC -->
1897
+ <!-- <xsl:if test="$doctype ='brochure'">
1898
+ <fo:table-row>
1899
+ <fo:table-cell number-columns-spanned="2">
1900
+ <fo:block break-after="page"/>
1901
+ </fo:table-cell>
1902
+ </fo:table-row>
1903
+ </xsl:if> -->
1904
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'annex')]"> <!-- or (@level = 2 and @parent = 'annex') -->
1905
+ <xsl:call-template name="insertContentItem">
1906
+ <xsl:with-param name="keep-with-next">true</xsl:with-param>
1907
+ </xsl:call-template>
1908
+ </xsl:for-each>
1909
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'index')]">
1910
+ <xsl:call-template name="insertContentItem"/>
1911
+ </xsl:for-each>
1912
+
1913
+ <!-- List of Tables -->
1914
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:tables/mnx:table">
1915
+ <xsl:if test="position() = 1">
1916
+ <xsl:call-template name="insertListOf_Title">
1917
+ <xsl:with-param name="title" select="$title-list-tables"/>
1918
+ </xsl:call-template>
1919
+ </xsl:if>
1920
+ <xsl:call-template name="insertListOf_Item"/>
1921
+ </xsl:for-each>
1922
+
1923
+ <!-- List of Figures -->
1924
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:figures/mnx:figure">
1925
+ <xsl:if test="position() = 1">
1926
+ <xsl:call-template name="insertListOf_Title">
1927
+ <xsl:with-param name="title" select="$title-list-figures"/>
1928
+ </xsl:call-template>
1929
+ </xsl:if>
1930
+ <xsl:call-template name="insertListOf_Item"/>
1931
+ </xsl:for-each>
1932
+
1933
+ </fo:table-body>
1934
+ </fo:table>
1935
+ </xsl:if>
1936
+ </fo:block>
1937
+ </fo:block-container>
1938
+ </xsl:template>
1939
+
1897
1940
  <xsl:template name="insertContentItem">
1898
1941
  <xsl:param name="keep-with-next"/>
1899
1942
  <fo:table-row xsl:use-attribute-sets="toc-item-style">
@@ -2114,7 +2157,7 @@
2114
2157
  <xsl:attribute name="master-reference">document-landscape</xsl:attribute>
2115
2158
  </xsl:if>
2116
2159
 
2117
- <xsl:call-template name="insertFootnoteSeparator"/>
2160
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2118
2161
 
2119
2162
  <xsl:variable name="header-title">
2120
2163
  <xsl:choose>
@@ -2171,7 +2214,7 @@
2171
2214
 
2172
2215
  <xsl:template name="sections_appendix">
2173
2216
  <fo:page-sequence master-reference="document" force-page-count="no-force">
2174
- <xsl:call-template name="insertFootnoteSeparator"/>
2217
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2175
2218
 
2176
2219
  <xsl:variable name="curr_lang" select="/mn:metanorma/mn:bibdata/mn:language[@current = 'true']"/>
2177
2220
 
@@ -3620,14 +3663,6 @@
3620
3663
  </xsl:choose>
3621
3664
  </xsl:template>
3622
3665
 
3623
- <xsl:template name="insertFootnoteSeparator">
3624
- <fo:static-content flow-name="xsl-footnote-separator">
3625
- <fo:block>
3626
- <fo:leader leader-pattern="rule" leader-length="30%"/>
3627
- </fo:block>
3628
- </fo:static-content>
3629
- </xsl:template>
3630
-
3631
3666
  <!-- =================== -->
3632
3667
  <!-- Index processing -->
3633
3668
  <!-- =================== -->
@@ -13572,7 +13607,7 @@
13572
13607
 
13573
13608
  <xsl:template name="insertFootnoteSeparatorCommon">
13574
13609
  <xsl:param name="leader_length">30%</xsl:param>
13575
- <fo:static-content flow-name="xsl-footnote-separator">
13610
+ <fo:static-content flow-name="xsl-footnote-separator" role="artifact">
13576
13611
  <fo:block>
13577
13612
  <fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
13578
13613
  </fo:block>
@@ -14467,6 +14502,9 @@
14467
14502
  <xsl:attribute name="role">H1</xsl:attribute>
14468
14503
  </xsl:attribute-set>
14469
14504
 
14505
+ <xsl:template name="refine_toc-title-style">
14506
+ </xsl:template>
14507
+
14470
14508
  <xsl:attribute-set name="toc-title-page-style">
14471
14509
  <xsl:attribute name="text-align">right</xsl:attribute>
14472
14510
  <xsl:attribute name="font-size">9pt</xsl:attribute>
@@ -14474,6 +14512,9 @@
14474
14512
  <xsl:attribute name="role">SKIP</xsl:attribute>
14475
14513
  </xsl:attribute-set> <!-- toc-title-page-style -->
14476
14514
 
14515
+ <xsl:template name="refine_toc-title-page-style">
14516
+ </xsl:template>
14517
+
14477
14518
  <xsl:attribute-set name="toc-item-block-style">
14478
14519
  </xsl:attribute-set>
14479
14520
 
@@ -14531,6 +14572,9 @@
14531
14572
  <xsl:attribute name="padding-bottom">6pt</xsl:attribute>
14532
14573
  </xsl:attribute-set>
14533
14574
 
14575
+ <xsl:template name="refine_toc-listof-title-style">
14576
+ </xsl:template>
14577
+
14534
14578
  <xsl:attribute-set name="toc-listof-item-block-style">
14535
14579
  </xsl:attribute-set>
14536
14580
 
@@ -14877,7 +14921,7 @@
14877
14921
  </xsl:if>
14878
14922
 
14879
14923
  <xsl:for-each select="$contents_nodes/mnx:doc">
14880
- <fo:bookmark internal-destination="{contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
14924
+ <fo:bookmark internal-destination="{mnx:contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
14881
14925
  <xsl:if test="@bundle = 'true'">
14882
14926
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
14883
14927
  </xsl:if>
@@ -14911,7 +14955,7 @@
14911
14955
  </xsl:choose>
14912
14956
  </fo:bookmark-title>
14913
14957
 
14914
- <xsl:apply-templates select="contents/mnx:item" mode="bookmark"/>
14958
+ <xsl:apply-templates select="mnx:contents/mnx:item" mode="bookmark"/>
14915
14959
 
14916
14960
  <xsl:call-template name="insertFigureBookmarks">
14917
14961
  <xsl:with-param name="contents" select="mnx:contents"/>