metanorma-ribose 2.1.13 → 2.2.0

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: 3edc722be912cd5f552285f32943aa7a98ccbe0a92b2fd217b47ba729559f8da
4
- data.tar.gz: 77651772301d839682f696cb4c7f07578b0fe5d19011be84ada83a7e619b3515
3
+ metadata.gz: 0a6232179686f66cbd2c5eff24711ccfc03c241075f8338c74ff0dd9b62ab305
4
+ data.tar.gz: bd5d151cd18b5b372b9b7bdd9fb0d49ed4137fb0f297f766244363a0cd46f9c6
5
5
  SHA512:
6
- metadata.gz: b5ccc82c2937fcb82983c65f0d10762fb64a9f1736d81e528ad2d98311e52912cb48dd57b3bbc9c56c8b50f7ecbbeeafdabc3eb01653be2af353dd1da2cba448
7
- data.tar.gz: 288f73b49dac4cf6cdde93e3f19f794466ada5691a3a4dac93adab4763a8db804e25c5b48912489a9bf1166292f1b90fe0bd281af6dfd08a06b519fa4fe2a9e6
6
+ metadata.gz: f7c60b4dec2755741d5e109311acda0ef95a3c7cd9bde3c8701360fcde125c7b883e0678a3ab76a98ecd5da8337cd738f93b9a4ea1223b067365b079880b66ed
7
+ data.tar.gz: 4f6924cf224c226380ba24a208e80afdb5b129d962541002823bf75901190b616fdd3dd0e08d424e77f7e1d9e5120a16b90469b0fbe07034700ae6096876fccb
data/.gitignore CHANGED
@@ -3,6 +3,5 @@
3
3
  .rubocop-https--*
4
4
 
5
5
  /.rspec_status
6
- /Gemfile.devel
7
6
  /Gemfile.lock
8
7
  /coverage/
@@ -14,7 +14,7 @@ module IsoDoc
14
14
  mod = elem.at(ns("./modification")) and
15
15
  termsource_modification(mod)
16
16
  elem.children = l10n("<strong>#{@i18n.source}:</strong> "\
17
- "#{elem.children.to_xml.strip}")
17
+ "#{to_xml(elem.children).strip}")
18
18
  elem&.next_element&.name == "termsource" and elem.next = "; "
19
19
  end
20
20
 
@@ -3869,6 +3869,10 @@
3869
3869
  <xsl:variable name="footnote_inline">
3870
3870
  <fo:inline xsl:use-attribute-sets="fn-num-style">
3871
3871
 
3872
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3873
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
3874
+ </xsl:if>
3875
+
3872
3876
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3873
3877
  <xsl:value-of select="$current_fn_number_text"/>
3874
3878
  </fo:basic-link>
@@ -5030,6 +5034,23 @@
5030
5034
  <xsl:apply-templates/>
5031
5035
  </xsl:template>
5032
5036
 
5037
+ <!-- Don't break standard's numbers -->
5038
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5039
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5040
+ <xsl:choose>
5041
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5042
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5043
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5044
+ </xsl:when>
5045
+ <xsl:otherwise>
5046
+ <xsl:apply-templates/>
5047
+ </xsl:otherwise>
5048
+ </xsl:choose>
5049
+ </xsl:template>
5050
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
5051
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5052
+ </xsl:template>
5053
+
5033
5054
  <!-- ========================= -->
5034
5055
  <!-- END Rich text formatting -->
5035
5056
  <!-- ========================= -->
@@ -5425,7 +5446,7 @@
5425
5446
  <xsl:choose>
5426
5447
  <xsl:when test="@colspan">
5427
5448
  <xsl:variable name="td">
5428
- <xsl:element name="td">
5449
+ <xsl:element name="{local-name()}">
5429
5450
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
5430
5451
  <xsl:if test="local-name()='th'">
5431
5452
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5440,7 +5461,7 @@
5440
5461
  </xsl:call-template>
5441
5462
  </xsl:when>
5442
5463
  <xsl:otherwise>
5443
- <xsl:element name="td">
5464
+ <xsl:element name="{local-name()}">
5444
5465
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5445
5466
  <xsl:if test="local-name()='th'">
5446
5467
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5507,7 +5528,7 @@
5507
5528
  <xsl:variable name="currentRow" select="."/>
5508
5529
 
5509
5530
  <xsl:variable name="normalizedTDs">
5510
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
5531
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
5511
5532
  <xsl:choose>
5512
5533
  <xsl:when test="@rowspan &gt; 1">
5513
5534
  <xsl:copy>
@@ -5519,7 +5540,7 @@
5519
5540
  </xsl:copy>
5520
5541
  </xsl:when>
5521
5542
  <xsl:otherwise>
5522
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
5543
+ <xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
5523
5544
  </xsl:otherwise>
5524
5545
  </xsl:choose>
5525
5546
  </xsl:for-each>
@@ -6200,12 +6221,6 @@
6200
6221
 
6201
6222
  <fo:block-container margin-left="0mm">
6202
6223
 
6203
- <!-- <xsl:if test="$namespace = 'iho'">
6204
- <xsl:if test="ancestor::iho:td">
6205
- <xsl:attribute name="font-size">12pt</xsl:attribute>
6206
- </xsl:if>
6207
- </xsl:if> -->
6208
-
6209
6224
  <fo:block>
6210
6225
 
6211
6226
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -6712,6 +6727,31 @@
6712
6727
  <xsl:apply-templates mode="svg_update"/>
6713
6728
  </xsl:copy>
6714
6729
  </xsl:template>
6730
+
6731
+ <!-- regex for 'display: inline-block;' -->
6732
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
6733
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
6734
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
6735
+ </xsl:template>
6736
+
6737
+ <!-- replace
6738
+ stroke="rgba(r, g, b, alpha)" to
6739
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
6740
+ fill="rgba(r, g, b, alpha)" to
6741
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
6742
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
6743
+ <xsl:variable name="components_">
6744
+ <xsl:call-template name="split">
6745
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
6746
+ <xsl:with-param name="sep" select="','"/>
6747
+ </xsl:call-template>
6748
+ </xsl:variable>
6749
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
6750
+ <xsl:variable name="att_name" select="local-name()"/>
6751
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
6752
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
6753
+ </xsl:template>
6754
+
6715
6755
  <!-- ============== -->
6716
6756
  <!-- END: svg_update -->
6717
6757
  <!-- ============== -->
@@ -9670,7 +9710,9 @@
9670
9710
  <!-- Update xml -->
9671
9711
  <!-- ===================================== -->
9672
9712
  <!-- =========================================================================== -->
9673
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9713
+ <!-- STEP1: -->
9714
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
9715
+ <!-- - Ignore 'span' without style -->
9674
9716
  <!-- =========================================================================== -->
9675
9717
  <xsl:template match="@*|node()" mode="update_xml_step1">
9676
9718
  <xsl:copy>
@@ -9753,7 +9795,8 @@
9753
9795
  </xsl:copy>
9754
9796
  </xsl:template>
9755
9797
 
9756
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
9798
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
9799
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
9757
9800
  <xsl:copy>
9758
9801
  <xsl:copy-of select="@*"/>
9759
9802
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -683,6 +683,9 @@
683
683
  </define>
684
684
  <define name="underline">
685
685
  <element name="underline">
686
+ <optional>
687
+ <attribute name="style"/>
688
+ </optional>
686
689
  <zeroOrMore>
687
690
  <ref name="PureTextElement"/>
688
691
  </zeroOrMore>
@@ -47,7 +47,7 @@
47
47
  </element>
48
48
  </define>
49
49
  <define name="DocumentType">
50
- <value>document</value>
50
+ <text/>
51
51
  </define>
52
52
  <define name="docsubtype">
53
53
  <element name="subdoctype">
@@ -2653,6 +2653,7 @@
2653
2653
  <value>full</value>
2654
2654
  <value>short</value>
2655
2655
  <value>id</value>
2656
+ <value>modspec</value>
2656
2657
  </choice>
2657
2658
  </define>
2658
2659
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.1.13".freeze
3
+ VERSION = "2.2.0".freeze
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.2.2"
32
+ spec.add_dependency "metanorma-generic", "~> 2.3.0"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.13
4
+ version: 2.2.0
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-11-21 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.2
19
+ version: 2.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.2
26
+ version: 2.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
241
  - !ruby/object:Gem::Version
242
242
  version: '0'
243
243
  requirements: []
244
- rubygems_version: 3.3.7
244
+ rubygems_version: 3.3.26
245
245
  signing_key:
246
246
  specification_version: 4
247
247
  summary: metanorma-ribose lets you write Ribose standards in AsciiDoc.