metanorma-iec 2.8.1 → 2.8.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: c6defcf38222ffe2ca5af4f9369778ff3e879196a8bbde0c348d0c45f8a522d3
4
- data.tar.gz: f1ee1d7a0938499d67c20dedc74a3a88e6ee7064afc5ab186885784ce037417a
3
+ metadata.gz: c64bdf87681ec10077febc189e97626a27c0ad4f4dc1c5451e124e39fd6b690d
4
+ data.tar.gz: ac2c5f7cca5de90d6132a2b495fbf3cfdc8051d571d6d31df2299b4a0fb74d09
5
5
  SHA512:
6
- metadata.gz: 0dd0dc87b5fcd7caba2e46bbe57a66b8a1e126d78d7f2a5ef44f466afa70630aacc0495d2478f9a052117cb4452d2171f9b73ee4615c5013284dd86d4cfa918c
7
- data.tar.gz: 4a821ea60263a1f5a76be53b4732693e2e1e048ae7e927461691a7b077d7dbf32fdb3255bc28185ba579b7325657bd3533e286023ee54bc25b6e030bbec10d72
6
+ metadata.gz: fbe45a98f96ee98445773f2b1e8a84255210c3f692867002be724e536d34517307bb1ed8e69c2d42499d5e5e8fe1f4f2740acf8685536c6886b02270865af576
7
+ data.tar.gz: '0978d0d444231659059fbad63c0501c78c6675bc44e232b228715a8d0ab4e484e25aab202b130bc8dbb645a358964cdd81aca52d01e282fb6c247f2505f7e797'
@@ -319,6 +319,11 @@ svg {
319
319
  display: block; /* ← removes unwanted inline spacing */
320
320
  }
321
321
 
322
+ /* style dfn by override in flavor */
323
+ dfn {
324
+ font-style: inherit;
325
+ }
326
+
322
327
  #standard-band {
323
328
  background-color: #0AC442;
324
329
  }
@@ -1334,7 +1334,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1334
1334
  </xsl:call-template>
1335
1335
  <xsl:text> </xsl:text>
1336
1336
  <fo:inline keep-together.within-line="always" role="SKIP">
1337
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1337
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1338
1338
  <fo:inline role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
1339
1339
  </fo:inline>
1340
1340
  </fo:basic-link>
@@ -1370,7 +1370,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1370
1370
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{$alt_text}"> <!-- {local-name()} {@id} -->
1371
1371
  <xsl:apply-templates select="." mode="contents"/>
1372
1372
  <fo:inline keep-together.within-line="always" role="SKIP">
1373
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1373
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1374
1374
  <fo:wrapper role="artifact">
1375
1375
  <fo:page-number-citation ref-id="{@id}"/>
1376
1376
  </fo:wrapper>
@@ -1436,19 +1436,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1436
1436
 
1437
1437
  <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
1438
1438
 
1439
- <fo:page-sequence master-reference="document" format="1" force-page-count="no-force">
1440
-
1441
- <xsl:attribute name="master-reference">
1442
- <xsl:text>document</xsl:text>
1443
- <xsl:call-template name="getPageSequenceOrientation"/>
1444
- </xsl:attribute>
1445
-
1446
- <xsl:if test="position() = 1 and $num = '1'">
1447
- <xsl:attribute name="initial-page-number">2</xsl:attribute>
1448
- </xsl:if>
1449
- <xsl:if test="$isIEV = 'true'">
1450
- <xsl:attribute name="format">I</xsl:attribute>
1451
- </xsl:if>
1439
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
1440
+ <xsl:call-template name="refine_page-sequence-preface">
1441
+ <xsl:with-param name="num" select="$num"/>
1442
+ </xsl:call-template>
1452
1443
 
1453
1444
  <xsl:call-template name="insertHeaderFooter"/>
1454
1445
 
@@ -1469,16 +1460,8 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1469
1460
 
