metanorma-ribose 2.1.6 → 2.1.8.1

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: 1a17fb7d3f0e0f898cd81e4a8035143076ad002a189b805c4b533a8c4ca37ae8
4
- data.tar.gz: a275006a54dcb4dc0e000dda2839648795d29434e9917c3e681ac396cc6dbb35
3
+ metadata.gz: 49a6039f8dfaf5bfb62b8240a29cb3be67bb36c85f572f1ad94b2c9f949b6beb
4
+ data.tar.gz: 51e16ed6a2a3c55ac11d53e2f57855e5c85f81815631c73a8812341d5cb75444
5
5
  SHA512:
6
- metadata.gz: 1945565392ba993239ddc47da3faaf4248406aa334fbdca2a451e224378f288ac9f66c7be593a090777fb668e1f6b9f75e4474dea85d92d5dda6d8cc2055e0a4
7
- data.tar.gz: 7a46834ed94f863827fa6fea374af0a41baeea0c2954f3fb6068bd1870e658f94e34f48f6bb9db37726c0caec22b02a43e2454302d12f6fce999a0a9acf6f0b1
6
+ metadata.gz: 16127cb7ba8291037f8c015a6983f817ff7ee2cff85095a7645ae490b5da0e5aaeebb48181fd23fab520af41f3a2b51e7cee11910ce378398d744d5fa501618e
7
+ data.tar.gz: a73e644bb3d92a83340e5b568673085e4925130cacb7f6903c6076b5611e2ba1d16dfc98c017c8d6f453d07239a35b40a40cff92458ae75c77f5d80efa302629
@@ -9,7 +9,7 @@ on:
9
9
  pull_request:
10
10
 
11
11
  jobs:
12
- rake:
13
- uses: metanorma/metanorma-build-scripts/.github/workflows/plantuml-rake.yml@main
12
+ notify:
13
+ uses: metanorma/ci/.github/workflows/mn-processor-rake.yml@main
14
14
  secrets:
15
15
  pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -0,0 +1,24 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release
4
+
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ next_version:
9
+ description: |
10
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
+ required: true
12
+ default: 'skip'
13
+ push:
14
+ tags: [ v* ]
15
+
16
+ jobs:
17
+ release:
18
+ uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
19
+ with:
20
+ next_version: ${{ github.event.inputs.next_version }}
21
+ secrets:
22
+ rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
23
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
24
+
@@ -1229,8 +1229,18 @@
1229
1229
 
1230
1230
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
1231
1231
 
1232
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
1233
+ true
1234
+ </xsl:variable>
1235
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
1236
+
1232
1237
  <xsl:variable name="isGenerateTableIF_">
1233
- false
1238
+ <xsl:choose>
1239
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
1240
+ <xsl:value-of select="normalize-space($table_if) = 'true'"/>
1241
+ </xsl:when>
1242
+ <xsl:otherwise>false</xsl:otherwise>
1243
+ </xsl:choose>
1234
1244
  </xsl:variable>
1235
1245
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
1236
1246
 
@@ -1652,6 +1662,9 @@
1652
1662
  <xsl:attribute-set name="import-style">
1653
1663
  </xsl:attribute-set>
1654
1664
 
1665
+ <xsl:attribute-set name="component-style">
1666
+ </xsl:attribute-set>
1667
+
1655
1668
  <xsl:attribute-set name="recommendation-style">
1656
1669
 
1657
1670
  </xsl:attribute-set>
@@ -1857,9 +1870,8 @@
1857
1870
  </xsl:attribute-set>
1858
1871
 
1859
1872
  <xsl:attribute-set name="dt-block-style">
1860
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1873
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1861
1874
 
1862
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
1863
1875
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1864
1876
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
1865
1877
 
@@ -2884,6 +2896,7 @@
2884
2896
 
2885
2897
  <xsl:variable name="margin-side">
2886
2898
  <xsl:choose>
2899
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
2887
2900
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2888
2901
  <xsl:otherwise>0</xsl:otherwise>
2889
2902
  </xsl:choose>
@@ -2946,6 +2959,7 @@
2946
2959
  </td>
2947
2960
  </tr>
2948
2961
  -->
2962
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
2949
2963
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2950
2964
 
2951
2965
  </xsl:when>
@@ -3080,12 +3094,17 @@
3080
3094
  <xsl:template name="calculate-column-widths">
3081
3095
  <xsl:param name="table"/>
3082
3096
  <xsl:param name="cols-count"/>
3083
-
3097
+ <xsl:choose>
3098
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
3099
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
3100
+ </xsl:when>
3101
+ <xsl:otherwise>
3084
3102
  <xsl:call-template name="calculate-column-widths-proportional">
3085
3103
  <xsl:with-param name="cols-count" select="$cols-count"/>
3086
3104
  <xsl:with-param name="table" select="$table"/>
3087
3105
  </xsl:call-template>
3088
-
3106
+ </xsl:otherwise>
3107
+ </xsl:choose>
3089
3108
  </xsl:template>
3090
3109
 
3091
3110
  <!-- ================================================== -->
@@ -3263,6 +3282,7 @@
3263
3282
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
3264
3283
  <!-- ================================================== -->
3265
3284
 
3285
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
3266
3286
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
3267
3287
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
3268
3288
 
@@ -3274,67 +3294,6 @@
3274
3294
 
3275
3295
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
3276
3296
 
3277
- <!-- get current table id -->
3278
- <xsl:variable name="table_id" select="@id"/>
3279
- <!-- find table by id in the file 'table_widths' -->
3280
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
3281
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
3282
-
3283
- <!-- table='<xsl:copy-of select="$table"/>' -->
3284
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
3285
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
3286
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
3287
-
3288
- <xsl:variable name="table_with_cell_widths_">
3289
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
3290
- </xsl:variable>
3291
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
3292
-
3293
- <!-- <xsl:if test="$table_if_debug = 'true'">
3294
- <xsl:copy-of select="$table_with_cell_widths"/>
3295
- </xsl:if> -->
3296
-
3297
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
3298
-
3299
- <xsl:variable name="column_widths_">
3300
- <!-- iteration of columns -->
3301
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
3302
- <xsl:variable name="pos" select="position()"/>
3303
- <column>
3304
- <xsl:attribute name="width_max">
3305
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
3306
- <xsl:sort select="." data-type="number" order="descending"/>
3307
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3308
- </xsl:for-each>
3309
- </xsl:attribute>
3310
- <xsl:attribute name="width_min">
3311
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
3312
- <xsl:sort select="." data-type="number" order="descending"/>
3313
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3314
- </xsl:for-each>
3315
- </xsl:attribute>
3316
- </column>
3317
- </xsl:for-each>
3318
- </xsl:variable>
3319
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
3320
-
3321
- <!-- <column_widths>
3322
- <xsl:copy-of select="$column_widths"/>
3323
- </column_widths> -->
3324
-
3325
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
3326
- <xsl:variable name="table_widths_">
3327
- <table>
3328
- <xsl:attribute name="width_max">
3329
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
3330
- </xsl:attribute>
3331
- <xsl:attribute name="width_min">
3332
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
3333
- </xsl:attribute>
3334
- </table>
3335
- </xsl:variable>
3336
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
3337
-
3338
3297
  <xsl:variable name="page_width">
3339
3298
  <xsl:choose>
3340
3299
  <xsl:when test="$parent_table_page-width != ''">
@@ -3347,16 +3306,13 @@
3347
3306
  </xsl:variable>
3348
3307
 
3349
3308
  <xsl:if test="$table_if_debug = 'true'">
3350
- <table_width>
3351
- <xsl:copy-of select="$table_widths"/>
3352
- </table_width>
3353
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
3309
+ <page_width><xsl:value-of select="$page_width"/></page_width>
3354
3310
  </xsl:if>
3355
3311
 
3356
3312
  <!-- There are three cases: -->
3357
3313
  <xsl:choose>
3358
3314
  <!-- 1. The minimum table width is equal to or wider than the available space -->
3359
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
3315
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
3360
3316
  <!-- call old algorithm -->
3361
3317
  <case1/>
3362
3318
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -3366,10 +3322,10 @@
3366
3322
  </xsl:call-template> -->
3367
3323
  </xsl:when>
3368
3324
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
3369
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
3325
+ <xsl:when test="@width_max &lt;= $page_width">
3370
3326
  <case2/>
3371
3327
  <autolayout/>
3372
- <xsl:for-each select="$column_widths/column/@width_max">
3328
+ <xsl:for-each select="column/@width_max">
3373
3329
  <column divider="100"><xsl:value-of select="."/></column>
3374
3330
  </xsl:for-each>
3375
3331
  </xsl:when>
@@ -3379,19 +3335,19 @@
3379
3335
  For each column, let d be the difference between maximum and minimum width of that column.
