metanorma-cc 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: e260a0a0f783e4bc5899758b214a99703b7e5da7ded45cdd8151ff2027caf5a2
4
- data.tar.gz: 1bfbd043ea5437a9a05e0db76a70841ed287a78c8f4a6aed1c47b2c8864f4649
3
+ metadata.gz: a628ec2c4338c385b27172fbd0920d1b3229b790bfd045512f7ac0a8ed147394
4
+ data.tar.gz: 6be4f38382e53e85206ff30b79442446dca5b618825e47c0c0d8e06f5709c9de
5
5
  SHA512:
6
- metadata.gz: 23dc4e7cd8ef5ce600a47404ceaabb309fcd6ec2dbdea335ae43cc9f0eb2f181b91f724129b2891e141d2381eace7060194c4f3f4767dca76ad0adccb72d3c9b
7
- data.tar.gz: aaba0f0240afa3137cf76cbe5d05b251ee4e1faaed815aee1e0ab4bef86b3a4f5e8b929b22ee0cc842c3b1c38d741e92d4f2cc6e0ed1dbb5231568729d8766b7
6
+ metadata.gz: 9238dcbdc397ed054a715c8319ea62d8477679ca954fca6f9222a270aa258559acf111655d0cfa99f2036aecc901eb9649cc811fbcb6ef52bda0d04814958841
7
+ data.tar.gz: 4dfa8aaf5b55c136e2b7a6e6303b8c9d8770ff6dabea88c85df05e87c41bdfd16bfe838a8b2db6f75466a94e18c891116a28a08d11854ab2b2cc2a4a444971c5
@@ -10,6 +10,6 @@ on:
10
10
 
11
11
  jobs:
12
12
  notify:
13
- uses: metanorma/metanorma-build-scripts/.github/workflows/mn-processor-rake.yml@main
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
+
@@ -594,8 +594,18 @@
594
594
 
595
595
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
596
596
 
597
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
598
+ true
599
+ </xsl:variable>
600
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
601
+
597
602
  <xsl:variable name="isGenerateTableIF_">
598
- false
603
+ <xsl:choose>
604
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
605
+ <xsl:value-of select="normalize-space($table_if) = 'true'"/>
606
+ </xsl:when>
607
+ <xsl:otherwise>false</xsl:otherwise>
608
+ </xsl:choose>
599
609
  </xsl:variable>
600
610
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
601
611
 
@@ -1009,6 +1019,9 @@
1009
1019
  <xsl:attribute-set name="import-style">
1010
1020
  </xsl:attribute-set>
1011
1021
 
1022
+ <xsl:attribute-set name="component-style">
1023
+ </xsl:attribute-set>
1024
+
1012
1025
  <xsl:attribute-set name="recommendation-style">
1013
1026
 
1014
1027
  </xsl:attribute-set>
@@ -1192,7 +1205,7 @@
1192
1205
  </xsl:attribute-set>
1193
1206
 
1194
1207
  <xsl:attribute-set name="dt-block-style">
1195
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1208
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1196
1209
 
1197
1210
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
1198
1211
 
@@ -2141,6 +2154,7 @@
2141
2154
 
2142
2155
  <xsl:variable name="margin-side">
2143
2156
  <xsl:choose>
2157
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
2144
2158
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2145
2159
  <xsl:otherwise>0</xsl:otherwise>
2146
2160
  </xsl:choose>
@@ -2209,6 +2223,7 @@
2209
2223
  </td>
2210
2224
  </tr>
2211
2225
  -->
2226
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
2212
2227
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2213
2228
 
2214
2229
  </xsl:when>
@@ -2343,12 +2358,17 @@
2343
2358
  <xsl:template name="calculate-column-widths">
2344
2359
  <xsl:param name="table"/>
2345
2360
  <xsl:param name="cols-count"/>
2346
-
2361
+ <xsl:choose>
2362
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
2363
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
2364
+ </xsl:when>
2365
+ <xsl:otherwise>
2347
2366
  <xsl:call-template name="calculate-column-widths-proportional">
2348
2367
  <xsl:with-param name="cols-count" select="$cols-count"/>
2349
2368
  <xsl:with-param name="table" select="$table"/>
2350
2369
  </xsl:call-template>
2351
-
2370
+ </xsl:otherwise>
2371
+ </xsl:choose>
2352
2372
  </xsl:template>
2353
2373
 
2354
2374
  <!-- ================================================== -->
@@ -2526,6 +2546,7 @@
2526
2546
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
2527
2547
  <!-- ================================================== -->
2528
2548
 
2549
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
2529
2550
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
2530
2551
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2531
2552
 
@@ -2537,67 +2558,6 @@
2537
2558
 
2538
2559
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2539
2560
 
2540
- <!-- get current table id -->
2541
- <xsl:variable name="table_id" select="@id"/>
2542
- <!-- find table by id in the file 'table_widths' -->
2543
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2544
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2545
-
2546
- <!-- table='<xsl:copy-of select="$table"/>' -->
2547
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2548
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2549
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2550
-
2551
- <xsl:variable name="table_with_cell_widths_">
2552
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2553
- </xsl:variable>
2554
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2555
-
2556
- <!-- <xsl:if test="$table_if_debug = 'true'">
2557
- <xsl:copy-of select="$table_with_cell_widths"/>
2558
- </xsl:if> -->
2559
-
2560
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2561
-
2562
- <xsl:variable name="column_widths_">
2563
- <!-- iteration of columns -->
2564
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2565
- <xsl:variable name="pos" select="position()"/>
2566
- <column>
2567
- <xsl:attribute name="width_max">
2568
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2569
- <xsl:sort select="." data-type="number" order="descending"/>
2570
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2571
- </xsl:for-each>
2572
- </xsl:attribute>
2573
- <xsl:attribute name="width_min">
2574
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2575
- <xsl:sort select="." data-type="number" order="descending"/>
2576
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2577
- </xsl:for-each>
2578
- </xsl:attribute>
2579
- </column>
2580
- </xsl:for-each>
2581
- </xsl:variable>
2582
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2583
-
2584
- <!-- <column_widths>
2585
- <xsl:copy-of select="$column_widths"/>
2586
- </column_widths> -->
2587
-
2588
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2589
- <xsl:variable name="table_widths_">
2590
- <table>
2591
- <xsl:attribute name="width_max">
2592
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2593
- </xsl:attribute>
2594
- <xsl:attribute name="width_min">
2595
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2596
- </xsl:attribute>
2597
- </table>
2598
- </xsl:variable>
2599
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2600
-
2601
2561
  <xsl:variable name="page_width">
2602
2562
  <xsl:choose>
2603
2563
  <xsl:when test="$parent_table_page-width != ''">
@@ -2610,16 +2570,13 @@
2610
2570
  </xsl:variable>
2611
2571
 
2612
2572
  <xsl:if test="$table_if_debug = 'true'">
2613
- <table_width>
2614
- <xsl:copy-of select="$table_widths"/>
2615
- </table_width>
2616
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2573
+ <page_width><xsl:value-of select="$page_width"/></page_width>
2617
2574
  </xsl:if>
2618
2575
 
2619
2576
  <!-- There are three cases: -->
2620
2577
  <xsl:choose>
2621
2578
  <!-- 1. The minimum table width is equal to or wider than the available space -->
2622
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2579
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2623
2580
  <!-- call old algorithm -->
2624
2581
  <case1/>
2625
2582
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -2629,10 +2586,10 @@
2629
2586
  </xsl:call-template> -->
2630
2587
  </xsl:when>
2631
2588
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2632
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2589
+ <xsl:when test="@width_max &lt;= $page_width">
2633
2590
  <case2/>
2634
2591
  <autolayout/>
2635
- <xsl:for-each select="$column_widths/column/@width_max">
2592
+ <xsl:for-each select="column/@width_max">
2636
2593
  <column divider="100"><xsl:value-of select="."/></column>
2637
2594
  </xsl:for-each>
2638
2595
  </xsl:when>
@@ -2642,19 +2599,19 @@
2642
2599
  For each column, let d be the difference between maximum and minimum width of that column.
2643
2600
  Now set the column's width to the minimum width plus d times W over D.
2644
2601
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2645
- <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)">
2602
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
2646
2603
  <!-- difference between the available space and the minimum table width -->
2647
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2604
+ <xsl:variable name="W" select="$page_width - @width_min"/>
2648
2605
  <W><xsl:value-of select="$W"/></W>
2649
2606
  <!-- difference between maximum and minimum width of the table -->
2650
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2607
+ <xsl:variable name="D" select="@width_max - @width_min"/>
2651
2608
  <D><xsl:value-of select="$D"/></D>
2652
2609
  <case3/>
2653
2610
  <autolayout/>
2654
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2611
+ <xsl:if test="@width_min &gt;= $page_width">
2655
2612
  <split_keep-within-line>true</split_keep-within-line>
2656
2613
  </xsl:if>
2657
- <xsl:for-each select="$column_widths/column">
2614
+ <xsl:for-each select="column">
2658
2615
  <!-- difference between maximum and minimum width of that column. -->
2659
2616
  <xsl:variable name="d" select="@width_max - @width_min"/>
2660
2617
  <d><xsl:value-of select="$d"/></d>
@@ -2680,23 +2637,39 @@
2680
2637
 
2681
2638
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
2682
2639
 
2640
+ <ancestor_tree>
2641
+ <xsl:for-each select="ancestor::*">
2642
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
2643
+ </xsl:for-each>
2644
+ </ancestor_tree>
2645
+
2683
2646
  <xsl:variable name="parent_table_page-width_">
2684
2647
  <xsl:if test="$parent_table_id != ''">
2685
2648
  <!-- determine column number in the parent table -->
2686
2649
  <xsl:variable name="parent_table_column_number">
2687
2650
  <xsl:choose>
2688
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
2651
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
2652
+ <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>
2689
2653
  <xsl:otherwise> <!-- parent is table -->
2690
2654
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
2691
2655
  </xsl:otherwise>
2692
2656
  </xsl:choose>
2693
2657
  </xsl:variable>
2694
2658
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
2695
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2659
+
2660
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2661
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
2662
+ <!-- <xsl:variable name="divider">
2663
+ <xsl:value-of select="$parent_table_column/@divider"/>
2664
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
2665
+ </xsl:variable> -->
2666
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
2696
2667
  </xsl:if>
2697
2668
  </xsl:variable>
2698
2669
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
2699
2670
 
2671
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
2672
+
2700
2673
  <!-- get current table id -->
2701
2674
  <xsl:variable name="table_id" select="@id"/>
2702
2675
 
@@ -2717,50 +2690,6 @@
2717
2690
 
2718
2691
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
2719
2692
 
2720
- <!-- ============================= -->
2721
- <!-- mode: determine_cell_widths-if -->
2722
- <!-- ============================= -->
2723
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
2724
- <xsl:copy>
2725
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2726
- </xsl:copy>
2727
- </xsl:template>
2728
-
2729
- <xsl:template match="td | th" mode="determine_cell_widths-if">
2730
- <xsl:copy>
2731
- <xsl:copy-of select="@*"/>
2732
-
2733
- <!-- The maximum width is given by the widest line. -->
2734
- <xsl:attribute name="width_max">
2735
- <xsl:for-each select="p_len">
2736
- <xsl:sort select="." data-type="number" order="descending"/>
2737
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2738
- </xsl:for-each>
2739
- </xsl:attribute>
2740
-
2741
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2742
- <xsl:variable name="width_min">
2743
- <xsl:for-each select="word_len">
2744
- <xsl:sort select="." data-type="number" order="descending"/>
2745
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2746
- </xsl:for-each>
2747
- </xsl:variable>
2748
- <xsl:attribute name="width_min">
2749
- <xsl:value-of select="$width_min"/>
2750
- </xsl:attribute>
2751
-
2752
- <xsl:if test="$width_min = 0">
2753
- <xsl:attribute name="width_min">1</xsl:attribute>
2754
- </xsl:if>
2755
-
2756
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2757
-
2758
- </xsl:copy>
2759
- </xsl:template>
2760
- <!-- ============================= -->
2761
- <!-- END mode: determine_cell_widths-if -->
2762
- <!-- ============================= -->
2763
-
2764
2693
  <!-- ================================================== -->
2765
2694
  <!-- Calculate column's width based on HTML4 algorithm -->
2766
2695
  <!-- ================================================== -->
@@ -2951,6 +2880,7 @@
2951
2880
  <xsl:when test="$table_or_dl = 'table'">
2952
2881
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
2953
2882
  <fo:table-row number-columns-spanned="{$col_count}">
2883
+ <xsl:copy-of select="../@font-weight"/>
2954
2884
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
2955
2885
  <xsl:call-template name="td"/>
2956
2886
  </fo:table-row>
@@ -3097,7 +3027,7 @@
3097
3027
 
3098
3028
  <xsl:apply-templates/>
3099
3029
 
3100
- <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"/> -->
3030
+ <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"/> -->
3101
3031
 
3102
3032
  </fo:block>
3103
3033
  </fo:table-cell>
@@ -3423,6 +3353,7 @@
3423
3353
  <xsl:template match="*[local-name()='dl']">
3424
3354
  <xsl:variable name="isAdded" select="@added"/>
3425
3355
  <xsl:variable name="isDeleted" select="@deleted"/>
3356
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
3426
3357
  <fo:block-container>
3427
3358
 
3428
3359
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -3956,21 +3887,16 @@
3956
3887
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
3957
3888
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
3958
3889
  <xsl:param name="id"/>
3959
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3960
3890
  <tr>
3961
3891
  <td>
3962
3892
  <xsl:copy-of select="node()"/>
3963
3893
  </td>
3964
3894
  <td>
3965
-
3966
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
3967
-
3968
- <!-- get paragraphs from nested 'dl' -->
3969
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
3970
-
3895
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
3896
+ <!-- get paragraphs from nested 'dl' -->
3897
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
3971
3898
  </td>
3972
3899
  </tr>
3973
-
3974
3900
  </xsl:template>
3975
3901
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
3976
3902
 
@@ -4624,6 +4550,9 @@
4624
4550
  <xsl:variable name="td">
4625
4551
  <xsl:element name="td">
4626
4552
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
4553
+ <xsl:if test="local-name()='th'">
4554
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4555
+ </xsl:if>
4627
4556
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4628
4557
  <xsl:apply-templates mode="simple-table-colspan"/>
4629
4558
  </xsl:element>
@@ -4636,6 +4565,9 @@
4636
4565
  <xsl:otherwise>
4637
4566
  <xsl:element name="td">
4638
4567
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4568
+ <xsl:if test="local-name()='th'">
4569
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4570
+ </xsl:if>
4639
4571
  <xsl:apply-templates mode="simple-table-colspan"/>
4640
4572
  </xsl:element>
4641
4573
  </xsl:otherwise>
@@ -4765,8 +4697,14 @@
4765
4697
  <xsl:copy-of select="@*"/>
4766
4698
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4767
4699
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4700
+ <xsl:variable name="divide">
4701
+ <xsl:choose>
4702
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
4703
+ <xsl:otherwise>1</xsl:otherwise>
4704
+ </xsl:choose>
4705
+ </xsl:variable>
4768
4706
  <xsl:attribute name="id">
4769
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4707
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
4770
4708
  </xsl:attribute>
4771
4709
 
4772
4710
  <xsl:for-each select="*[local-name() = 'p']">
@@ -4774,10 +4712,12 @@
4774
4712
  <xsl:copy-of select="@*"/>
4775
4713
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
4776
4714
  <xsl:attribute name="id">
4777
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4715
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
4778
4716
  </xsl:attribute>
4779
4717
 
4780
- <xsl:copy-of select="node()"/>
4718
+ <!-- <xsl:copy-of select="node()" /> -->
4719
+ <xsl:apply-templates mode="simple-table-noid"/>
4720
+
4781
4721
  </xsl:copy>
4782
4722
  </xsl:for-each>
4783
4723
 
@@ -4806,7 +4746,7 @@
4806
4746
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
4807
4747
  <xsl:copy>
4808
4748
  <xsl:attribute name="id">
4809
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4749
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
4810
4750
  </xsl:attribute>
4811
4751
  <xsl:copy-of select="node()"/>
4812
4752
  </xsl:copy>
@@ -4815,6 +4755,24 @@
4815
4755
  </xsl:copy>
4816
4756
 
4817
4757
  </xsl:template>
4758
+
4759
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
4760
+ <xsl:copy>
4761
+ <xsl:choose>
4762
+ <xsl:when test="$isGenerateTableIF = 'true'">
4763
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
4764
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
4765
+ <xsl:copy-of select="@id"/>
4766
+ </xsl:if> -->
4767
+ </xsl:when>
4768
+ <xsl:otherwise>
4769
+ <xsl:copy-of select="@*"/>
4770
+ </xsl:otherwise>
4771
+ </xsl:choose>
4772
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
4773
+ </xsl:copy>
4774
+ </xsl:template>
4775
+
4818
4776
  <!-- End mode: simple-table-id -->
4819
4777
  <!-- ===================== -->
4820
4778
  <!-- ===================== -->
@@ -4824,7 +4782,7 @@
4824
4782
  <!-- =============================== -->
4825
4783
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
4826
4784
  <xsl:copy>
4827
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4785
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4828
4786
  </xsl:copy>
4829
4787
  </xsl:template>
4830
4788
 
@@ -4938,6 +4896,10 @@
4938
4896
 
4939
4897
  <fo:inline xsl:use-attribute-sets="mathml-style">
4940
4898
 
4899
+ <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 -->
4900
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
4901
+ </xsl:if>
4902
+
4941
4903
  <xsl:call-template name="setTrackChangesStyles">
4942
4904
  <xsl:with-param name="isAdded" select="$isAdded"/>
