metanorma-csa 2.1.7 → 2.1.8

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: d89f92b084a0f4ab7795704868a3f4ef068971ac3dca72a17fa6e2d87cf2457d
4
- data.tar.gz: ae014752281077ff5f729c159417bed3f250691f0e0ffb2d820a9886af5a38c0
3
+ metadata.gz: 357398e41b0ef4578ddc860fb07f9362a08a0f328761e51c081145ae136876c8
4
+ data.tar.gz: 2fc5973e45e3de787fb5a4d0e0c8547ad59955538bc02769911e01b46b2be682
5
5
  SHA512:
6
- metadata.gz: fc2a542d189a6331a92f1a38ab49e6996707fadcc00d372edc7dc43e30b1129fa54e7d3f094e4160edb7f0b2ec9152d360e6d6a64a2a1345abf8e600fe965a0f
7
- data.tar.gz: 40ff6ae3ec509bc34437e3630d0d5234cee1d170f6659131dd37b99704a7be89734baf5a0213e1fba3ffb504aa2f868edda5a22b920bdd94e3c2a4b5d41c8b48
6
+ metadata.gz: ec885ceec9ee2fd164859646646bc06d6200612ec77b4bd5d465ea7170dd0fa21f64a65e3d0b83a76337e0f6db6626a2590b7319061034ac17637bf0f69ee6cd
7
+ data.tar.gz: d13c3a960df5c9802ff586654c49c786b7cc0f4a17a7ca6c105814adf9f7a91eb51b22c8ea0af85000d3f3cd29451972743abcd2737709be5b6709b0feb3e850
@@ -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
+
@@ -599,8 +599,18 @@
599
599
 
600
600
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
601
601
 
602
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
603
+ true
604
+ </xsl:variable>
605
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
606
+
602
607
  <xsl:variable name="isGenerateTableIF_">
603
- false
608
+ <xsl:choose>
609
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
610
+ <xsl:value-of select="normalize-space($table_if) = 'true'"/>
611
+ </xsl:when>
612
+ <xsl:otherwise>false</xsl:otherwise>
613
+ </xsl:choose>
604
614
  </xsl:variable>
605
615
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
606
616
 
@@ -1195,7 +1205,7 @@
1195
1205
  </xsl:attribute-set>
1196
1206
 
1197
1207
  <xsl:attribute-set name="dt-block-style">
1198
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1208
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1199
1209
 
1200
1210
  </xsl:attribute-set>
1201
1211
 
@@ -2169,6 +2179,7 @@
2169
2179
 
2170
2180
  <xsl:variable name="margin-side">
2171
2181
  <xsl:choose>
2182
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
2172
2183
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2173
2184
  <xsl:otherwise>0</xsl:otherwise>
2174
2185
  </xsl:choose>
@@ -2237,6 +2248,7 @@
2237
2248
  </td>
2238
2249
  </tr>
2239
2250
  -->
2251
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
2240
2252
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2241
2253
 
2242
2254
  </xsl:when>
@@ -2371,12 +2383,17 @@
2371
2383
  <xsl:template name="calculate-column-widths">
2372
2384
  <xsl:param name="table"/>
2373
2385
  <xsl:param name="cols-count"/>
2374
-
2386
+ <xsl:choose>
2387
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
2388
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
2389
+ </xsl:when>
2390
+ <xsl:otherwise>
2375
2391
  <xsl:call-template name="calculate-column-widths-proportional">
2376
2392
  <xsl:with-param name="cols-count" select="$cols-count"/>
2377
2393
  <xsl:with-param name="table" select="$table"/>
2378
2394
  </xsl:call-template>
2379
-
2395
+ </xsl:otherwise>
2396
+ </xsl:choose>
2380
2397
  </xsl:template>
2381
2398
 
2382
2399
  <!-- ================================================== -->
@@ -2554,6 +2571,7 @@
2554
2571
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
2555
2572
  <!-- ================================================== -->
2556
2573
 
2574
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
2557
2575
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
2558
2576
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2559
2577
 
@@ -2565,67 +2583,6 @@
2565
2583
 
2566
2584
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2567
2585
 
2568
- <!-- get current table id -->
2569
- <xsl:variable name="table_id" select="@id"/>
2570
- <!-- find table by id in the file 'table_widths' -->
2571
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2572
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2573
-
2574
- <!-- table='<xsl:copy-of select="$table"/>' -->
2575
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2576
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2577
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2578
-
2579
- <xsl:variable name="table_with_cell_widths_">
2580
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2581
- </xsl:variable>
2582
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2583
-
2584
- <!-- <xsl:if test="$table_if_debug = 'true'">
2585
- <xsl:copy-of select="$table_with_cell_widths"/>
2586
- </xsl:if> -->
2587
-
2588
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2589
-
2590
- <xsl:variable name="column_widths_">
2591
- <!-- iteration of columns -->
2592
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2593
- <xsl:variable name="pos" select="position()"/>
2594
- <column>
2595
- <xsl:attribute name="width_max">
2596
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2597
- <xsl:sort select="." data-type="number" order="descending"/>
2598
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2599
- </xsl:for-each>
2600
- </xsl:attribute>
2601
- <xsl:attribute name="width_min">
2602
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2603
- <xsl:sort select="." data-type="number" order="descending"/>
2604
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2605
- </xsl:for-each>
2606
- </xsl:attribute>
2607
- </column>
2608
- </xsl:for-each>
2609
- </xsl:variable>
2610
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2611
-
2612
- <!-- <column_widths>
2613
- <xsl:copy-of select="$column_widths"/>
2614
- </column_widths> -->
2615
-
2616
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2617
- <xsl:variable name="table_widths_">
2618
- <table>
2619
- <xsl:attribute name="width_max">
2620
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2621
- </xsl:attribute>
2622
- <xsl:attribute name="width_min">
2623
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2624
- </xsl:attribute>
2625
- </table>
2626
- </xsl:variable>
2627
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2628
-
2629
2586
  <xsl:variable name="page_width">
2630
2587
  <xsl:choose>
2631
2588
  <xsl:when test="$parent_table_page-width != ''">
@@ -2638,16 +2595,13 @@
2638
2595
  </xsl:variable>
2639
2596
 
2640
2597
  <xsl:if test="$table_if_debug = 'true'">
2641
- <table_width>
2642
- <xsl:copy-of select="$table_widths"/>
2643
- </table_width>
2644
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2598
+ <page_width><xsl:value-of select="$page_width"/></page_width>
2645
2599
  </xsl:if>
2646
2600
 
2647
2601
  <!-- There are three cases: -->
2648
2602
  <xsl:choose>
2649
2603
  <!-- 1. The minimum table width is equal to or wider than the available space -->
2650
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2604
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2651
2605
  <!-- call old algorithm -->
2652
2606
  <case1/>
2653
2607
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -2657,10 +2611,10 @@
2657
2611
  </xsl:call-template> -->
2658
2612
  </xsl:when>
2659
2613
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2660
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2614
+ <xsl:when test="@width_max &lt;= $page_width">
2661
2615
  <case2/>
2662
2616
  <autolayout/>
2663
- <xsl:for-each select="$column_widths/column/@width_max">
2617
+ <xsl:for-each select="column/@width_max">
2664
2618
  <column divider="100"><xsl:value-of select="."/></column>
2665
2619
  </xsl:for-each>
2666
2620
  </xsl:when>
@@ -2670,19 +2624,19 @@
2670
2624
  For each column, let d be the difference between maximum and minimum width of that column.
2671
2625
  Now set the column's width to the minimum width plus d times W over D.
2672
2626
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2673
- <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)">
2627
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
2674
2628
  <!-- difference between the available space and the minimum table width -->
2675
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2629
+ <xsl:variable name="W" select="$page_width - @width_min"/>
2676
2630
  <W><xsl:value-of select="$W"/></W>
2677
2631
  <!-- difference between maximum and minimum width of the table -->
2678
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2632
+ <xsl:variable name="D" select="@width_max - @width_min"/>
2679
2633
  <D><xsl:value-of select="$D"/></D>
2680
2634
  <case3/>
2681
2635
  <autolayout/>
2682
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2636
+ <xsl:if test="@width_min &gt;= $page_width">
2683
2637
  <split_keep-within-line>true</split_keep-within-line>
2684
2638
  </xsl:if>
2685
- <xsl:for-each select="$column_widths/column">
2639
+ <xsl:for-each select="column">
2686
2640
  <!-- difference between maximum and minimum width of that column. -->
2687
2641
  <xsl:variable name="d" select="@width_max - @width_min"/>
2688
2642
  <d><xsl:value-of select="$d"/></d>
@@ -2708,23 +2662,39 @@
2708
2662
 
2709
2663
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
2710
2664
 
2665
+ <ancestor_tree>
2666
+ <xsl:for-each select="ancestor::*">
2667
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
2668
+ </xsl:for-each>
2669
+ </ancestor_tree>
2670
+
2711
2671
  <xsl:variable name="parent_table_page-width_">
2712
2672
  <xsl:if test="$parent_table_id != ''">
2713
2673
  <!-- determine column number in the parent table -->
2714
2674
  <xsl:variable name="parent_table_column_number">
2715
2675
  <xsl:choose>
2716
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
2676
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
2677
+ <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>
2717
2678
  <xsl:otherwise> <!-- parent is table -->
2718
2679
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
2719
2680
  </xsl:otherwise>
2720
2681
  </xsl:choose>
2721
2682
  </xsl:variable>
2722
2683
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
2723
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2684
+
2685
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2686
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
2687
+ <!-- <xsl:variable name="divider">
2688
+ <xsl:value-of select="$parent_table_column/@divider"/>
2689
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
2690
+ </xsl:variable> -->
2691
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
2724
2692
  </xsl:if>
2725
2693
  </xsl:variable>
2726
2694
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
2727
2695
 
2696
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
2697
+
2728
2698
  <!-- get current table id -->
2729
2699
  <xsl:variable name="table_id" select="@id"/>
2730
2700
 
@@ -2745,50 +2715,6 @@
2745
2715
 
2746
2716
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
2747
2717
 
2748
- <!-- ============================= -->
2749
- <!-- mode: determine_cell_widths-if -->
2750
- <!-- ============================= -->
2751
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
2752
- <xsl:copy>
2753
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2754
- </xsl:copy>
2755
- </xsl:template>
2756
-
2757
- <xsl:template match="td | th" mode="determine_cell_widths-if">
2758
- <xsl:copy>
2759
- <xsl:copy-of select="@*"/>
2760
-
2761
- <!-- The maximum width is given by the widest line. -->
2762
- <xsl:attribute name="width_max">
2763
- <xsl:for-each select="p_len">
2764
- <xsl:sort select="." data-type="number" order="descending"/>
2765
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2766
- </xsl:for-each>
2767
- </xsl:attribute>
2768
-
2769
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2770
- <xsl:variable name="width_min">
2771
- <xsl:for-each select="word_len">
2772
- <xsl:sort select="." data-type="number" order="descending"/>
2773
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2774
- </xsl:for-each>
2775
- </xsl:variable>
2776
- <xsl:attribute name="width_min">
2777
- <xsl:value-of select="$width_min"/>
2778
- </xsl:attribute>
2779
-
2780
- <xsl:if test="$width_min = 0">
2781
- <xsl:attribute name="width_min">1</xsl:attribute>
2782
- </xsl:if>
2783
-
2784
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2785
-
2786
- </xsl:copy>
2787
- </xsl:template>
2788
- <!-- ============================= -->
2789
- <!-- END mode: determine_cell_widths-if -->
2790
- <!-- ============================= -->
2791
-
2792
2718
  <!-- ================================================== -->
2793
2719
  <!-- Calculate column's width based on HTML4 algorithm -->
2794
2720
  <!-- ================================================== -->
@@ -2979,6 +2905,7 @@
2979
2905
  <xsl:when test="$table_or_dl = 'table'">
2980
2906
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
2981
2907
  <fo:table-row number-columns-spanned="{$col_count}">
2908
+ <xsl:copy-of select="../@font-weight"/>
2982
2909
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
2983
2910
  <xsl:call-template name="td"/>
2984
2911
  </fo:table-row>
@@ -3125,7 +3052,7 @@
3125
3052
 
3126
3053
  <xsl:apply-templates/>
3127
3054
 
3128
- <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"/> -->
3055
+ <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"/> -->
3129
3056
 
3130
3057
  </fo:block>
3131
3058
  </fo:table-cell>
@@ -3451,6 +3378,7 @@
3451
3378
  <xsl:template match="*[local-name()='dl']">
3452
3379
  <xsl:variable name="isAdded" select="@added"/>
3453
3380
  <xsl:variable name="isDeleted" select="@deleted"/>
3381
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
3454
3382
  <fo:block-container>
3455
3383
 
3456
3384
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -3984,21 +3912,16 @@
3984
3912
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
3985
3913
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
3986
3914
  <xsl:param name="id"/>
3987
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3988
3915
  <tr>
3989
3916
  <td>
3990
3917
  <xsl:copy-of select="node()"/>
3991
3918
  </td>
3992
3919
  <td>
3993
-
3994
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
3995
-
3996
- <!-- get paragraphs from nested 'dl' -->
3997
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
3998
-
3920
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
3921
+ <!-- get paragraphs from nested 'dl' -->
3922
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
3999
3923
  </td>
4000
3924
  </tr>
4001
-
4002
3925
  </xsl:template>
4003
3926
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4004
3927
 
@@ -4651,6 +4574,9 @@
4651
4574
  <xsl:variable name="td">
4652
4575
  <xsl:element name="td">
4653
4576
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
4577
+ <xsl:if test="local-name()='th'">
4578
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4579
+ </xsl:if>
4654
4580
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4655
4581
  <xsl:apply-templates mode="simple-table-colspan"/>
4656
4582
  </xsl:element>
@@ -4663,6 +4589,9 @@
4663
4589
  <xsl:otherwise>
4664
4590
  <xsl:element name="td">
4665
4591
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4592
+ <xsl:if test="local-name()='th'">
4593
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4594
+ </xsl:if>
4666
4595
  <xsl:apply-templates mode="simple-table-colspan"/>
4667
4596
  </xsl:element>
4668
4597
  </xsl:otherwise>
@@ -4792,8 +4721,14 @@
4792
4721
  <xsl:copy-of select="@*"/>
4793
4722
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4794
4723
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4724
+ <xsl:variable name="divide">
4725
+ <xsl:choose>
4726
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
4727
+ <xsl:otherwise>1</xsl:otherwise>
4728
+ </xsl:choose>
4729
+ </xsl:variable>
4795
4730
  <xsl:attribute name="id">
4796
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4731
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
4797
4732
  </xsl:attribute>
4798
4733
 
4799
4734
  <xsl:for-each select="*[local-name() = 'p']">
@@ -4801,10 +4736,12 @@
4801
4736
  <xsl:copy-of select="@*"/>
4802
4737
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
4803
4738
  <xsl:attribute name="id">
4804
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4739
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
4805
4740
  </xsl:attribute>
4806
4741
 
4807
- <xsl:copy-of select="node()"/>
4742
+ <!-- <xsl:copy-of select="node()" /> -->
4743
+ <xsl:apply-templates mode="simple-table-noid"/>
4744
+
4808
4745
  </xsl:copy>
4809
4746
  </xsl:for-each>
4810
4747
 
@@ -4833,7 +4770,7 @@
4833
4770
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
4834
4771
  <xsl:copy>
4835
4772
  <xsl:attribute name="id">
4836
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4773
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
4837
4774
  </xsl:attribute>
4838
4775
  <xsl:copy-of select="node()"/>
4839
4776
  </xsl:copy>
@@ -4842,6 +4779,24 @@
4842
4779
  </xsl:copy>
4843
4780
 
4844
4781
  </xsl:template>
4782
+
4783
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
4784
+ <xsl:copy>
4785
+ <xsl:choose>
4786
+ <xsl:when test="$isGenerateTableIF = 'true'">
4787
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
4788
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
4789
+ <xsl:copy-of select="@id"/>
4790
+ </xsl:if> -->
4791
+ </xsl:when>
4792
+ <xsl:otherwise>
4793
+ <xsl:copy-of select="@*"/>
4794
+ </xsl:otherwise>
4795
+ </xsl:choose>
4796
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
4797
+ </xsl:copy>
4798
+ </xsl:template>
4799
+
4845
4800
  <!-- End mode: simple-table-id -->
4846
4801
  <!-- ===================== -->
4847
4802
  <!-- ===================== -->
@@ -4851,7 +4806,7 @@
4851
4806
  <!-- =============================== -->
4852
4807
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
4853
4808
  <xsl:copy>
4854
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4809
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4855
4810
  </xsl:copy>
4856
4811
  </xsl:template>
4857
4812
 
@@ -4965,6 +4920,10 @@
4965
4920
 
4966
4921
  <fo:inline xsl:use-attribute-sets="mathml-style">
4967
4922
 
4923
+ <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 -->
4924
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
4925
+ </xsl:if>
4926
+
4968
4927
  <xsl:call-template name="setTrackChangesStyles">
4969
4928
  <xsl:with-param name="isAdded" select="$isAdded"/>
4970
4929
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -6941,15 +6900,12 @@
6941
6900
 
6942
6901
  <xsl:template match="*[local-name()='tr']" mode="requirement">
6943
6902
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
6944
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
6945
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
6946
- </xsl:if>
6947
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
6948
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
6949
- </xsl:if>
6950
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
6951
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
6903
+
6904
+ <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 ')">
6905
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6906
+
6952
6907
  </xsl:if>
6908
+
6953
6909
  <xsl:apply-templates mode="requirement"/>
6954
6910
  </fo:table-row>
6955
6911
  </xsl:template>
@@ -8460,7 +8416,7 @@
8460
8416
  </tbody>
8461
8417
  </xsl:variable>
8462
8418
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
8463
- <xsl:call-template name="calculate-column-widths">
8419
+ <xsl:call-template name="calculate-column-widths-proportional">
8464
8420
  <xsl:with-param name="cols-count" select="$cols-count"/>
8465
8421
  <xsl:with-param name="table" select="$toc_table_simple"/>
8466
8422
  </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 Csa
3
- VERSION = "2.1.7".freeze
3
+ VERSION = "2.1.8".freeze
4
4
  end
5
5
  end
data/lib/metanorma-csa.rb CHANGED
@@ -4,8 +4,9 @@ require_relative 'isodoc/csa/html_convert'
4
4
  require_relative 'isodoc/csa/pdf_convert'
5
5
  require_relative 'isodoc/csa/word_convert'
6
6
  require_relative 'metanorma/csa/version'
7
+ require "metanorma"
7
8
 
8
- if defined? Metanorma
9
+ if defined? Metanorma::Registry
9
10
  require_relative 'metanorma/csa'
10
11
  Metanorma::Registry.instance.register(Metanorma::Csa::Processor)
11
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.7
4
+ version: 2.1.8
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-24 00:00:00.000000000 Z
11
+ date: 2022-09-06 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"
@@ -191,7 +192,6 @@ files:
191
192
  - lib/isodoc/csa/base_convert.rb
192
193
  - lib/isodoc/csa/csa.standard.xsl
193
194
  - lib/isodoc/csa/html/csa-logo-white.png
194
- - lib/isodoc/csa/html/csa.css
195
195
  - lib/isodoc/csa/html/csa.png
196
196
  - lib/isodoc/csa/html/csa.scss
197
197
  - lib/isodoc/csa/html/dots-w@2x.png
@@ -199,12 +199,10 @@ files:
199
199
  - lib/isodoc/csa/html/header.html
200
200
  - lib/isodoc/csa/html/html_csa_intro.html
201
201
  - lib/isodoc/csa/html/html_csa_titlepage.html
202
- - lib/isodoc/csa/html/htmlstyle.css
203
202
  - lib/isodoc/csa/html/htmlstyle.scss
204
203
  - lib/isodoc/csa/html/scripts.html
205
204
  - lib/isodoc/csa/html/word_csa_intro.html
206
205
  - lib/isodoc/csa/html/word_csa_titlepage.html
207
- - lib/isodoc/csa/html/wordstyle.css
208
206
  - lib/isodoc/csa/html/wordstyle.scss
209
207
  - lib/isodoc/csa/html_convert.rb
210
208
  - lib/isodoc/csa/i18n-en.yaml
@@ -232,7 +230,7 @@ homepage: https://github.com/metanorma/metanorma-csa
232
230
  licenses:
233
231
  - BSD-2-Clause
234
232
  metadata: {}
235
- post_install_message:
233
+ post_install_message:
236
234
  rdoc_options: []
237
235
  require_paths:
238
236
  - lib
@@ -247,8 +245,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
245
  - !ruby/object:Gem::Version
248
246
  version: '0'
249
247
  requirements: []
250
- rubygems_version: 3.3.16
251
- signing_key:
248
+ rubygems_version: 3.1.6
249
+ signing_key:
252
250
  specification_version: 4
253
251
  summary: metanorma-csa lets you write CSA Normal Documents (CSAND) in AsciiDoc.
254
252
  test_files: []