metanorma-cc 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7711b9675bcfab88ba0624be6f88f5ac5262e06b1f31b18a676ab370f9f83736
4
- data.tar.gz: 1af7111b2d6341c4264d8a8e639b538036ea98bd8d1ee909740101adad8c8d4f
3
+ metadata.gz: 9124c14de0cd844286cab8171a3d7305ba2ed3685b3677e98919cc3590bd2aac
4
+ data.tar.gz: 2640468029927350d7053f782a13651037176f9f6e020cff210393d7d9f927c0
5
5
  SHA512:
6
- metadata.gz: dcb84e476aa6a99ab5575246b9ac9a3770476c737dadc098db6450a3f97df8168a0f9a28b70283a274d2534d6b84e77b6d7d2ed3d38c81401c558ca3cc93daef
7
- data.tar.gz: bae80bf550876a114d6c48e170e115dbd6f340dc60c7a0227c0e81115bae9542808bf17966d8d630e69afd9457821061626d9c1489afd027e457ee4c23cf0f44
6
+ metadata.gz: 815f627fb1c06b7d1bd988a23f61e00e07c5508d11eb1ef132377e45ada04d7bed86cf9f1c7beb94c43242096bd20ae9ef34c7a61d5811245da35479f05d16cd
7
+ data.tar.gz: d8fb0071eda29cf42cea9c63982f9306027bb181bd382caa86b8ee4488d05788d136bbd035ec7a345917c503dfdcb925721d9a9be6e7bb27b5915dd853ead5ad
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
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
 
@@ -3102,7 +3102,7 @@
3102
3102
  </fn>
3103
3103
  -->
3104
3104
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
3105
- <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">
3105
+ <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">
3106
3106
 
3107
3107
  <!-- list of footnotes to calculate actual footnotes number -->
3108
3108
  <xsl:variable name="p_fn_">
@@ -3159,8 +3159,7 @@
3159
3159
  </fo:basic-link>
3160
3160
  </fo:inline>
3161
3161
  </xsl:variable>
3162
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3163
- gen_id=<xsl:value-of select="$gen_id"/> -->
3162
+
3164
3163
  <xsl:choose>
3165
3164
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3166
3165
  <xsl:copy-of select="$footnote_inline"/>
@@ -3215,7 +3214,7 @@
3215
3214
  <!-- commented:
3216
3215
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3217
3216
  because 'fn' there is in biblio-tag -->
3218
- <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])]">
3217
+ <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])]">
3219
3218
  <!-- copy unique fn -->
3220
3219
  <fn gen_id="{generate-id(.)}">
3221
3220
  <xsl:copy-of select="@*"/>
@@ -5754,7 +5753,9 @@
5754
5753
 
5755
5754
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
5756
5755
  <xsl:if test="number($scale) &lt; 100">
5757
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5756
+
5757
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5758
+
5758
5759
  </xsl:if>
5759
5760
 
5760
5761
  </xsl:if>
@@ -6770,6 +6771,12 @@
6770
6771
  </xsl:attribute>
6771
6772
  </xsl:for-each>
6772
6773
 
6774
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
6775
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
6776
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
6777
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6778
+ </xsl:if>
6779
+
6773
6780
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6774
6781
  </fo:block>
6775
6782
 
@@ -6818,7 +6825,7 @@
6818
6825
  </xsl:template>
6819
6826
 
6820
6827
  <!-- outer table with line numbers for sourcecode -->
6821
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
6828
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
6822
6829
  <fo:block>
6823
6830
  <fo:table width="100%" table-layout="fixed">
6824
6831
  <xsl:copy-of select="@id"/>
@@ -6830,16 +6837,16 @@
6830
6837
  </fo:table>
6831
6838
  </fo:block>
6832
6839
  </xsl:template>
6833
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
6840
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
6834
6841
  <xsl:apply-templates/>
6835
6842
  </xsl:template>
6836
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
6843
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
6837
6844
  <fo:table-row>
6838
6845
  <xsl:apply-templates/>
6839
6846
  </fo:table-row>
6840
6847
  </xsl:template>
6841
6848
  <!-- first td with line numbers -->
6842
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
6849
+ <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'] -->
6843
6850
  <fo:table-cell>
6844
6851
  <fo:block>
6845
6852
 
@@ -6859,8 +6866,9 @@
6859
6866
  </fo:block>
6860
6867
  </fo:table-cell>
6861
6868
  </xsl:template>
6869
+
6862
6870
  <!-- second td with sourcecode -->
6863
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
6871
+ <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'] -->
6864
6872
  <fo:table-cell>
6865
6873
  <fo:block>
6866
6874
  <xsl:apply-templates/>
@@ -7098,7 +7106,25 @@
7098
7106
  <xsl:template match="*[local-name()='pre']" name="pre">
7099
7107
  <fo:block xsl:use-attribute-sets="pre-style">
7100
7108
  <xsl:copy-of select="@id"/>
7101
- <xsl:apply-templates/>
7109
+ <xsl:choose>
7110
+
7111
+ <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' -->
7112
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
7113
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7114
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7115
+ </xsl:if>
7116
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
7117
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
7118
+ <mtext><xsl:value-of select="."/></mtext>
7119
+ </math>
7120
+ </fo:instream-foreign-object>
7121
+ </xsl:when>
7122
+
7123
+ <xsl:otherwise>
7124
+ <xsl:apply-templates/>
7125
+ </xsl:otherwise>
7126
+
7127
+ </xsl:choose>
7102
7128
  </fo:block>
7103
7129
  </xsl:template>
7104
7130
  <!-- =============== -->
@@ -124,6 +124,35 @@ a.FootnoteRef + a.FootnoteRef:before {
124
124
  color: red;
125
125
  text-decoration: line-through; }
126
126
 
127
+ /* code highlighting with line numbers */
128
+ table.rouge-line-table td.rouge-gutter {
129
+ -moz-user-select: none;
130
+ -ms-user-select: none;
131
+ -webkit-user-select: none;
132
+ user-select: none;
133
+ padding-right: 1em; }
134
+
135
+ table.rouge-line-table td.rouge-code {
136
+ -moz-user-select: all;
137
+ -ms-user-select: all;
138
+ -webkit-user-select: all;
139
+ user-select: all; }
140
+
141
+ table.rouge-line-table,
142
+ table.rouge-line-table th,
143
+ table.rouge-line-table td {
144
+ width: auto;
145
+ border: none;
146
+ margin: 0;
147
+ padding: 0;
148
+ font-size: 100%; }
149
+
150
+ table.rouge-line-table pre {
151
+ margin: 0;
152
+ padding: 0;
153
+ overflow-x: visible;
154
+ font-size: 100%; }
155
+
127
156
  #standard-band {
128
157
  background-color: #0AC442; }
129
158
 
@@ -124,6 +124,35 @@ a.FootnoteRef + a.FootnoteRef:before {
124
124
  color: red;
125
125
  text-decoration: line-through; }
126
126
 
127
+ /* code highlighting with line numbers */
128
+ table.rouge-line-table td.rouge-gutter {
129
+ -moz-user-select: none;
130
+ -ms-user-select: none;
131
+ -webkit-user-select: none;
132
+ user-select: none;
133
+ padding-right: 1em; }
134
+
135
+ table.rouge-line-table td.rouge-code {
136
+ -moz-user-select: all;
137
+ -ms-user-select: all;
138
+ -webkit-user-select: all;
139
+ user-select: all; }
140
+
141
+ table.rouge-line-table,
142
+ table.rouge-line-table th,
143
+ table.rouge-line-table td {
144
+ width: auto;
145
+ border: none;
146
+ margin: 0;
147
+ padding: 0;
148
+ font-size: 100%; }
149
+
150
+ table.rouge-line-table pre {
151
+ margin: 0;
152
+ padding: 0;
153
+ overflow-x: visible;
154
+ font-size: 100%; }
155
+
127
156
  #standard-band {
128
157
  background-color: #0AC442; }
129
158
 
@@ -352,6 +381,35 @@ a.FootnoteRef + a.FootnoteRef:before {
352
381
  color: red;
353
382
  text-decoration: line-through; }
354
383
 
384
+ /* code highlighting with line numbers */
385
+ table.rouge-line-table td.rouge-gutter {
386
+ -moz-user-select: none;
387
+ -ms-user-select: none;
388
+ -webkit-user-select: none;
389
+ user-select: none;
390
+ padding-right: 1em; }
391
+
392
+ table.rouge-line-table td.rouge-code {
393
+ -moz-user-select: all;
394
+ -ms-user-select: all;
395
+ -webkit-user-select: all;
396
+ user-select: all; }
397
+
398
+ table.rouge-line-table,
399
+ table.rouge-line-table th,
400
+ table.rouge-line-table td {
401
+ width: auto;
402
+ border: none;
403
+ margin: 0;
404
+ padding: 0;
405
+ font-size: 100%; }
406
+
407
+ table.rouge-line-table pre {
408
+ margin: 0;
409
+ padding: 0;
410
+ overflow-x: visible;
411
+ font-size: 100%; }
412
+
355
413
  #standard-band {
356
414
  background-color: #0AC442; }
357
415
 
@@ -989,7 +1047,7 @@ table {
989
1047
  table th, table td {
990
1048
  padding: 1em; }
991
1049
  table td.header {
992
- font-weigth: 400; }
1050
+ font-weight: 400; }
993
1051
 
994
1052
  p.TableTitle {
995
1053
  text-align: center;
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
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-cc
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