4943
4905
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -6815,41 +6777,47 @@
6815
6777
  </fo:block>
6816
6778
  </xsl:template>
6817
6779
 
6818
- <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
6780
+ <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']">
6819
6781
  <fo:block xsl:use-attribute-sets="inherit-style">
6820
6782
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
6821
6783
  </fo:block>
6822
6784
  </xsl:template>
6823
6785
 
6824
- <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
6786
+ <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']">
6825
6787
  <fo:block xsl:use-attribute-sets="description-style">
6826
6788
  <xsl:apply-templates/>
6827
6789
  </fo:block>
6828
6790
  </xsl:template>
6829
6791
 
6830
- <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
6792
+ <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']">
6831
6793
  <fo:block xsl:use-attribute-sets="specification-style">
6832
6794
  <xsl:apply-templates/>
6833
6795
  </fo:block>
6834
6796
  </xsl:template>
6835
6797
 
6836
- <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
6798
+ <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']">
6837
6799
  <fo:block xsl:use-attribute-sets="measurement-target-style">
6838
6800
  <xsl:apply-templates/>
6839
6801
  </fo:block>
6840
6802
  </xsl:template>
6841
6803
 
6842
- <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
6804
+ <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']">
6843
6805
  <fo:block xsl:use-attribute-sets="verification-style">
6844
6806
  <xsl:apply-templates/>
6845
6807
  </fo:block>
6846
6808
  </xsl:template>
6847
6809
 
6848
- <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
6810
+ <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']">
6849
6811
  <fo:block xsl:use-attribute-sets="import-style">
6850
6812
  <xsl:apply-templates/>
6851
6813
  </fo:block>
6852
6814
  </xsl:template>
6815
+
6816
+ <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')]">
6817
+ <fo:block xsl:use-attribute-sets="component-style">
6818
+ <xsl:apply-templates/>
6819
+ </fo:block>
6820
+ </xsl:template>
6853
6821
  <!-- ========== -->
6854
6822
  <!-- END -->
6855
6823
  <!-- ========== -->
@@ -6905,15 +6873,12 @@
6905
6873
 
6906
6874
  <xsl:template match="*[local-name()='tr']" mode="requirement">
6907
6875
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
6908
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
6909
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
6910
- </xsl:if>
6911
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
6912
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
6913
- </xsl:if>
6914
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
6915
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
6876
+
6877
+ <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 ')">
6878
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6879
+
6916
6880
  </xsl:if>
6881
+
6917
6882
  <xsl:apply-templates mode="requirement"/>
6918
6883
  </fo:table-row>
6919
6884
  </xsl:template>
@@ -8439,7 +8404,7 @@
8439
8404
  </tbody>
8440
8405
  </xsl:variable>
8441
8406
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
8442
- <xsl:call-template name="calculate-column-widths">
8407
+ <xsl:call-template name="calculate-column-widths-proportional">
8443
8408
  <xsl:with-param name="cols-count" select="$cols-count"/>
8444
8409
  <xsl:with-param name="table" select="$toc_table_simple"/>
8445
8410
  </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 CC
3
- VERSION = "2.1.6".freeze
3
+ VERSION = "2.1.8.1".freeze
4
4
  end
5
5
  end
data/lib/metanorma-cc.rb CHANGED
@@ -4,8 +4,9 @@ require_relative "isodoc/cc/html_convert"
4
4
  require_relative "isodoc/cc/word_convert"
5
5
  require_relative "isodoc/cc/pdf_convert"
6
6
  require_relative "metanorma/cc/version"
7
+ require "metanorma"
7
8
 
8
- if defined? Metanorma
9
+ if defined? Metanorma::Registry
9
10
  require_relative "metanorma/cc"
10
11
  Metanorma::Registry.instance.register(Metanorma::CC::Processor)
11
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
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"
@@ -233,7 +234,7 @@ homepage: https://github.com/metanorma/metanorma-cc
233
234
  licenses:
234
235
  - BSD-2-Clause
235
236
  metadata: {}
236
- post_install_message:
237
+ post_install_message:
237
238
  rdoc_options: []
238
239
  require_paths:
239
240
  - lib
@@ -248,8 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
249
  - !ruby/object:Gem::Version
249
250
  version: '0'
250
251
  requirements: []
251
- rubygems_version: 3.3.16
252
- signing_key:
252
+ rubygems_version: 3.1.6
253
+ signing_key:
253
254
  specification_version: 4
254
255
  summary: metanorma-cc lets you write CalConnect standards in AsciiDoc.
255
256
  test_files: []