3380
3336
  Now set the column's width to the minimum width plus d times W over D.
3381
3337
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
3382
- <xsl:when test="($table_widths/table/@width_max &gt; $page_width and $table_widths/table/@width_min &lt; $page_width) or ($table_widths/table/@width_min &gt;= $page_width)">
3338
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
3383
3339
  <!-- difference between the available space and the minimum table width -->
3384
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
3340
+ <xsl:variable name="W" select="$page_width - @width_min"/>
3385
3341
  <W><xsl:value-of select="$W"/></W>
3386
3342
  <!-- difference between maximum and minimum width of the table -->
3387
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
3343
+ <xsl:variable name="D" select="@width_max - @width_min"/>
3388
3344
  <D><xsl:value-of select="$D"/></D>
3389
3345
  <case3/>
3390
3346
  <autolayout/>
3391
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
3347
+ <xsl:if test="@width_min &gt;= $page_width">
3392
3348
  <split_keep-within-line>true</split_keep-within-line>
3393
3349
  </xsl:if>
3394
- <xsl:for-each select="$column_widths/column">
3350
+ <xsl:for-each select="column">
3395
3351
  <!-- difference between maximum and minimum width of that column. -->
3396
3352
  <xsl:variable name="d" select="@width_max - @width_min"/>
3397
3353
  <d><xsl:value-of select="$d"/></d>
@@ -3417,23 +3373,39 @@
3417
3373
 
3418
3374
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
3419
3375
 
3376
+ <ancestor_tree>
3377
+ <xsl:for-each select="ancestor::*">
3378
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
3379
+ </xsl:for-each>
3380
+ </ancestor_tree>
3381
+
3420
3382
  <xsl:variable name="parent_table_page-width_">
3421
3383
  <xsl:if test="$parent_table_id != ''">
3422
3384
  <!-- determine column number in the parent table -->
3423
3385
  <xsl:variable name="parent_table_column_number">
3424
3386
  <xsl:choose>
3425
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
3387
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
3388
+ <xsl:when test="(ancestor::*[local-name() = 'dd' or local-name() = 'table' or local-name() = 'dl'])[last()][local-name() = 'dd' or local-name() = 'dl']">2</xsl:when>
3426
3389
  <xsl:otherwise> <!-- parent is table -->
3427
3390
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
3428
3391
  </xsl:otherwise>
3429
3392
  </xsl:choose>
3430
3393
  </xsl:variable>
3431
3394
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
3432
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
3395
+
3396
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
3397
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
3398
+ <!-- <xsl:variable name="divider">
3399
+ <xsl:value-of select="$parent_table_column/@divider"/>
3400
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
3401
+ </xsl:variable> -->
3402
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
3433
3403
  </xsl:if>
3434
3404
  </xsl:variable>
3435
3405
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
3436
3406
 
3407
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
3408
+
3437
3409
  <!-- get current table id -->
3438
3410
  <xsl:variable name="table_id" select="@id"/>
3439
3411
 
@@ -3454,50 +3426,6 @@
3454
3426
 
3455
3427
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
3456
3428
 
3457
- <!-- ============================= -->
3458
- <!-- mode: determine_cell_widths-if -->
3459
- <!-- ============================= -->
3460
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
3461
- <xsl:copy>
3462
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
3463
- </xsl:copy>
3464
- </xsl:template>
3465
-
3466
- <xsl:template match="td | th" mode="determine_cell_widths-if">
3467
- <xsl:copy>
3468
- <xsl:copy-of select="@*"/>
3469
-
3470
- <!-- The maximum width is given by the widest line. -->
3471
- <xsl:attribute name="width_max">
3472
- <xsl:for-each select="p_len">
3473
- <xsl:sort select="." data-type="number" order="descending"/>
3474
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3475
- </xsl:for-each>
3476
- </xsl:attribute>
3477
-
3478
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
3479
- <xsl:variable name="width_min">
3480
- <xsl:for-each select="word_len">
3481
- <xsl:sort select="." data-type="number" order="descending"/>
3482
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3483
- </xsl:for-each>
3484
- </xsl:variable>
3485
- <xsl:attribute name="width_min">
3486
- <xsl:value-of select="$width_min"/>
3487
- </xsl:attribute>
3488
-
3489
- <xsl:if test="$width_min = 0">
3490
- <xsl:attribute name="width_min">1</xsl:attribute>
3491
- </xsl:if>
3492
-
3493
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
3494
-
3495
- </xsl:copy>
3496
- </xsl:template>
3497
- <!-- ============================= -->
3498
- <!-- END mode: determine_cell_widths-if -->
3499
- <!-- ============================= -->
3500
-
3501
3429
  <!-- ================================================== -->
3502
3430
  <!-- Calculate column's width based on HTML4 algorithm -->
3503
3431
  <!-- ================================================== -->
@@ -3688,6 +3616,7 @@
3688
3616
  <xsl:when test="$table_or_dl = 'table'">
3689
3617
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3690
3618
  <fo:table-row number-columns-spanned="{$col_count}">
3619
+ <xsl:copy-of select="../@font-weight"/>
3691
3620
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3692
3621
  <xsl:call-template name="td"/>
3693
3622
  </fo:table-row>
@@ -3839,7 +3768,7 @@
3839
3768
 
3840
3769
  <xsl:apply-templates/>
3841
3770
 
3842
- <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
3771
+ <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
3843
3772
 
3844
3773
  </fo:block>
3845
3774
  </fo:table-cell>
@@ -4165,6 +4094,7 @@
4165
4094
  <xsl:template match="*[local-name()='dl']">
4166
4095
  <xsl:variable name="isAdded" select="@added"/>
4167
4096
  <xsl:variable name="isDeleted" select="@deleted"/>
4097
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
4168
4098
  <fo:block-container>
4169
4099
 
4170
4100
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -4701,21 +4631,16 @@
4701
4631
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
4702
4632
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
4703
4633
  <xsl:param name="id"/>
4704
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4705
4634
  <tr>
4706
4635
  <td>
4707
4636
  <xsl:copy-of select="node()"/>
4708
4637
  </td>
4709
4638
  <td>
4710
-
4711
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4712
-
4713
- <!-- get paragraphs from nested 'dl' -->
4714
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4715
-
4639
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4640
+ <!-- get paragraphs from nested 'dl' -->
4641
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4716
4642
  </td>
4717
4643
  </tr>
4718
-
4719
4644
  </xsl:template>
4720
4645
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4721
4646
 
@@ -5376,6 +5301,9 @@
5376
5301
  <xsl:variable name="td">
5377
5302
  <xsl:element name="td">
5378
5303
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
5304
+ <xsl:if test="local-name()='th'">
5305
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
5306
+ </xsl:if>
5379
5307
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5380
5308
  <xsl:apply-templates mode="simple-table-colspan"/>
5381
5309
  </xsl:element>
@@ -5388,6 +5316,9 @@
5388
5316
  <xsl:otherwise>
5389
5317
  <xsl:element name="td">
5390
5318
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5319
+ <xsl:if test="local-name()='th'">
5320
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
5321
+ </xsl:if>
5391
5322
  <xsl:apply-templates mode="simple-table-colspan"/>
5392
5323
  </xsl:element>
5393
5324
  </xsl:otherwise>
@@ -5517,8 +5448,14 @@
5517
5448
  <xsl:copy-of select="@*"/>
5518
5449
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
5519
5450
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
5451
+ <xsl:variable name="divide">
5452
+ <xsl:choose>
5453
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
5454
+ <xsl:otherwise>1</xsl:otherwise>
5455
+ </xsl:choose>
5456
+ </xsl:variable>
5520
5457
  <xsl:attribute name="id">
5521
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
5458
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5522
5459
  </xsl:attribute>
5523
5460
 
5524
5461
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5526,10 +5463,12 @@
5526
5463
  <xsl:copy-of select="@*"/>
5527
5464
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5528
5465
  <xsl:attribute name="id">
5529
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
5466
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5530
5467
  </xsl:attribute>
5531
5468
 
5532
- <xsl:copy-of select="node()"/>
5469
+ <!-- <xsl:copy-of select="node()" /> -->
5470
+ <xsl:apply-templates mode="simple-table-noid"/>
5471
+
5533
5472
  </xsl:copy>
5534
5473
  </xsl:for-each>
5535
5474
 
@@ -5558,7 +5497,7 @@
5558
5497
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5559
5498
  <xsl:copy>
5560
5499
  <xsl:attribute name="id">
5561
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
5500
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5562
5501
  </xsl:attribute>
5563
5502
  <xsl:copy-of select="node()"/>
5564
5503
  </xsl:copy>
@@ -5567,6 +5506,24 @@
5567
5506
  </xsl:copy>
5568
5507
 
5569
5508
  </xsl:template>
5509
+
5510
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
5511
+ <xsl:copy>
5512
+ <xsl:choose>
5513
+ <xsl:when test="$isGenerateTableIF = 'true'">
5514
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
5515
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
5516
+ <xsl:copy-of select="@id"/>
5517
+ </xsl:if> -->
5518
+ </xsl:when>
5519
+ <xsl:otherwise>
5520
+ <xsl:copy-of select="@*"/>
5521
+ </xsl:otherwise>
5522
+ </xsl:choose>
5523
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
5524
+ </xsl:copy>
5525
+ </xsl:template>
5526
+
5570
5527
  <!-- End mode: simple-table-id -->
5571
5528
  <!-- ===================== -->
5572
5529
  <!-- ===================== -->
@@ -5576,7 +5533,7 @@
5576
5533
  <!-- =============================== -->
5577
5534
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
5578
5535
  <xsl:copy>
5579
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5536
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5580
5537
  </xsl:copy>
5581
5538
  </xsl:template>
5582
5539
 
@@ -5690,6 +5647,10 @@
5690
5647
 
5691
5648
  <fo:inline xsl:use-attribute-sets="mathml-style">
5692
5649
 
5650
+ <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
5651
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5652
+ </xsl:if>
5653
+
5693
5654
  <xsl:call-template name="setTrackChangesStyles">
5694
5655
  <xsl:with-param name="isAdded" select="$isAdded"/>
5695
5656
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -7599,41 +7560,47 @@
7599
7560
  </fo:block>
7600
7561
  </xsl:template>
7601
7562
 
7602
- <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
7563
+ <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
7603
7564
  <fo:block xsl:use-attribute-sets="inherit-style">
7604
7565
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
7605
7566
  </fo:block>
7606
7567
  </xsl:template>
7607
7568
 
7608
- <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
7569
+ <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description'] | *[local-name() = 'div'][@type = 'requirement-description'] | *[local-name() = 'div'][@type = 'recommendation-description'] | *[local-name() = 'div'][@type = 'permission-description']">
7609
7570
  <fo:block xsl:use-attribute-sets="description-style">
7610
7571
  <xsl:apply-templates/>
7611
7572
  </fo:block>
7612
7573
  </xsl:template>
7613
7574
 
7614
- <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
7575
+ <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification'] | *[local-name() = 'div'][@type = 'requirement-specification'] | *[local-name() = 'div'][@type = 'recommendation-specification'] | *[local-name() = 'div'][@type = 'permission-specification']">
7615
7576
  <fo:block xsl:use-attribute-sets="specification-style">
7616
7577
  <xsl:apply-templates/>
7617
7578
  </fo:block>
7618
7579
  </xsl:template>
7619
7580
 
7620
- <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
7581
+ <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target'] | *[local-name() = 'div'][@type = 'requirement-measurement-target'] | *[local-name() = 'div'][@type = 'recommendation-measurement-target'] | *[local-name() = 'div'][@type = 'permission-measurement-target']">
7621
7582
  <fo:block xsl:use-attribute-sets="measurement-target-style">
7622
7583
  <xsl:apply-templates/>
7623
7584
  </fo:block>
7624
7585
  </xsl:template>
7625
7586
 
7626
- <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
7587
+ <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification'] | *[local-name() = 'div'][@type = 'requirement-verification'] | *[local-name() = 'div'][@type = 'recommendation-verification'] | *[local-name() = 'div'][@type = 'permission-verification']">
7627
7588
  <fo:block xsl:use-attribute-sets="verification-style">
7628
7589
  <xsl:apply-templates/>
7629
7590
  </fo:block>
7630
7591
  </xsl:template>
7631
7592
 
7632
- <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
7593
+ <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import'] | *[local-name() = 'div'][@type = 'requirement-import'] | *[local-name() = 'div'][@type = 'recommendation-import'] | *[local-name() = 'div'][@type = 'permission-import']">
7633
7594
  <fo:block xsl:use-attribute-sets="import-style">
7634
7595
  <xsl:apply-templates/>
7635
7596
  </fo:block>
7636
7597
  </xsl:template>
7598
+
7599
+ <xsl:template match="*[local-name() = 'div'][starts-with(@type, 'requirement-component')] | *[local-name() = 'div'][starts-with(@type, 'recommendation-component')] | *[local-name() = 'div'][starts-with(@type, 'permission-component')]">
7600
+ <fo:block xsl:use-attribute-sets="component-style">
7601
+ <xsl:apply-templates/>
7602
+ </fo:block>
7603
+ </xsl:template>
7637
7604
  <!-- ========== -->
7638
7605
  <!-- END -->
7639
7606
  <!-- ========== -->
@@ -7689,15 +7656,12 @@
7689
7656
 
7690
7657
  <xsl:template match="*[local-name()='tr']" mode="requirement">
7691
7658
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
7692
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
7693
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
7694
- </xsl:if>
7695
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
7696
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
7697
- </xsl:if>
7698
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
7699
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
7659
+
7660
+ <xsl:if test="parent::*[local-name()='thead'] or starts-with(*[local-name()='td' or local-name()='th'][1], 'Requirement ') or starts-with(*[local-name()='td' or local-name()='th'][1], 'Recommendation ')">
7661
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
7662
+
7700
7663
  </xsl:if>
7664
+
7701
7665
  <xsl:apply-templates mode="requirement"/>
7702
7666
  </fo:table-row>
7703
7667
  </xsl:template>
@@ -9214,7 +9178,7 @@
9214
9178
  </tbody>
9215
9179
  </xsl:variable>
9216
9180
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
9217
- <xsl:call-template name="calculate-column-widths">
9181
+ <xsl:call-template name="calculate-column-widths-proportional">
9218
9182
  <xsl:with-param name="cols-count" select="$cols-count"/>
9219
9183
  <xsl:with-param name="table" select="$toc_table_simple"/>
9220
9184
  </xsl:call-template>
@@ -225,9 +225,9 @@
225
225
  <zeroOrMore>
226
226
  <ref name="forename"/>
227
227
  </zeroOrMore>
228
- <zeroOrMore>
229
- <ref name="initial"/>
230
- </zeroOrMore>
228
+ <optional>
229
+ <ref name="formatted-initials"/>
230
+ </optional>
231
231
  <ref name="surname"/>
232
232
  <zeroOrMore>
233
233
  <ref name="addition"/>
@@ -247,8 +247,8 @@
247
247
  <ref name="LocalizedString"/>
248
248
  </element>
249
249
  </define>
250
- <define name="initial">
251
- <element name="initial">
250
+ <define name="formatted-initials">
251
+ <element name="formatted-initials">
252
252
  <ref name="LocalizedString"/>
253
253
  </element>
254
254
  </define>
@@ -264,6 +264,9 @@
264
264
  </define>
265
265
  <define name="forename">
266
266
  <element name="forename">
267
+ <optional>
268
+ <attribute name="initial"/>
269
+ </optional>
267
270
  <ref name="LocalizedString"/>
268
271
  </element>
269
272
  </define>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.1.6".freeze
3
+ VERSION = "2.1.8.1".freeze
4
4
  end
5
5
  end
@@ -7,8 +7,9 @@ require_relative "isodoc/ribose/pdf_convert"
7
7
  require_relative "isodoc/ribose/presentation_xml_convert"
8
8
  require_relative "isodoc/ribose/xref"
9
9
  require_relative "metanorma/ribose/version"
10
+ require "metanorma"
10
11
 
11
- if defined? Metanorma
12
+ if defined? Metanorma::Registry
12
13
  require_relative "metanorma/ribose"
13
14
  Metanorma::Registry.instance.register(Metanorma::Ribose::Processor)
14
15
  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.1.6
4
+ version: 2.1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -177,6 +177,7 @@ extensions: []
177
177
  extra_rdoc_files: []
178
178
  files:
179
179
  - ".github/workflows/rake.yml"
180
+ - ".github/workflows/release.yml"
180
181
  - ".gitignore"
181
182
  - ".hound.yml"
182
183
  - ".rubocop.yml"
@@ -229,7 +230,7 @@ homepage: https://github.com/metanorma/metanorma-ribose
229
230
  licenses:
230
231
  - BSD-2-Clause
231
232
  metadata: {}
232
- post_install_message:
233
+ post_install_message:
233
234
  rdoc_options: []
234
235
  require_paths:
235
236
  - lib
@@ -244,8 +245,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
245
  - !ruby/object:Gem::Version
245
246
  version: '0'
246
247
  requirements: []
247
- rubygems_version: 3.3.16
248
- signing_key:
248
+ rubygems_version: 3.1.6
249
+ signing_key:
249
250
  specification_version: 4
250
251
  summary: metanorma-ribose lets you write Ribose standards in AsciiDoc.
251
252
  test_files: []