metanorma-taste 1.0.6 → 1.0.9

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: b07fd4851e26f9aa3e52870f2863ba1d30c605f6dec42ce2e341d8feb37f3cee
4
- data.tar.gz: cc243766aa2d1fa5749b2aad24da9b0f0876d488892cc6f717318db195bac2a6
3
+ metadata.gz: 6a3e9f97884e009d35840d3d18f05fdba70e00e188a61103a3ae7389adefde6c
4
+ data.tar.gz: 4eb73ea8e02b601860f40be9feb1eb430d6f403fd6074cd074f498fc5ea0c146
5
5
  SHA512:
6
- metadata.gz: f1219319dd5b58afabefbd1dce78aaa65e314442f32eb0681e26c6887c2644bc8407ed81c3fa9b42363c4020a7bac1c42fbd7dfc8cced49ad19de017fc82c993
7
- data.tar.gz: 2a5ad6f65678e7601af19008f2ed070c353fab70409fd11e509825b6df0e69bcb6a67aa8fe2d3f17a3edcabb6bb7ab57011d183c0bc5323a34bdadc240e5b40c
6
+ metadata.gz: 66bfb74954c81cfff671623f411ebb653622a0dff14b2698ecb84afea01ed7d4fafc2c09def624c5a5f10dda0b239cc1657cb7b5387891d30644cd8f6c6a04d0
7
+ data.tar.gz: 65d92ed5ebb3d5766fe7e16e35ac0807280c55b513447dc0f73a822d788999272047a0adb9f497642cf4bf4be50aafddefe3bec947068bb396a387eee17fb499
data/Gemfile CHANGED
@@ -10,7 +10,6 @@ group :development do
10
10
  gem "canon"
11
11
  gem "debug"
12
12
  gem "equivalent-xml", "~> 0.6"
13
- gem "logger", "1.6.6"
14
13
  gem "metanorma"
15
14
  gem "metanorma-cli"
16
15
  gem "metanorma-generic", ">= 3.4.0"
@@ -445,6 +445,19 @@
445
445
  </xsl:for-each>
446
446
  </fo:block>
447
447
  </xsl:if>
448
+
449
+ <!-- List of Examples -->
450
+ <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
451
+ <xsl:call-template name="insertListOf_Title">
452
+ <xsl:with-param name="title" select="$title-list-examples"/>
453
+ </xsl:call-template>
454
+ <fo:block role="TOC">
455
+ <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
456
+ <xsl:call-template name="insertListOf_Item"/>
457
+ </xsl:for-each>
458
+ </fo:block>
459
+ </xsl:if>
460
+
448
461
  </fo:block>
449
462
  </xsl:if>
450
463
  </fo:block-container>
@@ -455,6 +468,7 @@
455
468
 
456
469
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']/mn:fmt-title" priority="3">
457
470
  <fo:block xsl:use-attribute-sets="toc-title-style">
471
+ <xsl:call-template name="refine_toc-title-style"/>
458
472
  <xsl:apply-templates/>
459
473
  </fo:block>
460
474
  </xsl:template>
@@ -893,6 +907,16 @@
893
907
  </xsl:if>
894
908
  </xsl:variable>
895
909
 
910
+ <xsl:variable name="title-list-examples">
911
+ <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
912
+ <xsl:value-of select="$toc_example_title"/>
913
+ <xsl:if test="normalize-space($toc_example_title) = ''">
914
+ <xsl:call-template name="getLocalizedString">
915
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
916
+ </xsl:call-template>
917
+ </xsl:if>
918
+ </xsl:variable>
919
+
896
920
  <xsl:variable name="title-list-recommendations">
897
921
  <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
898
922
  <xsl:value-of select="$toc_requirement_title"/>
@@ -1765,6 +1789,14 @@
1765
1789
 
1766
1790
  <xsl:template match="@semx-id | @anchor" mode="update_xml_step1"/>
1767
1791
 
1792
+ <xsl:template match="mn:pagebreak" mode="update_xml_step1">
1793
+ <xsl:copy>
1794
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
1795
+ <xsl:attribute name="from_source_xml">true</xsl:attribute>
1796
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
1797
+ </xsl:copy>
1798
+ </xsl:template>
1799
+
1768
1800
  <!-- END: update new Presentation XML -->
1769
1801
 
1770
1802
  <!-- =========================================================================== -->
@@ -1802,6 +1834,7 @@
1802
1834
  <xsl:for-each select="ancestor-or-self::*[ancestor::mn:preface or ancestor::mn:sections or ancestor-or-self::mn:annex]">
1803
1835
  <xsl:if test="following-sibling::*">false</xsl:if>
1804
1836
  </xsl:for-each>
1837
+ <xsl:if test="@from_source_xml = 'true'">false</xsl:if>
1805
1838
  </xsl:variable>
1806
1839
 
1807
1840
  <xsl:if test="contains($isLast, 'false')">
@@ -2700,6 +2733,7 @@
2700
2733
  </xsl:attribute-set> <!-- sourcecode-style -->
2701
2734
 
2702
2735
  <xsl:template name="refine_sourcecode-style">
2736
+ <xsl:call-template name="setKeepAttributes"/>
2703
2737
  </xsl:template> <!-- refine_sourcecode-style -->
2704
2738
 
2705
2739
  <xsl:attribute-set name="sourcecode-number-style">
@@ -3438,10 +3472,38 @@
3438
3472
  <xsl:template name="refine_strike-style">
3439
3473
  </xsl:template>
3440
3474
 
3475
+ <xsl:attribute-set name="hr-block-style">
3476
+ <xsl:attribute name="font-size">1pt</xsl:attribute>
3477
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3478
+ <xsl:attribute name="role">SKIP</xsl:attribute>
3479
+ <xsl:attribute name="padding-top">-2pt</xsl:attribute>
3480
+ <xsl:attribute name="space-after">4pt</xsl:attribute>
3481
+ </xsl:attribute-set>
3482
+
3483
+ <xsl:template name="refine_hr-block-style">
3484
+ </xsl:template>
3485
+
3486
+ <xsl:attribute-set name="hr-style">
3487
+ <xsl:attribute name="leader-pattern">rule</xsl:attribute>
3488
+ <xsl:attribute name="leader-length">100%</xsl:attribute>
3489
+ </xsl:attribute-set>
3490
+
3491
+ <xsl:template name="refine_hr-style">
3492
+ </xsl:template>
3493
+
3441
3494
  <xsl:template match="mn:br">
3442
3495
  <xsl:value-of select="$linebreak"/>
3443
3496
  </xsl:template>
3444
3497
 
3498
+ <xsl:template match="mn:hr">
3499
+ <fo:block xsl:use-attribute-sets="hr-block-style">
3500
+ <xsl:call-template name="refine_hr-block-style"/>
3501
+ <fo:leader xsl:use-attribute-sets="hr-style">
3502
+ <xsl:call-template name="refine_hr-style"/>
3503
+ </fo:leader>
3504
+ </fo:block>
3505
+ </xsl:template>
3506
+
3445
3507
  <xsl:template match="mn:em">
3446
3508
  <fo:inline xsl:use-attribute-sets="em-style">
3447
3509
  <xsl:call-template name="refine_em_style"/>
@@ -4675,6 +4737,7 @@
4675
4737
  text line 1
4676
4738
  text line 2
4677
4739
  -->
4740
+ <xsl:variable name="example_display_in"><!-- don't change here, only for override xsl --></xsl:variable> <!-- block or inline -->
4678
4741
  <xsl:template match="mn:example" name="example">
4679
4742
  <xsl:call-template name="setNamedDestination"/>
4680
4743
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
@@ -4684,7 +4747,8 @@
4684
4747
  <xsl:call-template name="refine_example-style"/>
4685
4748
 
4686
4749
  <xsl:variable name="fo_element">
4687
- <xsl:if test=".//mn:table or .//mn:dl or *[not(self::mn:fmt-name)][1][self::mn:sourcecode]">block</xsl:if>block
4750
+ <xsl:if test=".//mn:table or .//mn:dl or *[not(self::mn:fmt-name)][1][self::mn:sourcecode]">block</xsl:if>
4751
+ <xsl:if test="normalize-space($example_display_in) != ''"><xsl:value-of select="$example_display_in"/></xsl:if>block
4688
4752
  </xsl:variable>
4689
4753
 
4690
4754
  <fo:block-container margin-left="0mm" role="SKIP">
@@ -11962,7 +12026,7 @@
11962
12026
  <xsl:template name="refine_toc-pagenumber-style">
11963
12027
  </xsl:template>
11964
12028
 
11965
- <!-- List of Figures, Tables -->
12029
+ <!-- List of Figures, Tables, Examples -->
11966
12030
  <xsl:attribute-set name="toc-listof-title-style">
11967
12031
  <xsl:attribute name="provisional-distance-between-starts">3mm</xsl:attribute>
11968
12032
  </xsl:attribute-set>
@@ -12065,6 +12129,9 @@
12065
12129
  <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
12066
12130
  <xsl:call-template name="processFigures_Contents"/>
12067
12131
  </xsl:if>
12132
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
12133
+ <xsl:call-template name="processExamples_Contents"/>
12134
+ </xsl:if>
12068
12135
  </xsl:template>
12069
12136
 
12070
12137
  <xsl:template name="processTables_Contents">
@@ -12111,7 +12178,29 @@
12111
12178
  </mnx:figures>
12112
12179
  </xsl:template>
12113
12180
 
12114
- <xsl:template match="mn:figure/mn:name | mnx:figure/mn:name | mn:table/mn:name | mnx:table/mn:name | mn:permission/mn:name | mnx:permission/mn:name | mn:recommendation/mn:name | mnx:recommendation/mn:name | mn:requirement/mn:name | mnx:requirement/mn:name" mode="contents">
12181
+ <xsl:template name="processExamples_Contents">
12182
+ <mnx:examples>
12183
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
12184
+ <xsl:choose>
12185
+ <xsl:when test="mn:fmt-name">
12186
+ <xsl:variable name="fmt_name">
12187
+ <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
12188
+ </xsl:variable>
12189
+ <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
12190
+ <xsl:copy-of select="$fmt_name"/>
12191
+ </mnx:example>
12192
+ </xsl:when>
12193
+ <xsl:otherwise>
12194
+ <mnx:example id="{@id}" alt-text="{mn:name}">
12195
+ <xsl:copy-of select="mn:name"/>
12196
+ </mnx:example>
12197
+ </xsl:otherwise>
12198
+ </xsl:choose>
12199
+ </xsl:for-each>
12200
+ </mnx:examples>
12201
+ </xsl:template>
12202
+
12203
+ <xsl:template match="mn:figure/mn:name | mnx:figure/mn:name | mn:table/mn:name | mnx:table/mn:name | mn:example/mn:name | mnx:example/mn:name | mn:permission/mn:name | mnx:permission/mn:name | mn:recommendation/mn:name | mnx:recommendation/mn:name | mn:requirement/mn:name | mnx:requirement/mn:name" mode="contents">
12115
12204
  <xsl:if test="not(following-sibling::*[1][self::mn:fmt-name])">
12116
12205
  <xsl:apply-templates mode="contents"/>
12117
12206
  <xsl:text> </xsl:text>
@@ -12120,40 +12209,40 @@
12120
12209
 
12121
12210
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="contents"/>
12122
12211
 
12123
- <xsl:template match="mn:figure/mn:fmt-name | mnx:figure/mn:fmt-name | mn:table/mn:fmt-name | mnx:table/mn:fmt-name | mn:permission/mn:fmt-name | mnx:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mnx:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name | mnx:requirement/mn:fmt-name" mode="contents">
12212
+ <xsl:template match="mn:figure/mn:fmt-name | mnx:figure/mn:fmt-name | mn:table/mn:fmt-name | mnx:table/mn:fmt-name | mn:example/mn:fmt-name | mnx:example/mn:fmt-name | mn:permission/mn:fmt-name | mnx:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mnx:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name | mnx:requirement/mn:fmt-name" mode="contents">
12124
12213
  <xsl:apply-templates mode="contents"/>
12125
12214
  <xsl:text> </xsl:text>
12126
12215
  </xsl:template>
12127
12216
 
12128
- <xsl:template match="mn:figure/mn:name | mnx:figure/mn:name | mn:table/mn:name | mnx:table/mn:name | mn:permission/mn:name | mnx:permission/mn:name | mn:recommendation/mn:name | mnx:recommendation/mn:name | mn:requirement/mn:name | mnx:requirement/mn:name | mn:sourcecode/mn:name" mode="bookmarks">
12217
+ <xsl:template match="mn:figure/mn:name | mnx:figure/mn:name | mn:table/mn:name | mnx:table/mn:name | mn:example/mn:name | mnx:example/mn:name | mn:permission/mn:name | mnx:permission/mn:name | mn:recommendation/mn:name | mnx:recommendation/mn:name | mn:requirement/mn:name | mnx:requirement/mn:name | mn:sourcecode/mn:name" mode="bookmarks">
12129
12218
  <xsl:if test="not(following-sibling::*[1][self::mn:fmt-name])">
12130
12219
  <xsl:apply-templates mode="bookmarks"/>
12131
12220
  <xsl:text> </xsl:text>
12132
12221
  </xsl:if>
12133
12222
  </xsl:template>
12134
12223
 
12135
- <xsl:template match="mn:figure/mn:fmt-name | mnx:figure/mn:fmt-name | mn:table/mn:fmt-name | mnx:table/mn:fmt-name | mn:permission/mn:fmt-name | mnx:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mnx:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name | mnx:requirement/mn:fmt-name | mn:sourcecode/mn:fmt-name | mnx:sourcecode/mn:fmt-name" mode="bookmarks">
12224
+ <xsl:template match="mn:figure/mn:fmt-name | mnx:figure/mn:fmt-name | mn:table/mn:fmt-name | mnx:table/mn:fmt-name | mn:example/mn:fmt-name | mnx:example/mn:fmt-name | mn:permission/mn:fmt-name | mnx:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mnx:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name | mnx:requirement/mn:fmt-name | mn:sourcecode/mn:fmt-name | mnx:sourcecode/mn:fmt-name" mode="bookmarks">
12136
12225
  <xsl:apply-templates mode="bookmarks"/>
12137
12226
  <xsl:text> </xsl:text>
12138
12227
  </xsl:template>
12139
12228
 
12140
- <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement]/mn:name/text() | *[self::mnx:figure or self::mnx:table or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement]/mn:name/text()" mode="contents" priority="2">
12229
+ <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:example or self::mn:permission or self::mn:recommendation or self::mn:requirement]/mn:name/text() | *[self::mnx:figure or self::mnx:table or self::mnx:example or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement]/mn:name/text()" mode="contents" priority="2">
12141
12230
  <xsl:if test="not(../following-sibling::*[1][self::mn:fmt-name])">
12142
12231
  <xsl:value-of select="."/>
12143
12232
  </xsl:if>
12144
12233
  </xsl:template>
12145
12234
 
12146
- <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement]/mn:fmt-name/text() | *[self::mnx:figure or self::mnx:table or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement]/mn:fmt-name/text()" mode="contents" priority="2">
12235
+ <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:example or self::mn:permission or self::mn:recommendation or self::mn:requirement]/mn:fmt-name/text() | *[self::mnx:figure or self::mnx:table or self::mnx:example or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement]/mn:fmt-name/text()" mode="contents" priority="2">
12147
12236
  <xsl:value-of select="."/>
12148
12237
  </xsl:template>
12149
12238
 
12150
- <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement or self::mn:sourcecode]/mn:name//text() | *[self::mnx:figure or self::mnx:table or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement or self::mnx:sourcecode]/mn:name//text()" mode="bookmarks" priority="2">
12239
+ <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:example or self::mn:permission or self::mn:recommendation or self::mn:requirement or self::mn:sourcecode]/mn:name//text() | *[self::mnx:figure or self::mnx:table or self::mnx:example or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement or self::mnx:sourcecode]/mn:name//text()" mode="bookmarks" priority="2">
12151
12240
  <xsl:if test="not(../following-sibling::*[1][self::mn:fmt-name])">
12152
12241
  <xsl:value-of select="."/>
12153
12242
  </xsl:if>
12154
12243
  </xsl:template>
12155
12244
 
12156
- <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement or self::mn:sourcecode]/mn:fmt-name//text() | *[self::mnx:figure or self::mnx:table or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement or self::mnx:sourcecode]/mn:fmt-name//text()" mode="bookmarks" priority="2">
12245
+ <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:example or self::mn:permission or self::mn:recommendation or self::mn:requirement or self::mn:sourcecode]/mn:fmt-name//text() | *[self::mnx:figure or self::mnx:table or self::mnx:example or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement or self::mnx:sourcecode]/mn:fmt-name//text()" mode="bookmarks" priority="2">
12157
12246
  <xsl:value-of select="."/>
12158
12247
  </xsl:template>
12159
12248
 
@@ -12386,6 +12475,11 @@
12386
12475
  <xsl:with-param name="lang" select="@lang"/>
12387
12476
  </xsl:call-template>
12388
12477
 
12478
+ <xsl:call-template name="insertExampleBookmarks">
12479
+ <xsl:with-param name="contents" select="mnx:contents"/>
12480
+ <xsl:with-param name="lang" select="@lang"/>
12481
+ </xsl:call-template>
12482
+
12389
12483
  </fo:bookmark>
12390
12484
 
12391
12485
  </xsl:for-each>
@@ -12404,6 +12498,11 @@
12404
12498
  <xsl:with-param name="lang" select="@lang"/>
12405
12499
  </xsl:call-template>
12406
12500
 
12501
+ <xsl:call-template name="insertExampleBookmarks">
12502
+ <xsl:with-param name="contents" select="mnx:contents"/>
12503
+ <xsl:with-param name="lang" select="@lang"/>
12504
+ </xsl:call-template>
12505
+
12407
12506
  </xsl:for-each>
12408
12507
  </xsl:otherwise>
12409
12508
  </xsl:choose>
@@ -12420,6 +12519,11 @@
12420
12519
  <xsl:with-param name="lang" select="@lang"/>
12421
12520
  </xsl:call-template>
12422
12521
 
12522
+ <xsl:call-template name="insertExampleBookmarks">
12523
+ <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
12524
+ <xsl:with-param name="lang" select="@lang"/>
12525
+ </xsl:call-template>
12526
+
12423
12527
  </xsl:otherwise>
12424
12528
  </xsl:choose>
12425
12529
 
@@ -12500,6 +12604,46 @@
12500
12604
  </fo:bookmark>
12501
12605
  </xsl:if>
12502
12606
  </xsl:template> <!-- insertTableBookmarks -->
12607
+
12608
+ <xsl:template name="insertExampleBookmarks">
12609
+ <xsl:param name="contents"/>
12610
+ <xsl:param name="lang"/>
12611
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
12612
+ <xsl:if test="$contents_nodes/mnx:example">
12613
+ <fo:bookmark internal-destination="{$contents_nodes/mnx:example[1]/@id}" starting-state="hide">
12614
+ <fo:bookmark-title>
12615
+ <xsl:choose>
12616
+ <xsl:when test="$lang = 'fr'">Exemples</xsl:when>
12617
+ <xsl:otherwise>Examples</xsl:otherwise>
12618
+ </xsl:choose>
12619
+ </fo:bookmark-title>
12620
+ <xsl:for-each select="$contents_nodes/mnx:example">
12621
+ <fo:bookmark internal-destination="{@id}">
12622
+ <fo:bookmark-title>
12623
+ <xsl:value-of select="normalize-space(mnx:title)"/>
12624
+ </fo:bookmark-title>
12625
+ </fo:bookmark>
12626
+ </xsl:for-each>
12627
+ </fo:bookmark>
12628
+ </xsl:if>
12629
+ <xsl:if test="$contents_nodes//mnx:examples/mnx:example">
12630
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
12631
+
12632
+ <xsl:variable name="bookmark-title">
12633
+ <xsl:value-of select="$title-list-examples"/>
12634
+ </xsl:variable>
12635
+
12636
+ <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
12637
+
12638
+ <xsl:for-each select="$contents_nodes//mnx:examples/mnx:example">
12639
+ <fo:bookmark internal-destination="{@id}">
12640
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
12641
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
12642
+ </fo:bookmark>
12643
+ </xsl:for-each>
12644
+ </fo:bookmark>
12645
+ </xsl:if>
12646
+ </xsl:template> <!-- insertExampleBookmarks -->
12503
12647
  <!-- End Bookmarks -->
12504
12648
 
12505
12649
  <!-- ============================ -->
@@ -35,3 +35,7 @@ h1, .h1 {
35
35
  a {
36
36
  text-decoration: underline; /* WCAG - all links must be clearly visible */
37
37
  }
38
+
39
+ span.TermNum {
40
+ font-weight: 100;
41
+ }
data/data/pdfa/pdfa.xsl CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  <xsl:variable name="pageWidth">210</xsl:variable>
4
4
  <xsl:variable name="pageHeight">297</xsl:variable>
5
+ <xsl:variable name="marginTop">24</xsl:variable>
5
6
 
6
7
  <xsl:attribute-set name="root-style"><?extend?>
7
8
  <xsl:attribute name="font-family">Source Sans 3, STIX Two Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
@@ -22,12 +23,58 @@
22
23
  </fo:simple-page-master>
23
24
 
24
25
  <fo:simple-page-master master-name="first" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
25
- <fo:region-body margin-top="14mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
26
- <fo:region-before region-name="header-LB-yellow" extent="14mm"/>
26
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
27
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
27
28
  <fo:region-after region-name="footer-even" extent="12.5mm"/>
28
29
  <fo:region-start region-name="left-region" extent="13mm"/>
29
30
  <fo:region-end region-name="right-region" extent="12mm"/>
30
31
  </fo:simple-page-master>
32
+
33
+ <fo:simple-page-master master-name="page-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
34
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
35
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
36
+ <fo:region-after region-name="footer-odd" extent="{$extent_footer}"/>
37
+ <fo:region-start region-name="left-region" extent="{$extent_left}"/>
38
+ <fo:region-end region-name="right-region" extent="{$extent_right}"/>
39
+ </fo:simple-page-master>
40
+ <fo:simple-page-master master-name="page-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
41
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
42
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
43
+ <fo:region-after region-name="footer-even" extent="{$extent_footer}"/>
44
+ <fo:region-start region-name="left-region" extent="{$extent_left}"/>
45
+ <fo:region-end region-name="right-region" extent="{$extent_right}"/>
46
+ </fo:simple-page-master>
47
+
48
+ <fo:page-sequence-master master-name="document">
49
+ <fo:single-page-master-reference master-reference="first"/>
50
+ <fo:repeatable-page-master-alternatives>
51
+ <fo:conditional-page-master-reference master-reference="page-odd" odd-or-even="odd"/>
52
+ <fo:conditional-page-master-reference master-reference="page-even" odd-or-even="even"/>
53
+ </fo:repeatable-page-master-alternatives>
54
+ </fo:page-sequence-master>
55
+
56
+ <fo:simple-page-master master-name="page-odd-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
57
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
58
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
59
+ <fo:region-after region-name="footer-odd" extent="{$extent_footer}"/>
60
+ <fo:region-start region-name="left-region" extent="{$extent_left}"/>
61
+ <fo:region-end region-name="right-region" extent="{$extent_right}"/>
62
+ </fo:simple-page-master>
63
+ <fo:simple-page-master master-name="page-even-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
64
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
65
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
66
+ <fo:region-after region-name="footer-even" extent="{$extent_footer}"/>
67
+ <fo:region-start region-name="left-region" extent="{$extent_left}"/>
68
+ <fo:region-end region-name="right-region" extent="{$extent_right}"/>
69
+ </fo:simple-page-master>
70
+
71
+ <fo:page-sequence-master master-name="document-landscape">
72
+ <fo:repeatable-page-master-alternatives>
73
+ <fo:conditional-page-master-reference master-reference="page-odd-landscape" odd-or-even="odd"/>
74
+ <fo:conditional-page-master-reference master-reference="page-even-landscape" odd-or-even="even"/>
75
+ </fo:repeatable-page-master-alternatives>
76
+ </fo:page-sequence-master>
77
+
31
78
  </fo:layout-master-set>
32
79
  </xsl:template>
33
80
 
@@ -106,7 +153,7 @@
106
153
  <fo:table-cell><fo:block>&#xa0;</fo:block></fo:table-cell>
107
154
  <fo:table-cell text-align="right" display-align="after" xsl:use-attribute-sets="cover_page_box"> <!-- padding-left="5mm" padding-right="5mm" -->
108
155
  <fo:block-container width="100%" height="{$cover_page_color_box_height}" border="{$cover_page_color_box_border_width} solid {$cover_page_color_box1}">
109
- <fo:block margin-left="5mm" margin-right="5mm">
156
+ <fo:block font-size="18pt" margin-left="5mm" margin-right="5mm">
110
157
  <fo:block>
111
158
  <!-- Status / Version.
112
159
  e.g. "Draft Release Candidate 1.2", or just a version -->
@@ -138,6 +185,9 @@
138
185
  <fo:block margin-bottom="2mm">
139
186
  <xsl:value-of select="substring(/mn:metanorma/mn:bibdata/mn:version/mn:revision-date, 1, 7)"/>
140
187
  </fo:block>
188
+ <fo:block margin-bottom="2mm" font-size="9pt">
189
+ <xsl:value-of select="/mn:metanorma/mn:bibdata/mn:docidentifier"/>
190
+ </fo:block>
141
191
  </fo:block>
142
192
  </fo:block-container>
143
193
  </fo:table-cell>
@@ -260,6 +310,23 @@
260
310
  </svg>
261
311
  </xsl:variable>
262
312
 
313
+ <xsl:attribute-set name="toc-style"><?extend?>
314
+ <xsl:attribute name="margin-left">-6mm</xsl:attribute>
315
+ </xsl:attribute-set>
316
+
317
+ <xsl:template name="toc_and_boilerplate">
318
+ <xsl:param name="num"/>
319
+ <fo:block margin-bottom="12pt" role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block>
320
+ <fo:block-container height="{$pageHeight - $marginTop - $marginBottom - 20}mm" display-align="after">
321
+ <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/*"/>
322
+ </fo:block-container>
323
+ <fo:block break-after="page"/>
324
+
325
+ <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:clause[@type = 'toc']">
326
+ <xsl:with-param name="num" select="$num"/>
327
+ </xsl:apply-templates>
328
+ </xsl:template>
329
+
263
330
  <!-- empty back-page to omit back cover -->
264
331
  <xsl:template name="back-page">
265
332
  <!-- put the back page layout -->
@@ -269,24 +336,55 @@
269
336
  <xsl:apply-templates />
270
337
  </xsl:template>
271
338
 
272
-
273
339
  <xsl:attribute-set name="link-style">
274
340
  <xsl:attribute name="color">rgb(208,63,78)</xsl:attribute><!-- #d03f4e PDFa logo red -->
275
341
  <xsl:attribute name="font-weight">normal</xsl:attribute>
276
342
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
277
343
  </xsl:attribute-set>
278
344
 
279
- <xsl:template name="refine_link-style"><?extend?>
345
+ <xsl:template name="refine_link-style">
280
346
  <xsl:attribute name="font-weight">normal</xsl:attribute>
281
347
  </xsl:template>
282
348
 
349
+ <xsl:variable name="variables_pdfa_">
350
+ <xsl:for-each select="//mn:metanorma">
351
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
352
+
353
+ <xsl:variable name="current_document">
354
+ <xsl:copy-of select="."/>
355
+ </xsl:variable>
356
+
357
+ <xsl:for-each select="xalan:nodeset($current_document)">
358
+ <mnx:doc num="{$num}">
359
+ <title><xsl:apply-templates select="mn:metanorma/mn:bibdata/mn:title[@type = 'main'][last()]/node()"/></title>
360
+ </mnx:doc>
361
+ </xsl:for-each>
362
+ </xsl:for-each>
363
+ </xsl:variable>
364
+ <xsl:variable name="variables_pdfa" select="xalan:nodeset($variables_pdfa_)"/>
365
+
283
366
  <xsl:template name="insertHeaderFooter">
284
367
  <xsl:param name="num"/>
368
+ <xsl:param name="section"/>
369
+ <xsl:call-template name="insertHeader">
370
+ <xsl:with-param name="num" select="$num"/>
371
+ <xsl:with-param name="section" select="$section"/>
372
+ </xsl:call-template>
285
373
  <xsl:call-template name="insertFooter">
286
374
  <xsl:with-param name="num" select="$num"/>
287
375
  </xsl:call-template>
288
376
  </xsl:template>
289
377
 
378
+ <xsl:template name="insertHeader">
379
+ <xsl:param name="num"/>
380
+ <xsl:param name="section"/>
381
+ <fo:static-content flow-name="header" role="artifact">
382
+ <fo:block-container margin-top="10mm" border-bottom="0.5pt solid black" text-align="center" font-size="8pt">
383
+ <fo:block><xsl:copy-of select="$variables_pdfa/mnx:doc[@num = $num]/title/node()"/></fo:block>
384
+ </fo:block-container>
385
+ </fo:static-content>
386
+ </xsl:template>
387
+
290
388
  <xsl:template name="insertFooter">
291
389
  <xsl:param name="num"/>
292
390
  <!-- <xsl:param name="invert"/> -->
@@ -322,33 +420,87 @@
322
420
  </xsl:if>
323
421
  </xsl:template>
324
422
 
325
- <xsl:template name="refine_list-item-label-style"><?extend?>
326
- <xsl:if test="parent::mn:ul">
327
- <xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
328
- </xsl:if>
329
- </xsl:template>
330
-
331
423
  <xsl:template name="refine_title-style"><?extend?>
332
424
  <xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
425
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
426
+ </xsl:template>
427
+
428
+ <xsl:template match="mn:fmt-title" name="title">
429
+
430
+ <xsl:variable name="level">
431
+ <xsl:call-template name="getLevel"/>
432
+ </xsl:variable>
433
+
434
+ <xsl:variable name="element-name">
435
+ <xsl:choose>
436
+ <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
437
+ <xsl:otherwise>fo:block</xsl:otherwise>
438
+ </xsl:choose>
439
+ </xsl:variable>
440
+
441
+ <xsl:variable name="title_styles">
442
+ <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
443
+ </xsl:variable>
444
+
445
+ <xsl:element name="{$element-name}">
446
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
447
+
448
+ <!-- <xsl:choose>
449
+ <xsl:when test="$level = 1"> -->
450
+ <fo:block-container margin-left="-15mm" role="SKIP">
451
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
452
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
453
+ <fo:table-column column-width="15mm"/>
454
+ <fo:table-column column-width="150mm"/>
455
+ <fo:table-body role="SKIP">
456
+ <fo:table-row role="SKIP">
457
+ <fo:table-cell text-align="left" role="SKIP">
458
+ <fo:block role="SKIP">
459
+ <xsl:call-template name="setIDforNamedDestinationInline"/>
460
+ <xsl:call-template name="extractSection"/><!-- section number 1 2 3 ... -->
461
+ </fo:block>
462
+ </fo:table-cell>
463
+ <fo:table-cell role="SKIP">
464
+ <fo:block role="SKIP">
465
+ <xsl:call-template name="extractTitle"/> <!-- section title -->
466
+ <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
467
+ </fo:block>
468
+ </fo:table-cell>
469
+ </fo:table-row>
470
+ </fo:table-body>
471
+ </fo:table>
472
+ </fo:block-container>
473
+ </fo:block-container>
474
+ <!-- </xsl:when>
475
+ <xsl:otherwise>
476
+ <xsl:call-template name="setIDforNamedDestinationInline"/>
477
+ <xsl:apply-templates />
478
+ <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
479
+ </xsl:otherwise>
480
+ </xsl:choose> -->
481
+
482
+ </xsl:element>
333
483
  </xsl:template>
334
484
 
335
485
  <xsl:template name="refine_list-item-label-style"><?extend?>
336
486
  <xsl:if test="parent::mn:ul">
337
487
  <xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
488
+ <xsl:copy-of select="@color"/>
489
+ <xsl:copy-of select="@font-size"/>
338
490
  </xsl:if>
339
491
  </xsl:template>
340
492
 
341
493
  <xsl:template name="refine_sourcecode-style"><?extend?>
342
494
  <xsl:attribute name="font-size">85%</xsl:attribute>
343
495
  </xsl:template>
344
-
496
+
345
497
  <xsl:template match="mn:ul/mn:li/mn:fmt-name[normalize-space() = 'o']" priority="3" mode="update_xml_step1">
346
498
  <xsl:attribute name="label">■</xsl:attribute>
347
499
  </xsl:template>
348
500
 
349
501
  <xsl:attribute-set name="note-style"><?extend?>
350
502
  <xsl:attribute name="background-color">rgb(245,235,206)</xsl:attribute> <!-- PDF Association "logo yellow" converted to HSL and lightened to 88% (L) -->
351
- <xsl:attribute name="margin-left">0.5mm</xsl:attribute>
503
+ <xsl:attribute name="margin-left">8.5mm</xsl:attribute>
352
504
  <xsl:attribute name="margin-right">0.5mm</xsl:attribute>
353
505
  <xsl:attribute name="padding">1mm</xsl:attribute>
354
506
  <xsl:attribute name="padding-left">1.5mm</xsl:attribute>
@@ -356,6 +508,16 @@
356
508
  <xsl:attribute name="font-size">88%</xsl:attribute>
357
509
  </xsl:attribute-set>
358
510
 
511
+ <xsl:template name="refine_note-style"><?extend?>
512
+ <xsl:if test="ancestor::mn:bibitem">
513
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
514
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
515
+ <xsl:if test="not(following-sibling::*[1][self::mn:note])">
516
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
517
+ </xsl:if>
518
+ </xsl:if>
519
+ </xsl:template>
520
+
359
521
  <xsl:attribute-set name="note-name-style"><?extend?>
360
522
  <xsl:attribute name="padding-right">3mm</xsl:attribute>
361
523
  </xsl:attribute-set>
@@ -373,8 +535,10 @@
373
535
  <xsl:attribute-set name="list-name-style"><?extend?>
374
536
  <xsl:attribute name="font-weight">normal</xsl:attribute>
375
537
  </xsl:attribute-set>
376
- <xsl:attribute-set name="sourcecode-name-style"><?extend?>
538
+ <xsl:attribute-set name="sourcecode-name-style">
539
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
377
540
  <xsl:attribute name="font-weight">normal</xsl:attribute>
541
+ <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
378
542
  </xsl:attribute-set>
379
543
  <xsl:attribute-set name="table-name-style"><?extend?>
380
544
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -382,4 +546,22 @@
382
546
  <xsl:attribute-set name="term-kind-style"><?extend?>
383
547
  <xsl:attribute name="font-weight">normal</xsl:attribute>
384
548
  </xsl:attribute-set>
549
+
550
+ <xsl:template name="display_term_kind">
551
+ <xsl:if test="not(self::mn:fmt-preferred)">
552
+ <xsl:call-template name="term_kind"/>
553
+ </xsl:if>
554
+ </xsl:template>
555
+
556
+ <xsl:attribute-set name="example-body-style">
557
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
558
+ <xsl:attribute name="margin-right">7mm</xsl:attribute>
559
+ </xsl:attribute-set>
560
+
561
+ <xsl:variable name="example_display_in">block</xsl:variable>
562
+
563
+ <xsl:attribute-set name="fn-body-style"><?extend?>
564
+ <xsl:attribute name="color">black</xsl:attribute>
565
+ </xsl:attribute-set>
566
+
385
567
  </xsl:stylesheet>
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Metanorma
4
4
  module Taste
5
- VERSION = "1.0.6"
5
+ VERSION = "1.0.9"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-taste
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.9
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-05-25 00:00:00.000000000 Z
11
+ date: 2026-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model