metanorma-iec 1.3.7 → 1.3.8

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: a5b9cbe5c402a7dbd3a2b074aefdc52fa620a62c515d8a8d32a904c2198d4c5e
4
- data.tar.gz: 43958dfa8f657c760a67c35d10403123fde662527f0c94402a7f32ab2e582ad2
3
+ metadata.gz: a58308f35d7e4b796b1366d05f48f1d3227e343f52f08a9a756da7567259cb7f
4
+ data.tar.gz: 4e5c5fb98a4178e2d03f6ea74e2b14c5cfd93bf8648496f8c6ad559d6d4b2bfc
5
5
  SHA512:
6
- metadata.gz: 5fa2ca8ae28b7ae9d060a1900f72a362f2d3f64b7cfb36a3b7e537270720be9c01b7eb5df31ca86ce263cc59b3dc08556d517c8c7aab4f9d4170846261b0a197
7
- data.tar.gz: dd32106b4774c119cdd10ce89944f116d146906f70e0ecb29e8094fe45340319c35e1dcc308ebf1f0c95699b6a398b4f970b5878e7730eee27e169d4360841ee
6
+ metadata.gz: d7798dd9aa810e75f931a7bbf408a216107a461d00709c6072b159479a5b7f82eab70bd06d6502e773c1ceb5887f845b29fd70e484c75375ff2526603c1917c0
7
+ data.tar.gz: fb83d221f49cb8ac9b20832dd1bdffa4f7e6d0cd00affde41b18fc99f247e5db46ff0ee3adc8ec3c0d3164060165d916c09afd77fd28802e212385c4f20c270c
@@ -1011,8 +1011,14 @@
1011
1011
  <ref name="imagemap"/>
1012
1012
  <ref name="svgmap"/>
1013
1013
  <ref name="inputform"/>
1014
+ <ref name="toc"/>
1014
1015
  </choice>
1015
1016
  </define>
1017
+ <define name="toc">
1018
+ <element name="toc">
1019
+ <ref name="ul"/>
1020
+ </element>
1021
+ </define>
1016
1022
  <define name="inputform">
1017
1023
  <element name="form">
1018
1024
  <attribute name="id">
@@ -1254,6 +1260,12 @@
1254
1260
  <optional>
1255
1261
  <attribute name="type"/>
1256
1262
  </optional>
1263
+ <optional>
1264
+ <attribute name="identifier"/>
1265
+ </optional>
1266
+ <optional>
1267
+ <attribute name="prefix"/>
1268
+ </optional>
1257
1269
  <text/>
1258
1270
  </define>
1259
1271
  <define name="ics">
@@ -2758,7 +2758,9 @@
2758
2758
 
2759
2759
 
2760
2760
 
2761
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2761
+ </xsl:attribute-set><xsl:variable name="table-border_">
2762
+
2763
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
2762
2764
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2763
2765
 
2764
2766
 
@@ -3082,6 +3084,8 @@
3082
3084
  <fo:block>&#xA0;</fo:block>
3083
3085
  </xsl:if> -->
3084
3086
 
3087
+
3088
+ <!-- Display table's name before table as standalone block -->
3085
3089
  <!-- $namespace = 'iso' or -->
3086
3090
 
3087
3091
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3163,6 +3167,12 @@
3163
3167
 
3164
3168
 
3165
3169
 
3170
+
3171
+
3172
+
3173
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3174
+
3175
+
3166
3176
  <xsl:variable name="table_width">
3167
3177
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3168
3178
  100%
@@ -3179,6 +3189,7 @@
3179
3189
 
3180
3190
 
3181
3191
 
3192
+
3182
3193
  <attribute name="border">0.5pt solid black</attribute>
3183
3194
 
3184
3195
 
@@ -3618,6 +3629,8 @@
3618
3629
  </xsl:choose>
3619
3630
  </xsl:for-each>
3620
3631
 
3632
+
3633
+
3621
3634
  <xsl:choose>
3622
3635
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3623
3636
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -3660,6 +3673,7 @@
3660
3673
 
3661
3674
 
3662
3675
 
3676
+
3663
3677
  <!-- for BSI (not PAS) display Notes before footnotes -->
3664
3678
 
3665
3679
 
@@ -3754,6 +3768,8 @@
3754
3768
  <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
3755
3769
 
3756
3770
 
3771
+
3772
+
3757
3773
  </xsl:if>
3758
3774
  <xsl:if test="$parent-name = 'tfoot'">
3759
3775
 
@@ -3771,6 +3787,8 @@
3771
3787
 
3772
3788
 
3773
3789
 
3790
+
3791
+
3774
3792
  <!-- <xsl:if test="$namespace = 'bipm'">
3775
3793
  <xsl:attribute name="height">8mm</xsl:attribute>
3776
3794
  </xsl:if> -->
@@ -5342,7 +5360,24 @@
5342
5360
  </fo:instream-foreign-object>
5343
5361
  </xsl:when>
5344
5362
  <xsl:otherwise>
5345
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
5363
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
5364
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
5365
+
5366
+ <xsl:variable name="img_src">
5367
+ <xsl:choose>
5368
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
5369
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
5370
+ </xsl:choose>
5371
+ </xsl:variable>
5372
+
5373
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
5374
+ <xsl:if test="number($scale) &lt; 100">
5375
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5376
+ </xsl:if>
5377
+
5378
+ </xsl:if>
5379
+
5380
+ </fo:external-graphic>
5346
5381
  </xsl:otherwise>
5347
5382
  </xsl:choose>
5348
5383
 
@@ -5513,11 +5548,13 @@
5513
5548
  <xsl:attribute name="width">100%</xsl:attribute>
5514
5549
  <xsl:attribute name="content-height">100%</xsl:attribute>
5515
5550
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5551
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
5552
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
5516
5553
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
5517
5554
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
5518
5555
  <!-- effective height / width = 1.48, 1.4 - with title -->
5519
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
5520
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
5556
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
5557
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
5521
5558
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
5522
5559
  </xsl:if>
5523
5560
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -5534,6 +5571,23 @@
5534
5571
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
5535
5572
  <xsl:value-of select="."/>
5536
5573
  </xsl:attribute>
5574
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
5575
+ <xsl:copy>
5576
+ <xsl:apply-templates select="@*" mode="svg_update"/>
5577
+ <xsl:variable name="viewbox">
5578
+ <xsl:call-template name="split">
5579
+ <xsl:with-param name="pText" select="@viewBox"/>
5580
+ <xsl:with-param name="sep" select="' '"/>
5581
+ </xsl:call-template>
5582
+ </xsl:variable>
5583
+ <xsl:attribute name="width">
5584
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
5585
+ </xsl:attribute>
5586
+ <xsl:attribute name="height">
5587
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
5588
+ </xsl:attribute>
5589
+ <xsl:apply-templates mode="svg_update"/>
5590
+ </xsl:copy>
5537
5591
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5538
5592
  <xsl:variable name="svg_content" select="document(@src)"/>
5539
5593
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -7224,20 +7278,40 @@
7224
7278
  </xsl:call-template>
7225
7279
  </xsl:if>
7226
7280
  </xsl:template><xsl:template name="getLocalizedString">
7227
- <xsl:param name="key"/>
7281
+ <xsl:param name="key"/>
7282
+ <xsl:param name="formatted">false</xsl:param>
7228
7283
 
7229
7284
  <xsl:variable name="curr_lang">
7230
7285
  <xsl:call-template name="getLang"/>
7231
7286
  </xsl:variable>
7232
7287
 
7233
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
7288
+ <xsl:variable name="data_value">
7289
+ <xsl:choose>
7290
+ <xsl:when test="$formatted = 'true'">
7291
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7292
+ </xsl:when>
7293
+ <xsl:otherwise>
7294
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
7295
+ </xsl:otherwise>
7296
+ </xsl:choose>
7297
+ </xsl:variable>
7234
7298
 
7235
7299
  <xsl:choose>
7236
- <xsl:when test="$data_value != ''">
7237
- <xsl:value-of select="$data_value"/>
7300
+ <xsl:when test="normalize-space($data_value) != ''">
7301
+ <xsl:choose>
7302
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
7303
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
7304
+ </xsl:choose>
7238
7305
  </xsl:when>
7239
7306
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
7240
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7307
+ <xsl:choose>
7308
+ <xsl:when test="$formatted = 'true'">
7309
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7310
+ </xsl:when>
7311
+ <xsl:otherwise>
7312
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7313
+ </xsl:otherwise>
7314
+ </xsl:choose>
7241
7315
  </xsl:when>
7242
7316
  <xsl:otherwise>
7243
7317
  <xsl:variable name="key_">
@@ -7248,7 +7322,7 @@
7248
7322
  <xsl:value-of select="$key_"/>
7249
7323
  </xsl:otherwise>
7250
7324
  </xsl:choose>
7251
-
7325
+
7252
7326
  </xsl:template><xsl:template name="setTrackChangesStyles">
7253
7327
  <xsl:param name="isAdded"/>
7254
7328
  <xsl:param name="isDeleted"/>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.3.7".freeze
3
+ VERSION = "1.3.8".freeze
4
4
  end
5
5
  end
6
6
 
@@ -32,8 +32,8 @@ RSpec.describe Asciidoctor::Iec do
32
32
  #{ASCIIDOC_BLANK_HDR}
33
33
  [stem]
34
34
  ++++
35
- r = 1 %#{' '}
36
- r = 1 %#{' '}
35
+ r = 1 %
36
+ r = 1 %
37
37
  ++++
38
38
 
39
39
  [stem]
@@ -45,7 +45,7 @@ RSpec.describe Asciidoctor::Iec do
45
45
  #{@blank_hdr}
46
46
  <sections>
47
47
  <formula id="_">
48
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
48
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo></math></stem>
49
49
  </formula>
50
50
 
51
51
  <formula id="_">
data/spec/spec_helper.rb CHANGED
@@ -41,6 +41,8 @@ def xmlpp(x)
41
41
  s
42
42
  end
43
43
 
44
+ OPTIONS = [backend: :iec, header_footer: true, agree_to_terms: true].freeze
45
+
44
46
  ASCIIDOC_BLANK_HDR = <<~"HDR"
45
47
  = Document title
46
48
  Author
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso