metanorma-iho 0.7.1 → 0.7.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: ff15d46be3cd4bcd0e0c945fa667a86428776adb3ce71e0b4df4573bd55212c9
4
- data.tar.gz: ba1ce31c0b92bcda79e5b908b3d9ef42628f17aed64cab4da0672e0925ef1ff0
3
+ metadata.gz: dc3ce0e821ab3854c519838c72a4ee34a1b0c90234c80e612a8420e0301eb36d
4
+ data.tar.gz: df2b0c2467b822618caef15fb9354dc86b5149563dc921927543f85c0c73022b
5
5
  SHA512:
6
- metadata.gz: c6b4599aa6390ee14bc3792214c81984092cf8826cddb0d197841cfc4eb0164ec933c4dafa4f9d2da847f47f90268c8c366f0fb12025bf36e62667d771c51a0d
7
- data.tar.gz: 970bb8a0451845ac23a5d5cb59745740d48064cea35ee3ca2f24a4f2ce5fe08cbf31998282c85d4f1759c01a9025ba53a7da2d56c7e317c5b6182107fb6c6d4b
6
+ metadata.gz: 963a17e0a8d7ad5ee3b411f6f32c06952d52d5dd3ce732fc13abcb8bb092f7d9419a80758f2cba12716fbcba5e3d285a4bc4fa58155e636328fb20f3cf89c7c2
7
+ data.tar.gz: 3484aca4a58553675ac2568597a773a724f8e97b3e3d4cab8b00c6ee49e1a2f7a4e594390878708c41b226a261cc592c26153f5ba02043142f14c30c8012a5cb
@@ -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
 
@@ -789,7 +818,7 @@ table {
789
818
  table th, table td {
790
819
  padding: 1em; }
791
820
  table td.header {
792
- font-weigth: 400; }
821
+ font-weight: 400; }
793
822
 
794
823
  p.TableTitle {
795
824
  text-align: center;
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output 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
 
@@ -3427,7 +3427,7 @@
3427
3427
  </fn>
3428
3428
  -->
3429
3429
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
3430
- <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">
3430
+ <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">
3431
3431
 
3432
3432
  <!-- list of footnotes to calculate actual footnotes number -->
3433
3433
  <xsl:variable name="p_fn_">
@@ -3484,8 +3484,7 @@
3484
3484
  </fo:basic-link>
3485
3485
  </fo:inline>
3486
3486
  </xsl:variable>
3487
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3488
- gen_id=<xsl:value-of select="$gen_id"/> -->
3487
+
3489
3488
  <xsl:choose>
3490
3489
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3491
3490
  <xsl:copy-of select="$footnote_inline"/>
@@ -3540,7 +3539,7 @@
3540
3539
  <!-- commented:
3541
3540
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3542
3541
  because 'fn' there is in biblio-tag -->
3543
- <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])]">
3542
+ <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])]">
3544
3543
  <!-- copy unique fn -->
3545
3544
  <fn gen_id="{generate-id(.)}">
3546
3545
  <xsl:copy-of select="@*"/>
@@ -6154,7 +6153,9 @@
6154
6153
 
6155
6154
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
6156
6155
  <xsl:if test="number($scale) &lt; 100">
6157
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6156
+
6157
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6158
+
6158
6159
  </xsl:if>
6159
6160
 
6160
6161
  </xsl:if>
@@ -7168,6 +7169,12 @@
7168
7169
  </xsl:attribute>
7169
7170
  </xsl:for-each>
7170
7171
 
7172
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
7173
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7174
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7175
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7176
+ </xsl:if>
7177
+
7171
7178
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7172
7179
  </fo:block>
7173
7180
 
@@ -7216,7 +7223,7 @@
7216
7223
  </xsl:template>
7217
7224
 
7218
7225
  <!-- outer table with line numbers for sourcecode -->
7219
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
7226
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
7220
7227
  <fo:block>
7221
7228
  <fo:table width="100%" table-layout="fixed">
7222
7229
  <xsl:copy-of select="@id"/>
@@ -7228,16 +7235,16 @@
7228
7235
  </fo:table>
7229
7236
  </fo:block>
7230
7237
  </xsl:template>
7231
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
7238
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
7232
7239
  <xsl:apply-templates/>
7233
7240
  </xsl:template>
7234
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
7241
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
7235
7242
  <fo:table-row>
7236
7243
  <xsl:apply-templates/>
7237
7244
  </fo:table-row>
7238
7245
  </xsl:template>
7239
7246
  <!-- first td with line numbers -->
7240
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
7247
+ <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'] -->
7241
7248
  <fo:table-cell>
7242
7249
  <fo:block>
7243
7250
 
@@ -7257,8 +7264,9 @@
7257
7264
  </fo:block>
7258
7265
  </fo:table-cell>
7259
7266
  </xsl:template>
7267
+
7260
7268
  <!-- second td with sourcecode -->
7261
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
7269
+ <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'] -->
7262
7270
  <fo:table-cell>
7263
7271
  <fo:block>
7264
7272
  <xsl:apply-templates/>
@@ -7496,7 +7504,25 @@
7496
7504
  <xsl:template match="*[local-name()='pre']" name="pre">
7497
7505
  <fo:block xsl:use-attribute-sets="pre-style">
7498
7506
  <xsl:copy-of select="@id"/>
7499
- <xsl:apply-templates/>
7507
+ <xsl:choose>
7508
+
7509
+ <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' -->
7510
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
7511
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7512
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7513
+ </xsl:if>
7514
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
7515
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
7516
+ <mtext><xsl:value-of select="."/></mtext>
7517
+ </math>
7518
+ </fo:instream-foreign-object>
7519
+ </xsl:when>
7520
+
7521
+ <xsl:otherwise>
7522
+ <xsl:apply-templates/>
7523
+ </xsl:otherwise>
7524
+
7525
+ </xsl:choose>
7500
7526
  </fo:block>
7501
7527
  </xsl:template>
7502
7528
  <!-- =============== -->
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output 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
 
@@ -3427,7 +3427,7 @@
3427
3427
  </fn>
3428
3428
  -->
3429
3429
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
3430
- <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">
3430
+ <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">
3431
3431
 
3432
3432
  <!-- list of footnotes to calculate actual footnotes number -->
3433
3433
  <xsl:variable name="p_fn_">
@@ -3484,8 +3484,7 @@
3484
3484
  </fo:basic-link>
3485
3485
  </fo:inline>
3486
3486
  </xsl:variable>
3487
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3488
- gen_id=<xsl:value-of select="$gen_id"/> -->
3487
+
3489
3488
  <xsl:choose>
3490
3489
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3491
3490
  <xsl:copy-of select="$footnote_inline"/>
@@ -3540,7 +3539,7 @@
3540
3539
  <!-- commented:
3541
3540
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3542
3541
  because 'fn' there is in biblio-tag -->
3543
- <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])]">
3542
+ <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])]">
3544
3543
  <!-- copy unique fn -->
3545
3544
  <fn gen_id="{generate-id(.)}">
3546
3545
  <xsl:copy-of select="@*"/>
@@ -6154,7 +6153,9 @@
6154
6153
 
6155
6154
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
6156
6155
  <xsl:if test="number($scale) &lt; 100">
6157
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6156
+
6157
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6158
+
6158
6159
  </xsl:if>
6159
6160
 
6160
6161
  </xsl:if>
@@ -7168,6 +7169,12 @@
7168
7169
  </xsl:attribute>
7169
7170
  </xsl:for-each>
7170
7171
 
7172
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
7173
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7174
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7175
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7176
+ </xsl:if>
7177
+
7171
7178
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7172
7179
  </fo:block>
7173
7180
 
@@ -7216,7 +7223,7 @@
7216
7223
  </xsl:template>
7217
7224
 
7218
7225
  <!-- outer table with line numbers for sourcecode -->
7219
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
7226
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
7220
7227
  <fo:block>
7221
7228
  <fo:table width="100%" table-layout="fixed">
7222
7229
  <xsl:copy-of select="@id"/>
@@ -7228,16 +7235,16 @@
7228
7235
  </fo:table>
7229
7236
  </fo:block>
7230
7237
  </xsl:template>
7231
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
7238
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
7232
7239
  <xsl:apply-templates/>
7233
7240
  </xsl:template>
7234
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
7241
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
7235
7242
  <fo:table-row>
7236
7243
  <xsl:apply-templates/>
7237
7244
  </fo:table-row>
7238
7245
  </xsl:template>
7239
7246
  <!-- first td with line numbers -->
7240
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
7247
+ <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'] -->
7241
7248
  <fo:table-cell>
7242
7249
  <fo:block>
7243
7250
 
@@ -7257,8 +7264,9 @@
7257
7264
  </fo:block>
7258
7265
  </fo:table-cell>
7259
7266
  </xsl:template>
7267
+
7260
7268
  <!-- second td with sourcecode -->
7261
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
7269
+ <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'] -->
7262
7270
  <fo:table-cell>
7263
7271
  <fo:block>
7264
7272
  <xsl:apply-templates/>
@@ -7496,7 +7504,25 @@
7496
7504
  <xsl:template match="*[local-name()='pre']" name="pre">
7497
7505
  <fo:block xsl:use-attribute-sets="pre-style">
7498
7506
  <xsl:copy-of select="@id"/>
7499
- <xsl:apply-templates/>
7507
+ <xsl:choose>
7508
+
7509
+ <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' -->
7510
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
7511
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7512
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7513
+ </xsl:if>
7514
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
7515
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
7516
+ <mtext><xsl:value-of select="."/></mtext>
7517
+ </math>
7518
+ </fo:instream-foreign-object>
7519
+ </xsl:when>
7520
+
7521
+ <xsl:otherwise>
7522
+ <xsl:apply-templates/>
7523
+ </xsl:otherwise>
7524
+
7525
+ </xsl:choose>
7500
7526
  </fo:block>
7501
7527
  </xsl:template>
7502
7528
  <!-- =============== -->
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.7.1".freeze
3
+ VERSION = "0.7.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.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