1470
1461
  <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
1471
1462
 
1472
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1473
-
1474
- <xsl:attribute name="master-reference">
1475
- <xsl:text>document</xsl:text>
1476
- <xsl:call-template name="getPageSequenceOrientation"/>
1477
- </xsl:attribute>
1478
-
1479
- <xsl:if test="position() = 1 and $isIEV = 'true'">
1480
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
1481
- </xsl:if>
1463
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
1464
+ <xsl:call-template name="refine_page-sequence-main"/>
1482
1465
 
1483
1466
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1484
1467
 
@@ -1859,7 +1842,9 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1859
1842
 
1860
1843
  <xsl:template match="mn:indexsect"/>
1861
1844
  <xsl:template match="mn:indexsect" mode="index">
1862
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1845
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
1846
+ <xsl:call-template name="refine_page-sequence-main"/>
1847
+
1863
1848
  <xsl:call-template name="insertHeaderFooter"/>
1864
1849
  <fo:flow flow-name="xsl-region-body">
1865
1850
  <fo:block id="{@id}" span="all">
@@ -2455,20 +2440,43 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
2455
2440
  </xsl:variable>
2456
2441
 
2457
2442
  <xsl:attribute-set name="page-sequence-preface">
2458
- <xsl:attribute name="format">i</xsl:attribute>
2459
- </xsl:attribute-set>
2443
+ <xsl:attribute name="format">1</xsl:attribute>
2444
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
2445
+ <xsl:attribute name="master-reference">document</xsl:attribute>
2446
+ </xsl:attribute-set> <!-- page-sequence-preface -->
2460
2447
 
2461
2448
  <xsl:template name="refine_page-sequence-preface">
2462
2449
  <xsl:param name="layoutVersion"/>
2463
- </xsl:template>
2450
+ <xsl:param name="doctype"/>
2451
+ <xsl:param name="num"/>
2452
+ <xsl:param name="skip_force_page_count">false</xsl:param>
2453
+ <xsl:attribute name="master-reference">
2454
+ <xsl:text>document</xsl:text>
2455
+ <xsl:call-template name="getPageSequenceOrientation"/>
2456
+ </xsl:attribute>
2457
+ <xsl:if test="position() = 1 and $num = '1'">
2458
+ <xsl:attribute name="initial-page-number">2</xsl:attribute>
2459
+ </xsl:if>
2460
+ <xsl:if test="$isIEV = 'true'">
2461
+ <xsl:attribute name="format">I</xsl:attribute>
2462
+ </xsl:if>
2463
+ </xsl:template> <!-- refine_page-sequence-preface -->
2464
2464
 
2465
2465
  <xsl:attribute-set name="page-sequence-main">
2466
-
2467
- </xsl:attribute-set>
2466
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
2467
+ </xsl:attribute-set> <!-- page-sequence-main -->
2468
2468
 
2469
2469
  <xsl:template name="refine_page-sequence-main">
2470
2470
  <xsl:param name="layoutVersion"/>
2471
- </xsl:template>
2471
+ <xsl:param name="doctype"/>
2472
+ <xsl:attribute name="master-reference">
2473
+ <xsl:text>document</xsl:text>
2474
+ <xsl:call-template name="getPageSequenceOrientation"/>
2475
+ </xsl:attribute>
2476
+ <xsl:if test="position() = 1 and $isIEV = 'true' and not(self::mn:indexsect)">
2477
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
2478
+ </xsl:if>
2479
+ </xsl:template> <!-- refine_page-sequence-main -->
2472
2480
 
2473
2481
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
2474
2482
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -13374,6 +13382,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
13374
13382
  </xsl:attribute-set>
13375
13383
 
13376
13384
  <xsl:template name="refine_toc-style">
13385
+ <xsl:copy-of select="@id"/>
13377
13386
  </xsl:template>
13378
13387
 
13379
13388
  <xsl:attribute-set name="toc-title-style">
@@ -13477,13 +13486,13 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
13477
13486
 
13478
13487
  <xsl:template name="processPrefaceSectionsDefault_Contents">
13479
13488
  <xsl:variable name="nodes_preface_">
13480
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
13489
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
13481
13490
  <node id="{@id}"/>
13482
13491
  </xsl:for-each>
13483
13492
  </xsl:variable>
13484
13493
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
13485
13494
 
13486
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
13495
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
13487
13496
  <xsl:sort select="@displayorder" data-type="number"/>
13488
13497
 
13489
13498
  <!-- process Section's title -->
@@ -13496,6 +13505,23 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
13496
13505
  </xsl:for-each>
13497
13506
  </xsl:template>
13498
13507
 
13508
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
13509
+ <xsl:variable name="title">
13510
+ <xsl:call-template name="getName"/>
13511
+ </xsl:variable>
13512
+ <xsl:variable name="root">
13513
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
13514
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
13515
+ </xsl:variable>
13516
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
13517
+ <mnx:title>
13518
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
13519
+ <xsl:with-param name="element" select="$root"/>
13520
+ </xsl:apply-templates>
13521
+ </mnx:title>
13522
+ </mnx:item>
13523
+ </xsl:template>
13524
+
13499
13525
  <xsl:template name="processMainSectionsDefault_Contents">
13500
13526
 
13501
13527
  <xsl:variable name="nodes_sections_">
@@ -15319,16 +15345,17 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
15319
15345
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
15320
15346
  <xsl:template name="insert_basic_link">
15321
15347
  <xsl:param name="element"/>
15348
+ <xsl:param name="wrapper">true</xsl:param>
15322
15349
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
15323
15350
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
15324
15351
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
15325
15352
  <xsl:choose>
15326
- <xsl:when test="$internal-destination = 'true'">
15353
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
15327
15354
  <fo:wrapper role="Reference">
15328
15355
  <xsl:copy-of select="$element_node"/>
15329
15356
  </fo:wrapper>
15330
15357
  </xsl:when>
15331
- <xsl:when test="$external-destination = 'true'">
15358
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
15332
15359
  <xsl:copy-of select="$element_node"/>
15333
15360
  </xsl:when>
15334
15361
  <xsl:otherwise>
@@ -1939,10 +1939,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1939
1939
  <value>hasAnnotation</value>
1940
1940
  <value>draftOf</value>
1941
1941
  <value>hasDraft</value>
1942
- <value>preliminaryDraftOf</value>
1943
- <value>hasPreliminaryDraft</value>
1944
- <value>revisionDraftOf</value>
1945
- <value>hasRevisionDraft</value>
1942
+ <value>predecessorDraftOf</value>
1943
+ <value>hasPredecessorDraft</value>
1944
+ <value>successorDraftOf</value>
1945
+ <value>hasSuccessorDraft</value>
1946
1946
  <value>editionOf</value>
1947
1947
  <value>hasEdition</value>
1948
1948
  <value>updates</value>
@@ -641,8 +641,85 @@ This is done if the footnote reference is already presented in some other form,
641
641
  </ref>
642
642
  </zeroOrMore>
643
643
  </define>
644
+ <define name="altsource">
645
+ <a:documentation>Alternative file to use as media</a:documentation>
646
+ <element name="altsource">
647
+ <ref name="MediaAttributes"/>
648
+ <optional>
649
+ <attribute name="tag">
650
+ <a:documentation>Comma-delimited tag to indicate when the alternate file is to be used,
651
+ at minimum allows contain `html`, `doc`, `pdf` as the main target formats of Metanorma,
652
+ and `default` for the fallback. The presence of an altsource tagged `default` is required</a:documentation>
653
+ </attribute>
654
+ </optional>
655
+ <optional>
656
+ <attribute name="media">
657
+ <a:documentation>CSS media query to indicate when the alternate file is to be used</a:documentation>
658
+ </attribute>
659
+ </optional>
660
+ </element>
661
+ </define>
662
+ <define name="image">
663
+ <a:documentation>Container for image content</a:documentation>
664
+ <choice>
665
+ <element name="image">
666
+ <ref name="RequiredId"/>
667
+ <ref name="ImageAttributes">
668
+ <a:documentation>When specified along with altsource, ImageAttributes give the default image to be rendered</a:documentation>
669
+ </ref>
670
+ <ref name="ImageBody"/>
671
+ </element>
672
+ <element name="svg">
673
+ <a:documentation>Add svg mark up to image</a:documentation>
674
+ <oneOrMore>
675
+ <choice>
676
+ <text/>
677
+ <ref name="AnyElement"/>
678
+ </choice>
679
+ </oneOrMore>
680
+ </element>
681
+ </choice>
682
+ </define>
683
+ <define name="ImageAttributes">
684
+ <optional>
685
+ <ref name="MediaAttributes">
686
+ <a:documentation>If the image contains altsource, the media attributes are given on each of the altsource elements instead of the root node</a:documentation>
687
+ </ref>
688
+ </optional>
689
+ <ref name="MediaAccessibilityAttributes"/>
690
+ <optional>
691
+ <attribute name="width">
692
+ <a:documentation>Height of image</a:documentation>
693
+ <ref name="ImageSize"/>
694
+ </attribute>
695
+ </optional>
696
+ <optional>
697
+ <attribute name="height">
698
+ <a:documentation>Width of image</a:documentation>
699
+ <ref name="ImageSize"/>
700
+ </attribute>
701
+ </optional>
702
+ </define>
644
703
  </include>
645
704
  <!-- end overrides -->
705
+ <define name="ImageBody">
706
+ <optional>
707
+ <element name="svg">
708
+ <a:documentation>image can contain SVG XML, which is used to access its identifiers within the Metanorma XML</a:documentation>
709
+ <oneOrMore>
710
+ <choice>
711
+ <text/>
712
+ <ref name="AnyElement"/>
713
+ </choice>
714
+ </oneOrMore>
715
+ </element>
716
+ </optional>
717
+ <zeroOrMore>
718
+ <ref name="altsource">
719
+ <a:documentation>Alternative files to use as media</a:documentation>
720
+ </ref>
721
+ </zeroOrMore>
722
+ </define>
646
723
  <define name="key">
647
724
  <a:documentation>Key to a table, figure, or formula</a:documentation>
648
725
  <element name="key">
@@ -930,34 +1007,6 @@ titlecase, or lowercase</a:documentation>
930
1007
  <ref name="ReducedBibliographicItem"/>
931
1008
  </element>
932
1009
  </define>
933
- <define name="image" combine="choice">
934
- <choice>
935
- <element name="image">
936
- <ref name="RequiredId"/>
937
- <ref name="ImageAttributes"/>
938
- <optional>
939
- <element name="svg">
940
- <a:documentation>Allow svg in image/svg, for consistency</a:documentation>
941
- <oneOrMore>
942
- <choice>
943
- <text/>
944
- <ref name="AnyElement"/>
945
- </choice>
946
- </oneOrMore>
947
- </element>
948
- </optional>
949
- </element>
950
- <element name="svg">
951
- <a:documentation>Add svg mark up to image</a:documentation>
952
- <oneOrMore>
953
- <choice>
954
- <text/>
955
- <ref name="AnyElement"/>
956
- </choice>
957
- </oneOrMore>
958
- </element>
959
- </choice>
960
- </define>
961
1010
  <define name="ParagraphFnBody" combine="interleave">
962
1011
  <ref name="BlockSource">
963
1012
  <a:documentation>Bibliographic source for the information in the paragraph
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.8.1".freeze
3
+ VERSION = "2.8.2".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-02 00:00:00.000000000 Z
11
+ date: 2026-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso