metanorma-ribose 2.8.1 → 2.8.3

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: d0bd3dfdc7c8e1fa480a67bfed8b12b902f4f3aec39330c04316ba6aee526dc5
4
- data.tar.gz: f8ae40d15422184e3f4d5746f31fa5a54c2bb8f323747a5a84cb04f07e1b37ff
3
+ metadata.gz: fa900719fa5ce68ae05ad7681eca4ef1c45677fd675dcaf1e8977de6c5d25701
4
+ data.tar.gz: 566f33f03a3de079dae0b6f588553e9c2907d354349d647527836991017acb0a
5
5
  SHA512:
6
- metadata.gz: 200daf8c84ade837bf5bdcde6ffd06283960b6b561479bd5bf7015199ac329f8baa83c9fa1dda3a5a4a2717af6723a64e71680890fe9f6374240b267871c04b4
7
- data.tar.gz: aa32f27c72fd0838a26f446c4768c0334bc1a1839e13e5cda889302f00f08a98b03b79d38a4d5264054883ee0d610d583a330e855419f8b966726dc0f54d0449
6
+ metadata.gz: bc70150e86130da1443f8b255cf1cbe8e9758502510b756e58693fbaf6e684daf3fc74987faf20746b29d579f5f38d54cff89de68f2072ae73a607f10f454013
7
+ data.tar.gz: bc7daaacf3b65fcf6b153e1000ae3509b0132896586b7dd1b10069e203520d185d52e95460bbfe8f36009a436e2b4abbdd43a382c2eec0ae083daf355fc72b00
@@ -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
  }
@@ -15,7 +15,7 @@ module IsoDoc
15
15
  elem.replace(l10n("<strong>#{@i18n.source}</strong>: #{sources}"))
16
16
  end
17
17
 
18
- def designation_boldface(desgn); end
18
+ def designation_expression_boldface(desgn, name); end
19
19
 
20
20
  def preface_rearrange(doc)
21
21
  preface_move(doc.xpath(ns("//preface/abstract")),
@@ -19,12 +19,12 @@
19
19
 
20
20
  <xsl:variable name="contents_">
21
21
  <mnx:contents>
22
-
22
+ <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:clause[@type = 'toc']" mode="contents"/>
23
23
  <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:abstract" mode="contents"/>
24
24
  <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:foreword" mode="contents"/>
25
25
  <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:executivesummary" mode="contents"/>
26
26
  <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:introduction" mode="contents"/>
27
- <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:clause" mode="contents"/>
27
+ <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:clause[not(@type = 'toc')]" mode="contents"/>
28
28
  <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:acknowledgements" mode="contents"/>
29
29
 
30
30
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
@@ -250,7 +250,7 @@
250
250
  </xsl:variable>
251
251
 
252
252
  <xsl:if test="normalize-space($toc_and_boilerplate) != ''">
253
- <fo:page-sequence master-reference="document" force-page-count="no-force"> <!-- master-reference="toc" -->
253
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main"> <!-- master-reference="toc" -->
254
254
  <xsl:call-template name="insertHeaderFooter">
255
255
  <xsl:with-param name="section">toc</xsl:with-param>
256
256
  </xsl:call-template>
@@ -273,9 +273,8 @@
273
273
 
274
274
  <xsl:for-each select=".//mn:page_sequence[normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
275
275
 
276
- <xsl:variable name="page_orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:variable>
277
-
278
- <fo:page-sequence master-reference="document{$page_orientation}" force-page-count="no-force">
276
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
277
+ <xsl:call-template name="refine_page-sequence-main"/>
279
278
 
280
279
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
281
280
 
@@ -510,9 +509,9 @@
510
509
  </xsl:call-template>
511
510
  <xsl:apply-templates select="." mode="contents"/>
512
511
  <xsl:text>  </xsl:text>
513
- <fo:inline>
514
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
515
- <fo:inline xsl:use-attribute-sets="toc-pagenumber-style"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
512
+ <fo:inline role="SKIP">
513
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
514
+ <fo:inline xsl:use-attribute-sets="toc-pagenumber-style"><fo:page-number-citation ref-id="{@id}" role="SKIP"/></fo:inline> <!-- <fo:wrapper role="artifact"> </fo:wrapper> -->
516
515
  </fo:inline>
517
516
  </fo:basic-link>
518
517
  </fo:block>
@@ -523,6 +522,7 @@
523
522
 
524
523
  <xsl:template match="mn:preface/mn:clause[@type = 'toc']" name="toc" priority="3">
525
524
  <fo:block role="SKIP">
525
+ <xsl:copy-of select="@id"/>
526
526
  <xsl:apply-templates/>
527
527
 
528
528
  <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
@@ -531,38 +531,42 @@
531
531
 
532
532
  <fo:block-container xsl:use-attribute-sets="toc-style">
533
533
  <fo:block-container xsl:use-attribute-sets="reset-margins-style">
534
- <xsl:for-each select="$contents//mnx:item[@display = 'true']">
535
- <fo:block xsl:use-attribute-sets="toc-item-style">
536
-
537
- <xsl:call-template name="refine_toc-item-style"/>
538
-
539
- <fo:block text-align-last="justify" role="SKIP">
540
- <fo:inline role="Lbl"><xsl:value-of select="@section"/></fo:inline>
541
- <fo:wrapper role="Reference">
542
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
543
- <xsl:if test="@section != ''">
544
- <xsl:text> </xsl:text>
545
- </xsl:if>
546
- <xsl:apply-templates select="mnx:title"/>
547
- <xsl:text>  </xsl:text>
548
- <fo:inline role="SKIP">
549
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
550
- <fo:inline xsl:use-attribute-sets="toc-pagenumber-style"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
551
- </fo:inline>
552
- </fo:basic-link>
553
- </fo:wrapper>
534
+ <fo:block role="TOC">
535
+ <xsl:for-each select="$contents//mnx:item[@display = 'true']">
536
+ <fo:block xsl:use-attribute-sets="toc-item-style">
537
+
538
+ <xsl:call-template name="refine_toc-item-style"/>
539
+
540
+ <fo:block text-align-last="justify" role="SKIP">
541
+ <fo:inline role="Lbl"><xsl:value-of select="@section"/></fo:inline>
542
+ <fo:wrapper role="Reference">
543
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
544
+ <xsl:if test="@section != ''">
545
+ <xsl:text> </xsl:text>
546
+ </xsl:if>
547
+ <xsl:apply-templates select="mnx:title"/>
548
+ <xsl:text>  </xsl:text>
549
+ <fo:inline role="SKIP">
550
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
551
+ <fo:inline xsl:use-attribute-sets="toc-pagenumber-style"><fo:page-number-citation ref-id="{@id}" role="SKIP"/></fo:inline> <!-- <fo:wrapper role="artifact"> </fo:wrapper> -->
552
+ </fo:inline>
553
+ </fo:basic-link>
554
+ </fo:wrapper>
555
+ </fo:block>
554
556
  </fo:block>
555
- </fo:block>
556
- </xsl:for-each>
557
+ </xsl:for-each>
558
+ </fo:block>
557
559
 
558
560
  <!-- List of Tables -->
559
561
  <xsl:if test="$contents//mnx:tables/mnx:table">
560
562
  <xsl:call-template name="insertListOf_Title">
561
563
  <xsl:with-param name="title" select="$title-list-tables"/>
562
564
  </xsl:call-template>
563
- <xsl:for-each select="$contents//mnx:tables/mnx:table">
564
- <xsl:call-template name="insertListOf_Item"/>
565
- </xsl:for-each>
565
+ <fo:block role="TOC">
566
+ <xsl:for-each select="$contents//mnx:tables/mnx:table">
567
+ <xsl:call-template name="insertListOf_Item"/>
568
+ </xsl:for-each>
569
+ </fo:block>
566
570
  </xsl:if>
567
571
 
568
572
  <!-- List of Figures -->
@@ -570,9 +574,11 @@
570
574
  <xsl:call-template name="insertListOf_Title">
571
575
  <xsl:with-param name="title" select="$title-list-figures"/>
572
576
  </xsl:call-template>
573
- <xsl:for-each select="$contents//mnx:figures/mnx:figure">
574
- <xsl:call-template name="insertListOf_Item"/>
575
- </xsl:for-each>
577
+ <fo:block role="TOC">
578
+ <xsl:for-each select="$contents//mnx:figures/mnx:figure">
579
+ <xsl:call-template name="insertListOf_Item"/>
580
+ </xsl:for-each>
581
+ </fo:block>
576
582
  </xsl:if>
577
583
 
578
584
  </fo:block-container>
@@ -581,7 +587,7 @@
581
587
  <fo:block break-after="page"/>
582
588
  </xsl:if>
583
589
  </xsl:if>
584
- <fo:block margin-bottom="12pt"> </fo:block>
590
+ <fo:block margin-bottom="12pt" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
585
591
  </fo:block>
586
592
  </xsl:template>
587
593
 
@@ -648,6 +654,9 @@
648
654
  <xsl:variable name="title">
649
655
  <xsl:call-template name="getName"/>
650
656
  </xsl:variable>
657
+ <xsl:variable name="variant_title">
658
+ <xsl:copy-of select="mn:variant-title[@type = 'toc']/node()"/>
659
+ </xsl:variable>
651
660
 
652
661
  <xsl:variable name="type" select="local-name()"/>
653
662
 
@@ -656,7 +665,14 @@
656
665
  <xsl:attribute name="level">1</xsl:attribute>
657
666
  </xsl:if>
658
667
  <mnx:title>
659
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
668
+ <xsl:choose>
669
+ <xsl:when test="normalize-space($variant_title) != ''">
670
+ <xsl:apply-templates select="xalan:nodeset($variant_title)" mode="contents_item"/>
671
+ </xsl:when>
672
+ <xsl:otherwise>
673
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
674
+ </xsl:otherwise>
675
+ </xsl:choose>
660
676
  </mnx:title>
661
677
  <xsl:if test="$type != 'indexsect'">
662
678
  <xsl:apply-templates mode="contents"/>
@@ -1510,20 +1526,25 @@
1510
1526
  </xsl:variable>
1511
1527
 
1512
1528
  <xsl:attribute-set name="page-sequence-preface">
1513
- <xsl:attribute name="format">i</xsl:attribute>
1514
- </xsl:attribute-set>
1529
+ </xsl:attribute-set> <!-- page-sequence-preface -->
1515
1530
 
1516
1531
  <xsl:template name="refine_page-sequence-preface">
1517
1532
  <xsl:param name="layoutVersion"/>
1518
- </xsl:template>
1533
+ <xsl:param name="doctype"/>
1534
+ <xsl:param name="num"/>
1535
+ <xsl:param name="skip_force_page_count">false</xsl:param>
1536
+ </xsl:template> <!-- refine_page-sequence-preface -->
1519
1537
 
1520
1538
  <xsl:attribute-set name="page-sequence-main">
1521
-
1522
- </xsl:attribute-set>
1539
+ <xsl:attribute name="master-reference">document</xsl:attribute>
1540
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
1541
+ </xsl:attribute-set> <!-- page-sequence-main -->
1523
1542
 
1524
1543
  <xsl:template name="refine_page-sequence-main">
1525
1544
  <xsl:param name="layoutVersion"/>
1526
- </xsl:template>
1545
+ <xsl:param name="doctype"/>
1546
+ <xsl:attribute name="master-reference">document<xsl:call-template name="getPageSequenceOrientation"/></xsl:attribute>
1547
+ </xsl:template> <!-- refine_page-sequence-main -->
1527
1548
 
1528
1549
  <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>
1529
1550
  <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>
@@ -1830,7 +1851,24 @@
1830
1851
  <xsl:template match="mn:metanorma-extension/*[local-name() = 'UnitsML']" mode="update_xml_step1"/>
1831
1852
 
1832
1853
  <!-- remove image/emf -->
1833
- <xsl:template match="mn:image/mn:emf" mode="update_xml_step1"/>
1854
+ <xsl:template match="mn:image//mn:emf" mode="update_xml_step1"/>
1855
+
1856
+ <!-- https://github.com/metanorma/metanorma/issues/540 -->
1857
+ <xsl:template match="mn:image[mn:altsource]" priority="3" mode="update_xml_step1">
1858
+ <xsl:copy>
1859
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
1860
+ <xsl:choose>
1861
+ <xsl:when test="mn:altsource[contains(@tag, 'pdf')]">
1862
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/@*" mode="update_xml_step1"/>
1863
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/node()" mode="update_xml_step1"/>
1864
+ </xsl:when>
1865
+ <xsl:otherwise>
1866
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/@*" mode="update_xml_step1"/>
1867
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/node()" mode="update_xml_step1"/>
1868
+ </xsl:otherwise>
1869
+ </xsl:choose>
1870
+ </xsl:copy>
1871
+ </xsl:template>
1834
1872
 
1835
1873
  <!-- remove preprocess-xslt -->
1836
1874
  <xsl:template match="mn:preprocess-xslt" mode="update_xml_step1"/>
@@ -2058,6 +2096,15 @@
2058
2096
  </xsl:choose>
2059
2097
  </xsl:template>
2060
2098
 
2099
+ <!-- https://github.com/metanorma/metanorma-iso/issues/1535 -->
2100
+ <xsl:template match="mn:ol[mn:fmt-ol]" mode="update_xml_step1">
2101
+ <xsl:apply-templates select="mn:fmt-ol" mode="update_xml_step1"/>
2102
+ </xsl:template>
2103
+
2104
+ <xsl:template match="mn:ul[mn:fmt-ul]" mode="update_xml_step1">
2105
+ <xsl:apply-templates select="mn:fmt-ul" mode="update_xml_step1"/>
2106
+ </xsl:template>
2107
+
2061
2108
  <!-- li/fmt-name -->
2062
2109
  <xsl:template match="mn:li/mn:fmt-name" priority="2" mode="update_xml_step1">
2063
2110
  <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
@@ -5409,6 +5456,8 @@
5409
5456
  <xsl:param name="margin-side"/>
5410
5457
 
5411
5458
  <xsl:call-template name="setBordersTableArray"/>
5459
+
5460
+ <xsl:call-template name="setNoBordersForTableList"/>
5412
5461
  </xsl:template> <!-- refine_table-style -->
5413
5462
 
5414
5463
  <xsl:attribute-set name="table-number-style">
@@ -5454,12 +5503,16 @@
5454
5503
  <xsl:template name="refine_table-header-row-style">
5455
5504
 
5456
5505
  <xsl:call-template name="setBordersTableArray"/>
5506
+
5507
+ <xsl:call-template name="setNoBordersForTableList"/>
5457
5508
  </xsl:template> <!-- refine_table-header-row-style -->
5458
5509
 
5459
5510
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
5460
5511
  </xsl:attribute-set>
5461
5512
 
5462
5513
  <xsl:template name="refine_table-footer-row-style">
5514
+
5515
+ <xsl:call-template name="setNoBordersForTableList"/>
5463
5516
  </xsl:template> <!-- refine_table-footer-row-style -->
5464
5517
 
5465
5518
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
@@ -5473,6 +5526,8 @@
5473
5526
  <xsl:if test="$number mod 2 = 0">
5474
5527
  <xsl:attribute name="background-color">rgb(254, 247, 228)</xsl:attribute>
5475
5528
  </xsl:if>
5529
+
5530
+ <xsl:call-template name="setNoBordersForTableList"/>
5476
5531
  </xsl:template> <!-- refine_table-body-row-style -->
5477
5532
 
5478
5533
  <xsl:attribute-set name="table-header-cell-style">
@@ -5493,6 +5548,16 @@
5493
5548
  </xsl:if>
5494
5549
 
5495
5550
  <xsl:call-template name="setTableCellAttributes"/>
5551
+
5552
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5553
+ <xsl:attribute name="display-align">before</xsl:attribute>
5554
+ <xsl:attribute name="text-align">left</xsl:attribute>
5555
+ <xsl:if test="following-sibling::*">
5556
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
5557
+ </xsl:if>
5558
+ <xsl:call-template name="setNoBordersForTableList"/>
5559
+ </xsl:if>
5560
+
5496
5561
  </xsl:template> <!-- refine_table-header-cell-style -->
5497
5562
 
5498
5563
  <xsl:attribute-set name="table-cell-style">
@@ -5511,6 +5576,15 @@
5511
5576
 
5512
5577
  <xsl:call-template name="setBordersTableArray"/>
5513
5578
 
5579
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5580
+ <xsl:attribute name="display-align">before</xsl:attribute>
5581
+ <xsl:attribute name="text-align">left</xsl:attribute>
5582
+ <xsl:if test="following-sibling::*">
5583
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
5584
+ </xsl:if>
5585
+ <xsl:call-template name="setNoBordersForTableList"/>
5586
+ </xsl:if>
5587
+
5514
5588
  </xsl:template> <!-- refine_table-cell-style -->
5515
5589
 
5516
5590
  <xsl:attribute-set name="table-footer-cell-style">
@@ -5522,6 +5596,8 @@
5522
5596
  </xsl:attribute-set> <!-- table-footer-cell-style -->
5523
5597
 
5524
5598
  <xsl:template name="refine_table-footer-cell-style">
5599
+
5600
+ <xsl:call-template name="setNoBordersForTableList"/>
5525
5601
  </xsl:template> <!-- refine_table-footer-cell-style -->
5526
5602
 
5527
5603
  <xsl:attribute-set name="table-note-style">
@@ -5560,6 +5636,16 @@
5560
5636
  <xsl:template name="refine_table-fn-body-style">
5561
5637
  </xsl:template>
5562
5638
 
5639
+ <xsl:template name="setNoBordersForTableList">
5640
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
5641
+ <xsl:attribute name="border">none</xsl:attribute>
5642
+ <xsl:attribute name="border-top">none</xsl:attribute>
5643
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
5644
+ <xsl:attribute name="border-left">none</xsl:attribute>
5645
+ <xsl:attribute name="border-right">none</xsl:attribute>
5646
+ </xsl:if>
5647
+ </xsl:template>
5648
+
5563
5649
  <!-- ========================== -->
5564
5650
  <!-- END Table styles -->
5565
5651
  <!-- ========================== -->
@@ -11153,6 +11239,10 @@
11153
11239
  </fo:list-item>
11154
11240
  </xsl:template>
11155
11241
 
11242
+ <xsl:template match="mn:fmt-ol | mn:fmt-ul">
11243
+ <xsl:apply-templates/>
11244
+ </xsl:template>
11245
+
11156
11246
  <!-- ===================================== -->
11157
11247
  <!-- END Lists processing -->
11158
11248
  <!-- ===================================== -->
@@ -12524,10 +12614,11 @@
12524
12614
  <xsl:attribute-set name="toc-style">
12525
12615
  <xsl:attribute name="margin-left">10mm</xsl:attribute> <!-- 32mm -->
12526
12616
  <xsl:attribute name="margin-right">-17mm</xsl:attribute>
12527
- <xsl:attribute name="role">TOC</xsl:attribute>
12617
+ <xsl:attribute name="role">SKIP</xsl:attribute> <!-- TOC -->
12528
12618
  </xsl:attribute-set>
12529
12619
 
12530
12620
  <xsl:template name="refine_toc-style">
12621
+ <xsl:copy-of select="@id"/>
12531
12622
  </xsl:template>
12532
12623
 
12533
12624
  <xsl:attribute-set name="toc-title-style">
@@ -12595,7 +12686,7 @@
12595
12686
  <!-- List of Figures, Tables -->
12596
12687
  <xsl:attribute-set name="toc-listof-title-style">
12597
12688
  <!-- <xsl:attribute name="font-size">13pt</xsl:attribute> -->
12598
- <xsl:attribute name="role">TOCI</xsl:attribute>
12689
+ <xsl:attribute name="role">H2</xsl:attribute> <!-- TOCI -->
12599
12690
  <xsl:attribute name="font-weight">bold</xsl:attribute>
12600
12691
  <xsl:attribute name="color">black</xsl:attribute>
12601
12692
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -12624,13 +12715,13 @@
12624
12715
 
12625
12716
  <xsl:template name="processPrefaceSectionsDefault_Contents">
12626
12717
  <xsl:variable name="nodes_preface_">
12627
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
12718
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
12628
12719
  <node id="{@id}"/>
12629
12720
  </xsl:for-each>
12630
12721
  </xsl:variable>
12631
12722
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
12632
12723
 
12633
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
12724
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
12634
12725
  <xsl:sort select="@displayorder" data-type="number"/>
12635
12726
 
12636
12727
  <!-- process Section's title -->
@@ -12643,6 +12734,23 @@
12643
12734
  </xsl:for-each>
12644
12735
  </xsl:template>
12645
12736
 
12737
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
12738
+ <xsl:variable name="title">
12739
+ <xsl:call-template name="getName"/>
12740
+ </xsl:variable>
12741
+ <xsl:variable name="root">
12742
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
12743
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
12744
+ </xsl:variable>
12745
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
12746
+ <mnx:title>
12747
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
12748
+ <xsl:with-param name="element" select="$root"/>
12749
+ </xsl:apply-templates>
12750
+ </mnx:title>
12751
+ </mnx:item>
12752
+ </xsl:template>
12753
+
12646
12754
  <xsl:template name="processMainSectionsDefault_Contents">
12647
12755
 
12648
12756
  <xsl:variable name="nodes_sections_">
@@ -14431,16 +14539,17 @@
14431
14539
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
14432
14540
  <xsl:template name="insert_basic_link">
14433
14541
  <xsl:param name="element"/>
14542
+ <xsl:param name="wrapper">true</xsl:param>
14434
14543
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
14435
14544
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
14436
14545
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
14437
14546
  <xsl:choose>
14438
- <xsl:when test="$internal-destination = 'true'">
14547
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
14439
14548
  <fo:wrapper role="Reference">
14440
14549
  <xsl:copy-of select="$element_node"/>
14441
14550
  </fo:wrapper>
14442
14551
  </xsl:when>
14443
- <xsl:when test="$external-destination = 'true'">
14552
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
14444
14553
  <xsl:copy-of select="$element_node"/>
14445
14554
  </xsl:when>
14446
14555
  <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,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.8.1".freeze
3
+ VERSION = "2.8.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-02 00:00:00.000000000 Z
11
+ date: 2026-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic