metanorma-cc 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: 12c31cc7fba0734d20171ee02ac03d6ea0d1f917020a81b56935663ed4bd51f7
4
- data.tar.gz: ad2d1aeb391b13adc4c8f7d01a242c18a0246651782c83731c774697ea4075a6
3
+ metadata.gz: 901cabea327df22750189903cc3b3ff928359a4d0f8a9ca2ce60372962d6725b
4
+ data.tar.gz: e45f7e9c28b5af33df0bf00e87a6ac18c69781003d7bf213a89466d3fd4c0368
5
5
  SHA512:
6
- metadata.gz: b2b74a60b50c707037df749ed81880a349058fb6c098e7888559ca10e44bcf76ea91fd7be8f64680a6091859a7b75ad8c6f131d99097d379788d39a3808c79a0
7
- data.tar.gz: 73086605b7244c1dd38318b7f56d9d7b560e70becee515238ee66546109047c022dc0e8e3958cd2b9cc169b893358f50e88392c7f2f57a8d74909627746cc0bf
6
+ metadata.gz: 913756a5f6e7c6178d2ddbc6fffba61abd5088258b98b70a23929886e73b658a16185f881dcd176ad1170213d8bab9ee5a8d1c0355df30b2e64a5acf6214d051
7
+ data.tar.gz: f55869ba734591edb16c9bce263cdd268b64bae3b2dc8cf694a237cca7d275dea0b9098ac6a7d6c1fc76bd11bb0a2b6ac85a7e7c72b8364b33906220cb812924
@@ -345,27 +345,27 @@
345
345
 
346
346
  <xsl:template name="insertListOf_Title">
347
347
  <xsl:param name="title"/>
348
- <fo:block role="TOCI" margin-top="6pt" keep-with-next="always">
348
+ <fo:block xsl:use-attribute-sets="toc-listof-title-style">
349
349
  <xsl:value-of select="$title"/>
350
350
  </fo:block>
351
351
  </xsl:template>
352
352
 
353
353
  <xsl:template name="insertListOf_Item">
354
354
  <fo:block role="TOCI">
355
- <fo:list-block provisional-distance-between-starts="8mm" role="SKIP">
355
+ <fo:list-block xsl:use-attribute-sets="toc-listof-item-block-style">
356
356
  <fo:list-item role="SKIP">
357
357
  <fo:list-item-label end-indent="label-end()" role="SKIP">
358
358
  <fo:block/>
359
359
  </fo:list-item-label>
360
360
  <fo:list-item-body start-indent="body-start()" role="SKIP">
361
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm" role="SKIP">
361
+ <fo:block xsl:use-attribute-sets="toc-listof-item-style">
362
362
  <fo:basic-link internal-destination="{@id}">
363
363
  <xsl:call-template name="setAltText">
364
364
  <xsl:with-param name="value" select="@alt-text"/>
365
365
  </xsl:call-template>
366
366
  <xsl:apply-templates select="." mode="contents"/>
367
367
  <fo:inline keep-together.within-line="always" role="SKIP">
368
- <fo:leader leader-pattern="dots"/>
368
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
369
369
  <fo:inline role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
370
370
  </fo:inline>
371
371
  </fo:basic-link>
@@ -376,8 +376,8 @@
376
376
  </fo:block>
377
377
  </xsl:template>
378
378
 
379
- <xsl:template match="mn:preface//mn:clause[@type = 'toc']" priority="3">
380
- <fo:block-container font-weight="bold" line-height="115%" role="SKIP">
379
+ <xsl:template match="mn:preface//mn:clause[@type = 'toc']" name="toc" priority="3">
380
+ <fo:block-container xsl:use-attribute-sets="toc-style">
381
381
  <!-- render 'Contents' outside if role="TOC" -->
382
382
  <xsl:apply-templates select="mn:fmt-title"/>
383
383
  <fo:block role="TOC">
@@ -388,10 +388,9 @@
388
388
 
389
389
  <xsl:for-each select="$contents//mnx:item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
390
390
 
391
- <fo:block role="TOCI">
392
- <xsl:if test="@level = 1">
393
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
394
- </xsl:if>
391
+ <fo:block xsl:use-attribute-sets="toc-item-style">
392
+
393
+ <xsl:call-template name="refine_toc-item-style"/>
395
394
 
396
395
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section} {mnx:title}"> <!-- link at this level needs for PDF structure tags -->
397
396
  <fo:list-block role="SKIP">
@@ -413,7 +412,7 @@
413
412
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}" role="SKIP">
414
413
  <xsl:apply-templates select="mnx:title"/>
415
414
  <fo:inline keep-together.within-line="always" role="SKIP">
416
- <fo:leader leader-pattern="dots"/>
415
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
417
416
  <fo:inline role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
418
417
  </fo:inline>
419
418
  </fo:basic-link>
@@ -426,37 +425,31 @@
426
425
  </xsl:for-each>
427
426
 
428
427
  <!-- List of Tables -->
429
- <xsl:if test="$contents//mnx:tables/mnx:table">
430
- <xsl:call-template name="insertListOf_Title">
431
- <xsl:with-param name="title" select="$title-list-tables"/>
432
- </xsl:call-template>
433
- <xsl:for-each select="$contents//mnx:tables/mnx:table">
434
- <xsl:call-template name="insertListOf_Item"/>
435
- </xsl:for-each>
436
- </xsl:if>
428
+ <xsl:for-each select="$contents//mnx:tables/mnx:table">
429
+ <xsl:if test="position() = 1">
430
+ <xsl:call-template name="insertListOf_Title">
431
+ <xsl:with-param name="title" select="$title-list-tables"/>
432
+ </xsl:call-template>
433
+ </xsl:if>
434
+ <xsl:call-template name="insertListOf_Item"/>
435
+ </xsl:for-each>
437
436
 
438
437
  <!-- List of Figures -->
439
- <xsl:if test="$contents//mnx:figures/mnx:figure">
440
- <xsl:call-template name="insertListOf_Title">
441
- <xsl:with-param name="title" select="$title-list-figures"/>
442
- </xsl:call-template>
443
- <xsl:for-each select="$contents//mnx:figures/mnx:figure">
444
- <xsl:call-template name="insertListOf_Item"/>
445
- </xsl:for-each>
446
- </xsl:if>
438
+ <xsl:for-each select="$contents//mnx:figures/mnx:figure">
439
+ <xsl:if test="position() = 1">
440
+ <xsl:call-template name="insertListOf_Title">
441
+ <xsl:with-param name="title" select="$title-list-figures"/>
442
+ </xsl:call-template>
443
+ </xsl:if>
444
+ <xsl:call-template name="insertListOf_Item"/>
445
+ </xsl:for-each>
447
446
  </xsl:if>
448
447
  </fo:block>
449
448
  </fo:block-container>
450
449
  </xsl:template>
451
450
 
452
451
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']/mn:fmt-title" priority="3">
453
- <!-- <xsl:variable name="title-toc">
454
- <xsl:call-template name="getTitle">
455
- <xsl:with-param name="name" select="'title-toc'"/>
456
- </xsl:call-template>
457
- </xsl:variable> -->
458
- <fo:block font-size="14pt" margin-bottom="15.5pt" role="H1">
459
- <!-- <xsl:value-of select="$title-toc"/> -->
452
+ <fo:block xsl:use-attribute-sets="toc-title-style">
460
453
  <xsl:apply-templates/>
461
454
  </fo:block>
462
455
  </xsl:template>
@@ -5640,6 +5633,16 @@
5640
5633
  </xsl:variable>
5641
5634
  <xsl:variable name="quot">"</xsl:variable>
5642
5635
  <xsl:variable name="styles_">
5636
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
5637
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
5638
+ <style name="border-top">none</style>
5639
+ <style name="border-right">none</style>
5640
+ <style name="border-left">none</style>
5641
+ <style name="border-bottom">none</style>
5642
+ <style name="color">inherit</style>
5643
+ <style name="background-color">transparent</style>
5644
+ </xsl:if>
5645
+
5643
5646
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
5644
5647
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5645
5648
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
@@ -7635,7 +7638,10 @@
7635
7638
 
7636
7639
  <xsl:call-template name="setNamedDestination"/>
7637
7640
 
7638
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7641
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
7642
+ <xsl:if test="not(parent::mn:references)">
7643
+ <xsl:copy-of select="@id"/>
7644
+ </xsl:if>
7639
7645
 
7640
7646
  <xsl:call-template name="setBlockSpanAll"/>
7641
7647
 
@@ -10303,8 +10309,8 @@
10303
10309
  </xsl:template> <!-- bibitem -->
10304
10310
 
10305
10311
  <!-- Bibliography (non-normative references) -->
10306
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
10307
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first --> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
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 --> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
10308
10314
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
10309
10315
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
10310
10316
  <xsl:call-template name="setNamedDestination"/>
@@ -10356,7 +10362,7 @@
10356
10362
  </fo:list-item>
10357
10363
  </xsl:otherwise>
10358
10364
  </xsl:choose>
10359
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
10365
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
10360
10366
  <xsl:with-param name="skip">false</xsl:with-param>
10361
10367
  </xsl:apply-templates>
10362
10368
  </xsl:template>
@@ -10373,8 +10379,26 @@
10373
10379
  </xsl:apply-templates>
10374
10380
  <xsl:apply-templates select="mn:formattedref"/>
10375
10381
  <!-- end bibitem processing -->
10382
+
10383
+ <xsl:call-template name="processBibliographyNote"/>
10376
10384
  </xsl:template> <!-- processBibitem (bibitem) -->
10377
10385
 
10386
+ <xsl:template name="processBibliographyNote">
10387
+ <xsl:if test="self::mn:note">
10388
+ <xsl:variable name="note_node">
10389
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10390
+ <xsl:copy> <!-- skip @id -->
10391
+ <xsl:copy-of select="node()"/>
10392
+ </xsl:copy>
10393
+ </xsl:element>
10394
+ </xsl:variable>
10395
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
10396
+ <xsl:call-template name="note"/>
10397
+ </xsl:for-each> -->
10398
+ <xsl:call-template name="note"/>
10399
+ </xsl:if>
10400
+ </xsl:template>
10401
+
10378
10402
  <xsl:template match="mn:title" mode="title">
10379
10403
  <fo:inline><xsl:apply-templates/></fo:inline>
10380
10404
  </xsl:template>
@@ -10920,6 +10944,67 @@
10920
10944
  <!-- End Form's elements processing -->
10921
10945
  <!-- =================== -->
10922
10946
 
10947
+ <xsl:attribute-set name="toc-style">
10948
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
10949
+ <xsl:attribute name="line-height">115%</xsl:attribute>
10950
+ <xsl:attribute name="role">SKIP</xsl:attribute>
10951
+ </xsl:attribute-set>
10952
+
10953
+ <xsl:template name="refine_toc-style">
10954
+ </xsl:template>
10955
+
10956
+ <xsl:attribute-set name="toc-title-style">
10957
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
10958
+ <xsl:attribute name="margin-bottom">15.5pt</xsl:attribute>
10959
+ <xsl:attribute name="role">H1</xsl:attribute>
10960
+ </xsl:attribute-set>
10961
+
10962
+ <xsl:attribute-set name="toc-title-page-style">
10963
+ </xsl:attribute-set> <!-- toc-title-page-style -->
10964
+
10965
+ <xsl:attribute-set name="toc-item-block-style">
10966
+ </xsl:attribute-set>
10967
+
10968
+ <xsl:template name="refine_toc-item-block-style">
10969
+ </xsl:template>
10970
+
10971
+ <xsl:attribute-set name="toc-item-style">
10972
+ <xsl:attribute name="role">TOCI</xsl:attribute>
10973
+ </xsl:attribute-set> <!-- END: toc-item-style -->
10974
+
10975
+ <xsl:template name="refine_toc-item-style">
10976
+ <xsl:if test="@level = 1">
10977
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
10978
+ </xsl:if>
10979
+ </xsl:template> <!-- END: refine_toc-item-style -->
10980
+
10981
+ <xsl:attribute-set name="toc-leader-style">
10982
+ <xsl:attribute name="leader-pattern">dots</xsl:attribute>
10983
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
10984
+
10985
+ <xsl:attribute-set name="toc-pagenumber-style">
10986
+ </xsl:attribute-set>
10987
+
10988
+ <!-- List of Figures, Tables -->
10989
+ <xsl:attribute-set name="toc-listof-title-style">
10990
+ <xsl:attribute name="role">TOCI</xsl:attribute>
10991
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
10992
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10993
+ </xsl:attribute-set>
10994
+
10995
+ <xsl:attribute-set name="toc-listof-item-block-style">
10996
+ <xsl:attribute name="provisional-distance-between-starts">8mm</xsl:attribute>
10997
+ <xsl:attribute name="role">SKIP</xsl:attribute>
10998
+ </xsl:attribute-set>
10999
+
11000
+ <xsl:attribute-set name="toc-listof-item-style">
11001
+ <xsl:attribute name="role">TOCI</xsl:attribute>
11002
+ <xsl:attribute name="text-align-last">justify</xsl:attribute>
11003
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
11004
+ <xsl:attribute name="text-indent">-12mm</xsl:attribute>
11005
+ <xsl:attribute name="role">SKIP</xsl:attribute>
11006
+ </xsl:attribute-set>
11007
+
10923
11008
  <xsl:template name="processPrefaceSectionsDefault_Contents">
10924
11009
  <xsl:variable name="nodes_preface_">
10925
11010
  <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 Cc
3
- VERSION = "2.6.10".freeze
3
+ VERSION = "2.7.0".freeze
4
4
  end
5
5
  end
data/metanorma-cc.gemspec CHANGED
@@ -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-cc
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