metanorma-csa 2.2.1 → 2.2.2

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: 3f685276b592de3a6020087f07bffbe7e6b616a4fe297942b455f48ec609e858
4
- data.tar.gz: af28b9eeffc3381c801ccddd18c31e67a69342938291a0c713bdfd2245418e8c
3
+ metadata.gz: 806a51a66247c3398f78d9f516525b0f2aaa3fe83d669038d0dccc9c7daceea0
4
+ data.tar.gz: 1aa70cd654e05d3acccfb0879309815e5c1b4bc48a2086d07b6be3d52aff1704
5
5
  SHA512:
6
- metadata.gz: 1ba656baf21d649630fa8d9cb68050f6156b040f11604856553496ba34c9fac5056aca4bc15b44fc32e9697c744d5c6df19b177c9e0d6aca07855ae0259452a6
7
- data.tar.gz: 7259d9fbef72983e99749dca8eee07bfb09d6d9a02bfd8f5a458c356ed46293385a5a37b6f27853eee0261f2758def49f066e351aa123fbcb87066e386313641
6
+ metadata.gz: f6b1e0ca4b2895aea8c96f514edd8cfcba2270ea96be1d84e3357df6f941bbb1d3e72a8b3f9c85846296272385570e1817cf8af8c98c67c44bf4c9563b6ae801
7
+ data.tar.gz: 4724482cd93a0e9b4f615e824156bec5569469c458c0fcedb274a6dce49bc927f5e8eebcfd321e7fe271734b5dd331916d5d580ebf478a14e9db022987b338a2
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="yes"/>
4
4
 
5
- <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
5
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -3128,7 +3128,7 @@
3128
3128
  </fn>
3129
3129
  -->
3130
3130
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
3131
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
3131
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
3132
3132
 
3133
3133
  <!-- list of footnotes to calculate actual footnotes number -->
3134
3134
  <xsl:variable name="p_fn_">
@@ -3185,8 +3185,7 @@
3185
3185
  </fo:basic-link>
3186
3186
  </fo:inline>
3187
3187
  </xsl:variable>
3188
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3189
- gen_id=<xsl:value-of select="$gen_id"/> -->
3188
+
3190
3189
  <xsl:choose>
3191
3190
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3192
3191
  <xsl:copy-of select="$footnote_inline"/>
@@ -3241,7 +3240,7 @@
3241
3240
  <!-- commented:
3242
3241
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3243
3242
  because 'fn' there is in biblio-tag -->
3244
- <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3243
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3245
3244
  <!-- copy unique fn -->
3246
3245
  <fn gen_id="{generate-id(.)}">
3247
3246
  <xsl:copy-of select="@*"/>
@@ -5783,7 +5782,9 @@
5783
5782
 
5784
5783
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
5785
5784
  <xsl:if test="number($scale) &lt; 100">
5786
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5785
+
5786
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5787
+
5787
5788
  </xsl:if>
5788
5789
 
5789
5790
  </xsl:if>
@@ -6798,6 +6799,12 @@
6798
6799
  </xsl:attribute>
6799
6800
  </xsl:for-each>
6800
6801
 
6802
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
6803
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
6804
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
6805
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6806
+ </xsl:if>
6807
+
6801
6808
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6802
6809
  </fo:block>
6803
6810
 
@@ -6846,7 +6853,7 @@
6846
6853
  </xsl:template>
6847
6854
 
6848
6855
  <!-- outer table with line numbers for sourcecode -->
6849
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
6856
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
6850
6857
  <fo:block>
6851
6858
  <fo:table width="100%" table-layout="fixed">
6852
6859
  <xsl:copy-of select="@id"/>
@@ -6858,16 +6865,16 @@
6858
6865
  </fo:table>
6859
6866
  </fo:block>
6860
6867
  </xsl:template>
6861
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
6868
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
6862
6869
  <xsl:apply-templates/>
6863
6870
  </xsl:template>
6864
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
6871
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
6865
6872
  <fo:table-row>
6866
6873
  <xsl:apply-templates/>
6867
6874
  </fo:table-row>
6868
6875
  </xsl:template>
6869
6876
  <!-- first td with line numbers -->
6870
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
6877
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
6871
6878
  <fo:table-cell>
6872
6879
  <fo:block>
6873
6880
 
@@ -6887,8 +6894,9 @@
6887
6894
  </fo:block>
6888
6895
  </fo:table-cell>
6889
6896
  </xsl:template>
6897
+
6890
6898
  <!-- second td with sourcecode -->
6891
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
6899
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
6892
6900
  <fo:table-cell>
6893
6901
  <fo:block>
6894
6902
  <xsl:apply-templates/>
@@ -7126,7 +7134,25 @@
7126
7134
  <xsl:template match="*[local-name()='pre']" name="pre">
7127
7135
  <fo:block xsl:use-attribute-sets="pre-style">
7128
7136
  <xsl:copy-of select="@id"/>
7129
- <xsl:apply-templates/>
7137
+ <xsl:choose>
7138
+
7139
+ <xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
7140
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
7141
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7142
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7143
+ </xsl:if>
7144
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
7145
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
7146
+ <mtext><xsl:value-of select="."/></mtext>
7147
+ </math>
7148
+ </fo:instream-foreign-object>
7149
+ </xsl:when>
7150
+
7151
+ <xsl:otherwise>
7152
+ <xsl:apply-templates/>
7153
+ </xsl:otherwise>
7154
+
7155
+ </xsl:choose>
7130
7156
  </fo:block>
7131
7157
  </xsl:template>
7132
7158
  <!-- =============== -->
@@ -131,6 +131,35 @@ a.FootnoteRef + a.FootnoteRef:before {
131
131
  color: red;
132
132
  text-decoration: line-through; }
133
133
 
134
+ /* code highlighting with line numbers */
135
+ table.rouge-line-table td.rouge-gutter {
136
+ -moz-user-select: none;
137
+ -ms-user-select: none;
138
+ -webkit-user-select: none;
139
+ user-select: none;
140
+ padding-right: 1em; }
141
+
142
+ table.rouge-line-table td.rouge-code {
143
+ -moz-user-select: all;
144
+ -ms-user-select: all;
145
+ -webkit-user-select: all;
146
+ user-select: all; }
147
+
148
+ table.rouge-line-table,
149
+ table.rouge-line-table th,
150
+ table.rouge-line-table td {
151
+ width: auto;
152
+ border: none;
153
+ margin: 0;
154
+ padding: 0;
155
+ font-size: 100%; }
156
+
157
+ table.rouge-line-table pre {
158
+ margin: 0;
159
+ padding: 0;
160
+ overflow-x: visible;
161
+ font-size: 100%; }
162
+
134
163
  #standard-band {
135
164
  background-color: #0AC442; }
136
165
 
@@ -765,7 +794,7 @@ table {
765
794
  table th, table td {
766
795
  padding: 1em; }
767
796
  table td.header {
768
- font-weigth: 400; }
797
+ font-weight: 400; }
769
798
 
770
799
  table,
771
800
  th,
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.2.1".freeze
3
+ VERSION = "2.2.2".freeze
4
4
  end
5
5
  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.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-19 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic