metanorma-csa 2.6.10 → 2.7.0

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: c7e14194a675b44fb99b488425c04a870e54fbca7460a29b1702dc27c982b327
4
- data.tar.gz: 99fb32f2d961863351cff2c7f664fffffbb946d4dd48ccaed21a4db39cbef123
3
+ metadata.gz: dd8c77f4a99cfbf81e151ab5ba7f9bd5e7bb716867183fbce2953bdaf44c6540
4
+ data.tar.gz: a726b84ff192baf5fdeb8a5830a72fbf2a3c82db54e0f7f4162092f1adc01d59
5
5
  SHA512:
6
- metadata.gz: a3380315307099389ff8ba25c6899e5d226740ed504e0c0157d7711b1312da5a9042ff4cc91d7f2d414fff32789320e0d2b9e16b4a689353e21d2ed27f541f68
7
- data.tar.gz: 457cf4de27fe167dc0af0d838ff3e6af99e3d0a68988e137ca06b7462b938a110f9d3741837df1813c272dc3e583d9e27fda11986a6a3baf4dfd9193c25249ef
6
+ metadata.gz: 455cdf3fcf3e8cb0b418d5b5d54dc60a8a3f051ae2486d43cbbfd5b715f420518c1280983587db35c04f53e3e03dfb4085271d6399a55e54b3973a2dae4a36d7
7
+ data.tar.gz: a0d0b5398824d6f166a8fb973658f1eb42fec2747579c8473ec99c8769371e4cc160dfbbe1e1268f262719fcc8c3c5bc305516c3b068d5bc0b3839c21ce29d69
@@ -262,7 +262,7 @@
262
262
  <xsl:template name="insertListOf_Title">
263
263
  <xsl:param name="title"/>
264
264
  <fo:block role="TOCI" keep-with-next="always">
265
- <fo:list-block provisional-distance-between-starts="3mm">
265
+ <fo:list-block xsl:use-attribute-sets="toc-listof-title-style">
266
266
  <fo:list-item>
267
267
  <fo:list-item-label end-indent="label-end()">
268
268
  <fo:block font-size="1pt"> </fo:block>
@@ -279,20 +279,20 @@
279
279
 
280
280
  <xsl:template name="insertListOf_Item">
281
281
  <fo:block role="TOCI">
282
- <fo:list-block provisional-distance-between-starts="10mm">
282
+ <fo:list-block xsl:use-attribute-sets="toc-listof-item-block-style">
283
283
  <fo:list-item>
284
284
  <fo:list-item-label end-indent="label-end()">
285
285
  <fo:block font-size="1pt"> </fo:block>
286
286
  </fo:list-item-label>
287
287
  <fo:list-item-body start-indent="body-start()">
288
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
288
+ <fo:block xsl:use-attribute-sets="toc-listof-item-style">
289
289
  <fo:basic-link internal-destination="{@id}">
290
290
  <xsl:call-template name="setAltText">
291
291
  <xsl:with-param name="value" select="@alt-text"/>
292
292
  </xsl:call-template>
293
293
  <xsl:apply-templates select="." mode="contents"/>
294
294
  <fo:inline keep-together.within-line="always">
295
- <fo:leader leader-pattern="dots"/>
295
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
296
296
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
297
297
  </fo:inline>
298
298
  </fo:basic-link>
@@ -303,10 +303,10 @@
303
303
  </fo:block>
304
304
  </xsl:template>
305
305
 
306
- <xsl:template match="mn:preface//mn:clause[@type = 'toc']" priority="3">
306
+ <xsl:template match="mn:preface//mn:clause[@type = 'toc']" name="toc" priority="3">
307
307
  <xsl:param name="process">false</xsl:param>
308
308
  <xsl:if test="$process = 'true'">
309
- <fo:block-container font-size="12pt" line-height="170%" color="rgb(7, 72, 156)">
309
+ <fo:block-container xsl:use-attribute-sets="toc-style">
310
310
 
311
311
  <xsl:apply-templates/>
312
312
 
@@ -314,24 +314,19 @@
314
314
  <fo:block margin-left="-3mm" role="TOC">
315
315
  <xsl:for-each select="$contents//mnx:item[@display = 'true']">
316
316
  <fo:block role="TOCI">
317
- <fo:list-block>
318
- <xsl:attribute name="provisional-distance-between-starts">
319
- <xsl:choose>
320
- <xsl:when test="@level &gt;= 2"><xsl:value-of select="(@level - 1) * 10"/>mm</xsl:when>
321
- <xsl:otherwise>3mm</xsl:otherwise>
322
- </xsl:choose>
323
- </xsl:attribute>
317
+ <fo:list-block xsl:use-attribute-sets="toc-item-block-style">
318
+ <xsl:call-template name="refine_toc-item-block-style"/>
324
319
  <fo:list-item>
325
320
  <fo:list-item-label end-indent="label-end()">
326
321
  <fo:block font-size="1pt"> </fo:block>
327
322
  </fo:list-item-label>
328
323
  <fo:list-item-body start-indent="body-start()">
329
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
324
+ <fo:block xsl:use-attribute-sets="toc-item-style">
330
325
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
331
326
  <fo:inline padding-right="2mm"><xsl:value-of select="@section"/></fo:inline>
332
327
  <xsl:apply-templates select="mnx:title"/>
333
328
  <fo:inline keep-together.within-line="always">
334
- <fo:leader leader-pattern="dots"/>
329
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
335
330
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
336
331
  </fo:inline>
337
332
  </fo:basic-link>
@@ -343,24 +338,24 @@
343
338
  </xsl:for-each>
344
339
 
345
340
  <!-- List of Tables -->
346
- <xsl:if test="$contents//mnx:tables/mnx:table">
347
- <xsl:call-template name="insertListOf_Title">
348
- <xsl:with-param name="title" select="$title-list-tables"/>
349
- </xsl:call-template>
350
- <xsl:for-each select="$contents//mnx:tables/mnx:table">
351
- <xsl:call-template name="insertListOf_Item"/>
352
- </xsl:for-each>
353
- </xsl:if>
341
+ <xsl:for-each select="$contents//mnx:tables/mnx:table">
342
+ <xsl:if test="position() = 1">
343
+ <xsl:call-template name="insertListOf_Title">
344
+ <xsl:with-param name="title" select="$title-list-tables"/>
345
+ </xsl:call-template>
346
+ </xsl:if>
347
+ <xsl:call-template name="insertListOf_Item"/>
348
+ </xsl:for-each>
354
349
 
355
350
  <!-- List of Figures -->
356
- <xsl:if test="$contents//mnx:figures/mnx:figure">
357
- <xsl:call-template name="insertListOf_Title">
358
- <xsl:with-param name="title" select="$title-list-figures"/>
359
- </xsl:call-template>
360
- <xsl:for-each select="$contents//mnx:figures/mnx:figure">
361
- <xsl:call-template name="insertListOf_Item"/>
362
- </xsl:for-each>
363
- </xsl:if>
351
+ <xsl:for-each select="$contents//mnx:figures/mnx:figure">
352
+ <xsl:if test="position() = 1">
353
+ <xsl:call-template name="insertListOf_Title">
354
+ <xsl:with-param name="title" select="$title-list-figures"/>
355
+ </xsl:call-template>
356
+ </xsl:if>
357
+ <xsl:call-template name="insertListOf_Item"/>
358
+ </xsl:for-each>
364
359
 
365
360
  </fo:block>
366
361
  </xsl:if>
@@ -371,7 +366,7 @@
371
366
  </xsl:template>
372
367
 
373
368
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']/mn:fmt-title" priority="3">
374
- <fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt" role="H1">
369
+ <fo:block xsl:use-attribute-sets="toc-title-style">
375
370
  <xsl:apply-templates/>
376
371
  </fo:block>
377
372
  </xsl:template>
@@ -5629,6 +5624,16 @@
5629
5624
  </xsl:variable>
5630
5625
  <xsl:variable name="quot">"</xsl:variable>
5631
5626
  <xsl:variable name="styles_">
5627
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
5628
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
5629
+ <style name="border-top">none</style>
5630
+ <style name="border-right">none</style>
5631
+ <style name="border-left">none</style>
5632
+ <style name="border-bottom">none</style>
5633
+ <style name="color">inherit</style>
5634
+ <style name="background-color">transparent</style>
5635
+ </xsl:if>
5636
+
5632
5637
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
5633
5638
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5634
5639
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
@@ -7617,7 +7622,10 @@
7617
7622
 
7618
7623
  <xsl:call-template name="setNamedDestination"/>
7619
7624
 
7620
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7625
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
7626
+ <xsl:if test="not(parent::mn:references)">
7627
+ <xsl:copy-of select="@id"/>
7628
+ </xsl:if>
7621
7629
 
7622
7630
  <xsl:call-template name="setBlockSpanAll"/>
7623
7631
 
@@ -10301,13 +10309,14 @@
10301
10309
  </xsl:template> <!-- bibitem -->
10302
10310
 
10303
10311
  <!-- Bibliography (non-normative references) -->
10304
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
10305
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10312
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
10313
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10306
10314
  <!-- start CSA bibitem processing -->
10307
10315
  <xsl:call-template name="setNamedDestination"/>
10308
10316
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
10309
10317
  <xsl:apply-templates select="mn:biblio-tag"/>
10310
10318
  <xsl:apply-templates select="mn:formattedref"/>
10319
+ <xsl:call-template name="processBibliographyNote"/>
10311
10320
  </fo:block>
10312
10321
  <!-- END CSA bibitem processing -->
10313
10322
 
@@ -10338,7 +10347,7 @@
10338
10347
  </fo:list-item>
10339
10348
  </xsl:otherwise>
10340
10349
  </xsl:choose>
10341
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
10350
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
10342
10351
  <xsl:with-param name="skip">false</xsl:with-param>
10343
10352
  </xsl:apply-templates>
10344
10353
  </xsl:template>
@@ -10355,8 +10364,26 @@
10355
10364
  </xsl:apply-templates>
10356
10365
  <xsl:apply-templates select="mn:formattedref"/>
10357
10366
  <!-- end bibitem processing -->
10367
+
10368
+ <xsl:call-template name="processBibliographyNote"/>
10358
10369
  </xsl:template> <!-- processBibitem (bibitem) -->
10359
10370
 
10371
+ <xsl:template name="processBibliographyNote">
10372
+ <xsl:if test="self::mn:note">
10373
+ <xsl:variable name="note_node">
10374
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10375
+ <xsl:copy> <!-- skip @id -->
10376
+ <xsl:copy-of select="node()"/>
10377
+ </xsl:copy>
10378
+ </xsl:element>
10379
+ </xsl:variable>
10380
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
10381
+ <xsl:call-template name="note"/>
10382
+ </xsl:for-each> -->
10383
+ <xsl:call-template name="note"/>
10384
+ </xsl:if>
10385
+ </xsl:template>
10386
+
10360
10387
  <xsl:template match="mn:title" mode="title">
10361
10388
  <fo:inline><xsl:apply-templates/></fo:inline>
10362
10389
  </xsl:template>
@@ -10902,6 +10929,70 @@
10902
10929
  <!-- End Form's elements processing -->
10903
10930
  <!-- =================== -->
10904
10931
 
10932
+ <xsl:attribute-set name="toc-style">
10933
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
10934
+ <xsl:attribute name="line-height">170%</xsl:attribute>
10935
+ <xsl:attribute name="color">rgb(7, 72, 156)</xsl:attribute>
10936
+ </xsl:attribute-set>
10937
+
10938
+ <xsl:template name="refine_toc-style">
10939
+ </xsl:template>
10940
+
10941
+ <xsl:attribute-set name="toc-title-style">
10942
+ <xsl:attribute name="font-size">26pt</xsl:attribute>
10943
+ <xsl:attribute name="color">black</xsl:attribute>
10944
+ <xsl:attribute name="margin-top">2pt</xsl:attribute>
10945
+ <xsl:attribute name="margin-bottom">30pt</xsl:attribute>
10946
+ <xsl:attribute name="role">H1</xsl:attribute>
10947
+ </xsl:attribute-set>
10948
+
10949
+ <xsl:attribute-set name="toc-title-page-style">
10950
+ </xsl:attribute-set> <!-- toc-title-page-style -->
10951
+
10952
+ <xsl:attribute-set name="toc-item-block-style">
10953
+ <xsl:attribute name="provisional-distance-between-starts">3mm</xsl:attribute>
10954
+ </xsl:attribute-set>
10955
+
10956
+ <xsl:template name="refine_toc-item-block-style">
10957
+ <xsl:if test="@level &gt;= 2">
10958
+ <xsl:attribute name="provisional-distance-between-starts"><xsl:value-of select="(@level - 1) * 10"/>mm</xsl:attribute>
10959
+ </xsl:if>
10960
+ </xsl:template>
10961
+
10962
+ <xsl:attribute-set name="toc-item-style">
10963
+ <xsl:attribute name="role">TOCI</xsl:attribute>
10964
+ <xsl:attribute name="text-align-last">justify</xsl:attribute>
10965
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
10966
+ <xsl:attribute name="text-indent">-12mm</xsl:attribute>
10967
+ <xsl:attribute name="role">SKIP</xsl:attribute>
10968
+ </xsl:attribute-set> <!-- END: toc-item-style -->
10969
+
10970
+ <xsl:template name="refine_toc-item-style">
10971
+ </xsl:template> <!-- END: refine_toc-item-style -->
10972
+
10973
+ <xsl:attribute-set name="toc-leader-style">
10974
+ <xsl:attribute name="leader-pattern">dots</xsl:attribute>
10975
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
10976
+
10977
+ <xsl:attribute-set name="toc-pagenumber-style">
10978
+ </xsl:attribute-set>
10979
+
10980
+ <!-- List of Figures, Tables -->
10981
+ <xsl:attribute-set name="toc-listof-title-style">
10982
+ <xsl:attribute name="provisional-distance-between-starts">3mm</xsl:attribute>
10983
+ </xsl:attribute-set>
10984
+
10985
+ <xsl:attribute-set name="toc-listof-item-block-style">
10986
+ <xsl:attribute name="provisional-distance-between-starts">10mm</xsl:attribute>
10987
+ </xsl:attribute-set>
10988
+
10989
+ <xsl:attribute-set name="toc-listof-item-style">
10990
+ <xsl:attribute name="role">TOCI</xsl:attribute>
10991
+ <xsl:attribute name="text-align-last">justify</xsl:attribute>
10992
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
10993
+ <xsl:attribute name="text-indent">-12mm</xsl:attribute>
10994
+ </xsl:attribute-set>
10995
+
10905
10996
  <xsl:template name="processPrefaceSectionsDefault_Contents">
10906
10997
  <xsl:variable name="nodes_preface_">
10907
10998
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -198,14 +198,14 @@ Applicable to modify and delete</a:documentation>
198
198
  </zeroOrMore>
199
199
  </element>
200
200
  </optional>
201
- <optional>
201
+ <zeroOrMore>
202
202
  <element name="description">
203
- <a:documentation>Description of the change described in this block</a:documentation>
204
- <zeroOrMore>
203
+ <a:documentation>Description(s) of the change described in this block</a:documentation>
204
+ <oneOrMore>
205
205
  <ref name="BasicBlock"/>
206
- </zeroOrMore>
206
+ </oneOrMore>
207
207
  </element>
208
- </optional>
208
+ </zeroOrMore>
209
209
  <optional>
210
210
  <element name="newcontent">
211
211
  <a:documentation>New content to be added to the document; applicable to add and modify</a:documentation>
@@ -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.8 -->
3
+ <!-- VERSION v2.1.0 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -735,6 +735,12 @@ titlecase, or lowercase</a:documentation>
735
735
  <ref name="BlockAttributes"/>
736
736
  </define>
737
737
  <define name="TableAttributes" combine="interleave">
738
+ <optional>
739
+ <attribute name="plain">
740
+ <a:documentation>Render as a plain attribute, with no shading or borders</a:documentation>
741
+ <data type="boolean"/>
742
+ </attribute>
743
+ </optional>
738
744
  <optional>
739
745
  <attribute name="width">
740
746
  <a:documentation>Width of the table block in rendering</a:documentation>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.6.10".freeze
3
+ VERSION = "2.7.0".freeze
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 3.0.4"
32
+ spec.add_dependency "metanorma-generic", "~> 3.1.0"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.10
4
+ version: 2.7.0
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-07-05 00:00:00.000000000 Z
11
+ date: 2025-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.4
19
+ version: 3.1.0
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: 3.0.4
26
+ version: 3.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement