metanorma-ribose 1.8.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15ecdae44d9c0f03941e38f784f1b766b2fc80283f0cc76a15b65c9d5f6f8c57
4
- data.tar.gz: a0b8dde351cee3f3f3cecc58b874f006d5dc294777de296df53f5eefdbf7593e
3
+ metadata.gz: 06cb546e7325071cf9b68654d0420d86096a4bf3000de573829f46d9c00c95fa
4
+ data.tar.gz: d8d554113de2c87902d124bc3a0022690a52b1e7492160f6213bcebb178ab649
5
5
  SHA512:
6
- metadata.gz: e354fdb71a7273590f7b3995967826e48ee29212351e10a5907784b21d1a4fcab29580a4b13f7012fcc42a8444105473e1d486742c82f98958d10bc3caaa422f
7
- data.tar.gz: e1a9612a2af44a9401ff659f7d013d22a133ca4d73ef188a8217968abb2340b8841d74c2fba8ad051247faa08c9357653afe67b563d459f71e806f7280c605a6
6
+ metadata.gz: ca3fe9e96a18898d4e9ac6509eadc3fdb6e38f4823e02f1ab65cab61eb9b7d08bb6a1bf3c911a0ee7988515ad9e681db76fa207fa78e9183434568764132b65a
7
+ data.tar.gz: c38f07f07b0fb15caa48fb7cd3839dd2c96c241e133eb528638ba2df1b99ac09561b25dd2b65558e7c93d1162699c00f42e3e2aaca5b9ecd103844cb36c69717
@@ -10,34 +10,6 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
- steps:
23
- - uses: actions/checkout@master
24
-
25
- - uses: ruby/setup-ruby@v1
26
- with:
27
- ruby-version: ${{ matrix.ruby }}
28
- bundler-cache: true
29
-
30
- - uses: metanorma/metanorma-build-scripts/plantuml-setup-action@master
31
-
32
- - run: bundle exec rake
33
-
34
- tests-passed:
35
- needs: rake
36
- runs-on: ubuntu-latest
37
- steps:
38
- - uses: peter-evans/repository-dispatch@v1
39
- with:
40
- token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
41
- repository: ${{ github.repository }}
42
- event-type: tests-passed
43
- client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
13
+ uses: metanorma/metanorma-build-scripts/.github/workflows/plantuml-rake.yml@main
14
+ secrets:
15
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
data/.gitignore CHANGED
@@ -1,3 +1,8 @@
1
1
  .DS_Store
2
2
 
3
3
  .rubocop-https--*
4
+
5
+ /.rspec_status
6
+ /Gemfile.devel
7
+ /Gemfile.lock
8
+ /coverage/
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "asciidoctor/rsd"
4
+ require "metanorma-ribose"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -947,7 +947,7 @@
947
947
  <xsl:if test="rsd:docidentifier">
948
948
  <xsl:choose>
949
949
  <xsl:when test="rsd:docidentifier/@type = 'metanorma'"/>
950
- <xsl:otherwise><fo:inline><xsl:value-of select="rsd:docidentifier"/>, </fo:inline></xsl:otherwise>
950
+ <xsl:otherwise><fo:inline><xsl:value-of select="rsd:docidentifier[not(@type = 'metanorma-ordinal')]"/>, </fo:inline></xsl:otherwise>
951
951
  </xsl:choose>
952
952
  </xsl:if>
953
953
  <xsl:choose>
@@ -1151,8 +1151,6 @@
1151
1151
  </fo:block>
1152
1152
  </xsl:template>
1153
1153
 
1154
- <xsl:template match="rsd:references[not(@normative='true')]/rsd:bibitem" mode="contents"/>
1155
-
1156
1154
  <!-- <xsl:template match="rsd:references[@id = '_bibliography']/rsd:bibitem/rsd:title"> [position() &gt; 1]-->
1157
1155
  <xsl:template match="rsd:references[not(@normative='true')]/rsd:bibitem/rsd:title">
1158
1156
  <fo:inline font-style="italic">
@@ -1467,13 +1465,6 @@
1467
1465
 
1468
1466
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
1469
1467
 
1470
- <title-annex lang="en">Annex </title-annex>
1471
- <title-annex lang="fr">Annexe </title-annex>
1472
-
1473
- <title-annex lang="zh">Annex </title-annex>
1474
-
1475
-
1476
-
1477
1468
  <title-edition lang="en">
1478
1469
 
1479
1470
 
@@ -1487,33 +1478,18 @@
1487
1478
 
1488
1479
  </title-edition>
1489
1480
 
1490
-
1481
+
1482
+ <!-- These titles of Table of contents renders different than determined in localized-strings -->
1491
1483
  <title-toc lang="en">
1492
1484
 
1493
- <xsl:text>Contents</xsl:text>
1494
-
1495
1485
 
1496
1486
 
1497
1487
  </title-toc>
1498
1488
  <title-toc lang="fr">
1499
1489
 
1500
- <xsl:text>Sommaire</xsl:text>
1501
-
1502
-
1503
- </title-toc>
1504
-
1505
- <title-toc lang="zh">Contents</title-toc>
1506
-
1507
-
1490
+ </title-toc>
1508
1491
 
1509
- <title-page lang="en">Page</title-page>
1510
- <title-page lang="fr">Page</title-page>
1511
1492
 
1512
- <title-key lang="en">Key</title-key>
1513
- <title-key lang="fr">Légende</title-key>
1514
-
1515
- <title-where lang="en">where</title-where>
1516
- <title-where lang="fr">où</title-where>
1517
1493
 
1518
1494
  <title-descriptors lang="en">Descriptors</title-descriptors>
1519
1495
 
@@ -1536,25 +1512,6 @@
1536
1512
 
1537
1513
  </title-subpart>
1538
1514
 
1539
- <title-modified lang="en">modified</title-modified>
1540
- <title-modified lang="fr">modifiée</title-modified>
1541
-
1542
- <title-modified lang="zh">modified</title-modified>
1543
-
1544
-
1545
-
1546
- <title-source lang="en">
1547
-
1548
- <xsl:text>SOURCE</xsl:text>
1549
-
1550
-
1551
- </title-source>
1552
-
1553
- <title-keywords lang="en">Keywords</title-keywords>
1554
-
1555
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
1556
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1557
-
1558
1515
  <title-list-tables lang="en">List of Tables</title-list-tables>
1559
1516
 
1560
1517
  <title-list-figures lang="en">List of Figures</title-list-figures>
@@ -1563,37 +1520,8 @@
1563
1520
 
1564
1521
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1565
1522
 
1566
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1567
-
1568
- <title-abstract lang="en">Abstract</title-abstract>
1569
-
1570
1523
  <title-summary lang="en">Summary</title-summary>
1571
1524
 
1572
- <title-in lang="en">in </title-in>
1573
-
1574
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1575
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1576
-
1577
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
1578
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
1579
-
1580
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
1581
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
1582
-
1583
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
1584
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
1585
-
1586
- <title-obligation-normative lang="en">normative</title-obligation-normative>
1587
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
1588
-
1589
- <title-caution lang="en">CAUTION</title-caution>
1590
- <title-caution lang="zh">注意</title-caution>
1591
-
1592
- <title-warning lang="en">WARNING</title-warning>
1593
- <title-warning lang="zh">警告</title-warning>
1594
-
1595
- <title-amendment lang="en">AMENDMENT</title-amendment>
1596
-
1597
1525
  <title-continued lang="en">(continued)</title-continued>
1598
1526
  <title-continued lang="fr">(continué)</title-continued>
1599
1527
 
@@ -1704,6 +1632,7 @@
1704
1632
 
1705
1633
 
1706
1634
 
1635
+
1707
1636
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1708
1637
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1709
1638
 
@@ -1711,7 +1640,9 @@
1711
1640
 
1712
1641
 
1713
1642
 
1643
+
1714
1644
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1645
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1715
1646
 
1716
1647
 
1717
1648
 
@@ -1742,6 +1673,7 @@
1742
1673
 
1743
1674
 
1744
1675
 
1676
+
1745
1677
 
1746
1678
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1747
1679
 
@@ -2134,7 +2066,7 @@
2134
2066
 
2135
2067
 
2136
2068
 
2137
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
2069
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
2138
2070
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2139
2071
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2140
2072
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
@@ -3434,12 +3366,9 @@
3434
3366
  <fo:block margin-bottom="12pt" text-align="left">
3435
3367
 
3436
3368
  <xsl:variable name="title-where">
3437
-
3438
-
3439
- <xsl:call-template name="getTitle">
3440
- <xsl:with-param name="name" select="'title-where'"/>
3441
- </xsl:call-template>
3442
-
3369
+ <xsl:call-template name="getLocalizedString">
3370
+ <xsl:with-param name="key">where</xsl:with-param>
3371
+ </xsl:call-template>
3443
3372
  </xsl:variable>
3444
3373
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3445
3374
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -3455,12 +3384,9 @@
3455
3384
 
3456
3385
 
3457
3386
  <xsl:variable name="title-where">
3458
-
3459
-
3460
- <xsl:call-template name="getTitle">
3461
- <xsl:with-param name="name" select="'title-where'"/>
3462
- </xsl:call-template>
3463
-
3387
+ <xsl:call-template name="getLocalizedString">
3388
+ <xsl:with-param name="key">where</xsl:with-param>
3389
+ </xsl:call-template>
3464
3390
  </xsl:variable>
3465
3391
  <xsl:value-of select="$title-where"/>
3466
3392
  </fo:block>
@@ -3475,12 +3401,9 @@
3475
3401
  <xsl:attribute name="color">black</xsl:attribute>
3476
3402
 
3477
3403
  <xsl:variable name="title-key">
3478
-
3479
-
3480
- <xsl:call-template name="getTitle">
3481
- <xsl:with-param name="name" select="'title-key'"/>
3482
- </xsl:call-template>
3483
-
3404
+ <xsl:call-template name="getLocalizedString">
3405
+ <xsl:with-param name="key">key</xsl:with-param>
3406
+ </xsl:call-template>
3484
3407
  </xsl:variable>
3485
3408
  <xsl:value-of select="$title-key"/>
3486
3409
  </fo:block>
@@ -3824,6 +3747,15 @@
3824
3747
  </fo:inline>
3825
3748
  </xsl:template><xsl:template match="*[local-name()='add']">
3826
3749
  <xsl:choose>
3750
+ <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
3751
+ <fo:inline>
3752
+ <xsl:call-template name="insertTag">
3753
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
3754
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
3755
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
3756
+ </xsl:call-template>
3757
+ </fo:inline>
3758
+ </xsl:when>
3827
3759
  <xsl:when test="@amendment">
3828
3760
  <fo:inline>
3829
3761
  <xsl:call-template name="insertTag">
@@ -3858,7 +3790,6 @@
3858
3790
  </fo:inline>
3859
3791
  </xsl:otherwise>
3860
3792
  </xsl:choose>
3861
-
3862
3793
  </xsl:template><xsl:template name="insertTag">
3863
3794
  <xsl:param name="type"/>
3864
3795
  <xsl:param name="kind"/>
@@ -3874,14 +3805,14 @@
3874
3805
  <xsl:attribute name="scaling">uniform</xsl:attribute>
3875
3806
  <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
3876
3807
  <g>
3877
- <xsl:if test="$type = 'closing'">
3808
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3878
3809
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
3879
3810
  </xsl:if>
3880
3811
  <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
3881
3812
  <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
3882
3813
  </g>
3883
3814
  <text font-family="Arial" x="15" y="57" font-size="40pt">
3884
- <xsl:if test="$type = 'closing'">
3815
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3885
3816
  <xsl:attribute name="x">25</xsl:attribute>
3886
3817
  </xsl:if>
3887
3818
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
@@ -4380,9 +4311,9 @@
4380
4311
  <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
4381
4312
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
4382
4313
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
4383
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4314
+ <xsl:apply-templates select="*[local-name()='name']"/>
4384
4315
  </fo:block>
4385
- <xsl:apply-templates/>
4316
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
4386
4317
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
4387
4318
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
4388
4319
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -4993,11 +4924,58 @@
4993
4924
  <xsl:value-of select="."/>
4994
4925
  </xsl:template><xsl:template match="node()" mode="contents">
4995
4926
  <xsl:apply-templates mode="contents"/>
4927
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
4928
+ <xsl:variable name="level">
4929
+ <xsl:call-template name="getLevel">
4930
+ <xsl:with-param name="depth" select="@depth"/>
4931
+ </xsl:call-template>
4932
+ </xsl:variable>
4933
+
4934
+ <xsl:variable name="section">
4935
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4936
+ </xsl:variable>
4937
+
4938
+ <xsl:variable name="type">floating-title</xsl:variable>
4939
+
4940
+ <xsl:variable name="display">
4941
+ <xsl:choose>
4942
+ <xsl:when test="normalize-space(@id) = ''">false</xsl:when>
4943
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
4944
+ <xsl:otherwise>false</xsl:otherwise>
4945
+ </xsl:choose>
4946
+ </xsl:variable>
4947
+
4948
+ <xsl:variable name="skip">false</xsl:variable>
4949
+
4950
+ <xsl:if test="$skip = 'false'">
4951
+
4952
+ <xsl:variable name="title">
4953
+ <xsl:choose>
4954
+ <xsl:when test="*[local-name() = 'tab']">
4955
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
4956
+ </xsl:when>
4957
+ <xsl:otherwise>
4958
+ <xsl:copy-of select="node()"/>
4959
+ </xsl:otherwise>
4960
+ </xsl:choose>
4961
+ </xsl:variable>
4962
+
4963
+ <xsl:variable name="root">
4964
+ <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if>
4965
+ <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
4966
+ </xsl:variable>
4967
+
4968
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
4969
+ <title>
4970
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
4971
+ </title>
4972
+ </item>
4973
+ </xsl:if>
4996
4974
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4997
4975
  <xsl:apply-templates mode="bookmarks"/>
4998
4976
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4999
4977
  <xsl:apply-templates select="."/>
5000
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4978
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
5001
4979
  <xsl:apply-templates mode="bookmarks"/>
5002
4980
  </xsl:template><xsl:template name="addBookmarks">
5003
4981
  <xsl:param name="contents"/>
@@ -5168,7 +5146,10 @@
5168
5146
  </fo:block>
5169
5147
  </xsl:if>
5170
5148
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
5171
- <xsl:apply-templates mode="contents_item"/>
5149
+ <xsl:param name="mode">bookmarks</xsl:param>
5150
+ <xsl:apply-templates mode="contents_item">
5151
+ <xsl:with-param name="mode" select="$mode"/>
5152
+ </xsl:apply-templates>
5172
5153
  <!-- <xsl:text> </xsl:text> -->
5173
5154
  </xsl:template><xsl:template name="getSection">
5174
5155
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
@@ -5241,6 +5222,18 @@
5241
5222
  <xsl:copy-of select="."/>
5242
5223
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
5243
5224
  <xsl:text> </xsl:text>
5225
+ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item">
5226
+ <xsl:param name="mode">bookmarks</xsl:param>
5227
+ <xsl:apply-templates mode="contents_item">
5228
+ <xsl:with-param name="mode" select="$mode"/>
5229
+ </xsl:apply-templates>
5230
+ </xsl:template><xsl:template match="*[local-name() = 'add'][starts-with(text(), $ace_tag)]" mode="contents_item">
5231
+ <xsl:param name="mode">bookmarks</xsl:param>
5232
+ <xsl:if test="$mode = 'contents'">
5233
+ <xsl:copy>
5234
+ <xsl:apply-templates mode="contents_item"/>
5235
+ </xsl:copy>
5236
+ </xsl:if>
5244
5237
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
5245
5238
 
5246
5239
  <fo:block-container margin-left="0mm">
@@ -5601,42 +5594,48 @@
5601
5594
  </xsl:if>
5602
5595
 
5603
5596
 
5604
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5605
-
5606
- <xsl:variable name="element">
5597
+ <xsl:variable name="fo_element">
5598
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
5607
5599
 
5608
5600
  inline
5609
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
5601
+
5610
5602
  </xsl:variable>
5611
5603
 
5604
+ <!-- display 'EXAMPLE' -->
5605
+ <xsl:apply-templates select="*[local-name()='name']">
5606
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5607
+ </xsl:apply-templates>
5608
+
5612
5609
  <xsl:choose>
5613
- <xsl:when test="contains(normalize-space($element), 'block')">
5614
- <fo:block xsl:use-attribute-sets="example-body-style">
5615
- <xsl:apply-templates/>
5616
- </fo:block>
5610
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
5611
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
5612
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5613
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5614
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5615
+ </xsl:apply-templates>
5616
+ </fo:block-container>
5617
+ </fo:block-container>
5617
5618
  </xsl:when>
5618
5619
  <xsl:otherwise>
5619
5620
  <fo:inline>
5620
- <xsl:apply-templates/>
5621
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5622
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5623
+ </xsl:apply-templates>
5621
5624
  </fo:inline>
5622
5625
  </xsl:otherwise>
5623
5626
  </xsl:choose>
5624
5627
 
5625
5628
  </fo:block>
5626
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
5627
-
5628
- <xsl:variable name="element">
5629
-
5630
- inline
5631
- <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
5632
- </xsl:variable>
5629
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
5630
+ <xsl:param name="fo_element">block</xsl:param>
5631
+
5633
5632
  <xsl:choose>
5634
5633
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
5635
5634
  <fo:inline>
5636
5635
  <xsl:apply-templates/>
5637
5636
  </fo:inline>
5638
5637
  </xsl:when>
5639
- <xsl:when test="contains(normalize-space($element), 'block')">
5638
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
5640
5639
  <fo:block xsl:use-attribute-sets="example-name-style">
5641
5640
  <xsl:apply-templates/>
5642
5641
  </fo:block>
@@ -5649,19 +5648,20 @@
5649
5648
  </xsl:choose>
5650
5649
 
5651
5650
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5651
+ <xsl:param name="fo_element">block</xsl:param>
5652
+
5652
5653
  <xsl:variable name="num"><xsl:number/></xsl:variable>
5653
5654
  <xsl:variable name="element">
5654
5655
 
5655
-
5656
5656
  <xsl:choose>
5657
5657
  <xsl:when test="$num = 1">inline</xsl:when>
5658
5658
  <xsl:otherwise>block</xsl:otherwise>
5659
5659
  </xsl:choose>
5660
5660
 
5661
-
5661
+ <xsl:value-of select="$fo_element"/>
5662
5662
  </xsl:variable>
5663
5663
  <xsl:choose>
5664
- <xsl:when test="normalize-space($element) = 'block'">
5664
+ <xsl:when test="starts-with(normalize-space($element), 'block')">
5665
5665
  <fo:block xsl:use-attribute-sets="example-p-style">
5666
5666
 
5667
5667
  <xsl:apply-templates/>
@@ -5731,12 +5731,9 @@
5731
5731
  </fo:basic-link>
5732
5732
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
5733
5733
  <xsl:variable name="title-modified">
5734
-
5735
-
5736
- <xsl:call-template name="getTitle">
5737
- <xsl:with-param name="name" select="'title-modified'"/>
5738
- </xsl:call-template>
5739
-
5734
+ <xsl:call-template name="getLocalizedString">
5735
+ <xsl:with-param name="key">modified</xsl:with-param>
5736
+ </xsl:call-template>
5740
5737
  </xsl:variable>
5741
5738
 
5742
5739
  <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
@@ -5920,12 +5917,9 @@
5920
5917
  </fo:block>
5921
5918
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5922
5919
  <xsl:variable name="title-deprecated">
5923
-
5924
- <xsl:call-template name="getLocalizedString">
5925
- <xsl:with-param name="key">deprecated</xsl:with-param>
5926
- </xsl:call-template>
5927
-
5928
-
5920
+ <xsl:call-template name="getLocalizedString">
5921
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5922
+ </xsl:call-template>
5929
5923
  </xsl:variable>
5930
5924
  <fo:block xsl:use-attribute-sets="deprecates-style">
5931
5925
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5934,6 +5928,8 @@
5934
5928
  <xsl:if test="*[local-name() = 'strong']">
5935
5929
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5936
5930
  </xsl:if>
5931
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]">
5932
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
5937
5933
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
5938
5934
  <fo:block xsl:use-attribute-sets="definition-style">
5939
5935
  <xsl:apply-templates/>
@@ -6261,16 +6257,30 @@
6261
6257
 
6262
6258
 
6263
6259
 
6264
-
6260
+
6261
+
6262
+
6263
+
6264
+
6265
+
6265
6266
 
6266
6267
 
6267
6268
 
6268
6269
 
6269
6270
 
6271
+
6272
+
6273
+
6274
+
6275
+ <!-- end MPFD bibitem processing -->
6276
+
6277
+ <!-- start M3D bibitem processing -->
6270
6278
 
6271
6279
 
6280
+
6281
+
6272
6282
  </xsl:template><xsl:template name="processBibitemDocId">
6273
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
6283
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
6274
6284
  <xsl:choose>
6275
6285
  <xsl:when test="normalize-space($_doc_ident) != ''">
6276
6286
  <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
@@ -6284,7 +6294,7 @@
6284
6294
  <xsl:if test="$type != ''">
6285
6295
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
6286
6296
  </xsl:if> -->
6287
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
6297
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
6288
6298
  </xsl:otherwise>
6289
6299
  </xsl:choose>
6290
6300
  </xsl:template><xsl:template name="processPersonalAuthor">
@@ -6390,8 +6400,12 @@
6390
6400
  <fo:block> </fo:block>
6391
6401
  </fo:block-container>
6392
6402
  </xsl:template><xsl:variable name="toc_level">
6403
+ <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
6404
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
6405
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
6393
6406
  <xsl:choose>
6394
- <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
6407
+ <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
6408
+ <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
6395
6409
  <xsl:otherwise><!-- default value -->
6396
6410
 
6397
6411
 
@@ -6493,7 +6507,7 @@
6493
6507
  </td>
6494
6508
  </xsl:for-each>
6495
6509
  <td>333</td> <!-- page number, just for fill -->
6496
- </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6510
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6497
6511
  <fo:inline padding-right="5mm"> </fo:inline>
6498
6512
  <fo:inline><xsl:apply-templates/></fo:inline>
6499
6513
  </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
@@ -6865,9 +6879,15 @@
6865
6879
  </xsl:template><xsl:template name="getLocalizedString">
6866
6880
  <xsl:param name="key"/>
6867
6881
  <xsl:param name="formatted">false</xsl:param>
6882
+ <xsl:param name="lang"/>
6868
6883
 
6869
6884
  <xsl:variable name="curr_lang">
6870
- <xsl:call-template name="getLang"/>
6885
+ <xsl:choose>
6886
+ <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
6887
+ <xsl:otherwise>
6888
+ <xsl:call-template name="getLang"/>
6889
+ </xsl:otherwise>
6890
+ </xsl:choose>
6871
6891
  </xsl:variable>
6872
6892
 
6873
6893
  <xsl:variable name="data_value">
File without changes
File without changes
@@ -1,12 +1,12 @@
1
- require "asciidoctor/standoc/converter"
2
- require "asciidoctor/generic/converter"
1
+ require "metanorma/standoc/converter"
2
+ require "metanorma/generic/converter"
3
3
 
4
- module Asciidoctor
4
+ module Metanorma
5
5
  module Ribose
6
6
  # A {Converter} implementation that generates RSD output, and a document
7
7
  # schema encapsulation of the document for validation
8
8
  #
9
- class Converter < Asciidoctor::Generic::Converter
9
+ class Converter < Metanorma::Generic::Converter
10
10
  XML_ROOT_TAG = "rsd-standard".freeze
11
11
  XML_NAMESPACE = "https://www.metanorma.org/ns/rsd".freeze
12
12
 
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "1.8.5".freeze
3
+ VERSION = "2.0.0".freeze
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
- require_relative "asciidoctor/ribose/converter"
2
+ require_relative "metanorma/ribose/converter"
3
3
  require_relative "isodoc/ribose/base_convert"
4
4
  require_relative "isodoc/ribose/html_convert"
5
5
  require_relative "isodoc/ribose/word_convert"
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
30
30
 
31
- spec.add_dependency "metanorma-generic", "~> 1.11.0"
31
+ spec.add_dependency "metanorma-generic", "~> 2.0.0"
32
32
 
33
33
  spec.add_development_dependency "debug"
34
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
data/metanorma.yml CHANGED
@@ -4,7 +4,7 @@ organization_name_long: Ribose
4
4
  document_namespace: https://www.metanorma.org/ns/rsd
5
5
  xml_root_tag: 'rsd-standard'
6
6
  logo_path: lib/isodoc/ribose/html/logo.png
7
- validate_rng_file: lib/asciidoctor/ribose/rsd.rng
7
+ validate_rng_file: lib/metanorma/ribose/rsd.rng
8
8
  i18nyaml: lib/isodoc/ribose/i18n-en.yaml
9
9
  htmlcoverpage: lib/isodoc/ribose/html/html_rsd_titlepage.html
10
10
  htmlintropage: lib/isodoc/ribose/html/html_rsd_intro.html
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: 1.8.5
4
+ version: 2.0.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: 2021-12-27 00:00:00.000000000 Z
11
+ date: 2022-01-10 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: 1.11.0
19
+ version: 2.0.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: 1.11.0
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -188,14 +188,6 @@ files:
188
188
  - bin/console
189
189
  - bin/rspec
190
190
  - bin/setup
191
- - lib/asciidoctor/ribose.rb
192
- - lib/asciidoctor/ribose/basicdoc.rng
193
- - lib/asciidoctor/ribose/biblio.rng
194
- - lib/asciidoctor/ribose/boilerplate.xml
195
- - lib/asciidoctor/ribose/converter.rb
196
- - lib/asciidoctor/ribose/isodoc.rng
197
- - lib/asciidoctor/ribose/reqt.rng
198
- - lib/asciidoctor/ribose/rsd.rng
199
191
  - lib/isodoc/ribose/base_convert.rb
200
192
  - lib/isodoc/ribose/html/header.html
201
193
  - lib/isodoc/ribose/html/html_rsd_intro.html
@@ -222,7 +214,14 @@ files:
222
214
  - lib/isodoc/ribose/xref.rb
223
215
  - lib/metanorma-ribose.rb
224
216
  - lib/metanorma/ribose.rb
217
+ - lib/metanorma/ribose/basicdoc.rng
218
+ - lib/metanorma/ribose/biblio.rng
219
+ - lib/metanorma/ribose/boilerplate.xml
220
+ - lib/metanorma/ribose/converter.rb
221
+ - lib/metanorma/ribose/isodoc.rng
225
222
  - lib/metanorma/ribose/processor.rb
223
+ - lib/metanorma/ribose/reqt.rng
224
+ - lib/metanorma/ribose/rsd.rng
226
225
  - lib/metanorma/ribose/version.rb
227
226
  - metanorma-ribose.gemspec
228
227
  - metanorma.yml
@@ -1,4 +0,0 @@
1
- module Asciidoctor
2
- module Ribose
3
- end
4
- end