metanorma-iho 0.8.0 → 0.8.1

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: 6e745ee37c741e2fbb8ad9398012b6211c61ed73e585ec78272538295fd23005
4
- data.tar.gz: 0f9688d8696eaa1417ebb7d25053b902dcde60f316a5c87637f656d8355f7afa
3
+ metadata.gz: 045764e09ce11023d0771448aea315e18f72fa8f52cc4e6f354060fe2541e7bb
4
+ data.tar.gz: f17202fa6fddb19c8ac23054f775232ad5d225e1e0bfbb8f10f3f12590517c00
5
5
  SHA512:
6
- metadata.gz: 9c798099b130b2d7a6810aed66b1c553da76fbd9f8c9fbfe3018a8db05460b93073937502b89bfd2bee3e810b31910ffa0cf3619badf33b800ed01e6fb1ba5a2
7
- data.tar.gz: dec07c7dd9ded93dd4eff6758eb699964967bc88a18a9d1bbac62a97d09851fc337baa8bbf4ebd7e1f3bcb7ac0820297cd2271c947df763d03a0543adf8e4524
6
+ metadata.gz: 9e6f5acf65061cd09e635415f6a1f6a59b0128e08d8acf2a05c2cb5fe1100e9b8a943ec4d16564e4ebfc6affa54456eea4ce2cd1956391cc062b7e321b01b3af
7
+ data.tar.gz: 3a5009d9ea547b6142fb92c1c997b75fa3ec993e79c37b6ece2b3c374edd412619303a7e086b4e1fbc10afe25bf51b6122ebce69884c8aa5586c96d75164075e
@@ -1155,11 +1155,26 @@
1155
1155
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1156
1156
  </xsl:if>
1157
1157
 
1158
- <xsl:value-of select="."/>
1158
+ <xsl:variable name="font_family" select="."/>
1159
1159
 
1160
- <xsl:if test="$additional_fonts != ''">
1161
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1162
- </xsl:if>
1160
+ <xsl:choose>
1161
+ <xsl:when test="$additional_fonts = ''">
1162
+ <xsl:value-of select="$font_family"/>
1163
+ </xsl:when>
1164
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1165
+ <xsl:choose>
1166
+ <xsl:when test="contains($font_family, ',')">
1167
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1168
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1169
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1170
+ </xsl:when>
1171
+ <xsl:otherwise>
1172
+ <xsl:value-of select="$font_family"/>
1173
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1174
+ </xsl:otherwise>
1175
+ </xsl:choose>
1176
+ </xsl:otherwise>
1177
+ </xsl:choose>
1163
1178
  </xsl:attribute>
1164
1179
  </xsl:when>
1165
1180
  <xsl:otherwise>
@@ -3677,21 +3692,21 @@
3677
3692
 
3678
3693
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
3679
3694
 
3680
- <fo:block xsl:use-attribute-sets="table-note-style">
3695
+ <fo:block xsl:use-attribute-sets="table-note-style">
3681
3696
 
3682
- <xsl:call-template name="refine_table-note-style"/>
3697
+ <xsl:call-template name="refine_table-note-style"/>
3683
3698
 
3684
- <!-- Table's note/example name (NOTE, for example) -->
3685
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
3699
+ <!-- Table's note/example name (NOTE, for example) -->
3700
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
3686
3701
 
3687
- <xsl:call-template name="refine_table-note-name-style"/>
3702
+ <xsl:call-template name="refine_table-note-name-style"/>
3688
3703
 
3689
- <xsl:apply-templates select="*[local-name() = 'name']"/>
3704
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3690
3705
 
3691
- </fo:inline>
3706
+ </fo:inline>
3692
3707
 
3693
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3694
- </fo:block>
3708
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3709
+ </fo:block>
3695
3710
 
3696
3711
  </xsl:template> <!-- table/note -->
3697
3712
 
@@ -6883,8 +6898,12 @@
6883
6898
  <xsl:variable name="isAdded" select="../@added"/>
6884
6899
  <xsl:variable name="isDeleted" select="../@deleted"/>
6885
6900
  <xsl:choose>
6886
- <xsl:when test="ancestor::*[local-name() = 'title']">
6901
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6887
6902
  <fo:inline padding-left="1mm" padding-right="1mm">
6903
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6904
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
6905
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
6906
+ </xsl:if>
6888
6907
  <xsl:variable name="src">
6889
6908
  <xsl:call-template name="image_src"/>
6890
6909
  </xsl:variable>
@@ -6917,7 +6936,7 @@
6917
6936
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6918
6937
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6919
6938
 
6920
- <xsl:if test="@width != '' and @width != 'auto'">
6939
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
6921
6940
  <xsl:attribute name="width">
6922
6941
  <xsl:value-of select="@width"/>
6923
6942
  </xsl:attribute>
@@ -1155,11 +1155,26 @@
1155
1155
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1156
1156
  </xsl:if>
1157
1157
 
1158
- <xsl:value-of select="."/>
1158
+ <xsl:variable name="font_family" select="."/>
1159
1159
 
1160
- <xsl:if test="$additional_fonts != ''">
1161
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1162
- </xsl:if>
1160
+ <xsl:choose>
1161
+ <xsl:when test="$additional_fonts = ''">
1162
+ <xsl:value-of select="$font_family"/>
1163
+ </xsl:when>
1164
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1165
+ <xsl:choose>
1166
+ <xsl:when test="contains($font_family, ',')">
1167
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1168
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1169
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1170
+ </xsl:when>
1171
+ <xsl:otherwise>
1172
+ <xsl:value-of select="$font_family"/>
1173
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1174
+ </xsl:otherwise>
1175
+ </xsl:choose>
1176
+ </xsl:otherwise>
1177
+ </xsl:choose>
1163
1178
  </xsl:attribute>
1164
1179
  </xsl:when>
1165
1180
  <xsl:otherwise>
@@ -3677,21 +3692,21 @@
3677
3692
 
3678
3693
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
3679
3694
 
3680
- <fo:block xsl:use-attribute-sets="table-note-style">
3695
+ <fo:block xsl:use-attribute-sets="table-note-style">
3681
3696
 
3682
- <xsl:call-template name="refine_table-note-style"/>
3697
+ <xsl:call-template name="refine_table-note-style"/>
3683
3698
 
3684
- <!-- Table's note/example name (NOTE, for example) -->
3685
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
3699
+ <!-- Table's note/example name (NOTE, for example) -->
3700
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
3686
3701
 
3687
- <xsl:call-template name="refine_table-note-name-style"/>
3702
+ <xsl:call-template name="refine_table-note-name-style"/>
3688
3703
 
3689
- <xsl:apply-templates select="*[local-name() = 'name']"/>
3704
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3690
3705
 
3691
- </fo:inline>
3706
+ </fo:inline>
3692
3707
 
3693
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3694
- </fo:block>
3708
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3709
+ </fo:block>
3695
3710
 
3696
3711
  </xsl:template> <!-- table/note -->
3697
3712
 
@@ -6883,8 +6898,12 @@
6883
6898
  <xsl:variable name="isAdded" select="../@added"/>
6884
6899
  <xsl:variable name="isDeleted" select="../@deleted"/>
6885
6900
  <xsl:choose>
6886
- <xsl:when test="ancestor::*[local-name() = 'title']">
6901
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6887
6902
  <fo:inline padding-left="1mm" padding-right="1mm">
6903
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6904
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
6905
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
6906
+ </xsl:if>
6888
6907
  <xsl:variable name="src">
6889
6908
  <xsl:call-template name="image_src"/>
6890
6909
  </xsl:variable>
@@ -6917,7 +6936,7 @@
6917
6936
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6918
6937
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6919
6938
 
6920
- <xsl:if test="@width != '' and @width != 'auto'">
6939
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
6921
6940
  <xsl:attribute name="width">
6922
6941
  <xsl:value-of select="@width"/>
6923
6942
  </xsl:attribute>
@@ -35,20 +35,18 @@ module IsoDoc
35
35
  hierarchical_asset_names(clause, num)
36
36
  end
37
37
 
38
- def back_anchor_names(docxml)
39
- super
40
- if @parse_settings.empty? || @parse_settings[:clauses]
41
- i = Counter.new
42
- docxml.xpath(ns("//annex[@obligation = 'informative']"))
43
- .each do |c|
44
- i.increment(c)
45
- annex_names(c, i.print)
46
- end
47
- i = Counter.new("@", skip_i: true)
48
- docxml.xpath(ns("//annex[not(@obligation = 'informative')]"))
38
+ def clause_order_annex(_docxml)
39
+ [{ path: "//annex[not(@obligation = 'informative')]", multi: true },
40
+ { path: "//annex[@obligation = 'informative']", multi: true }]
41
+ end
42
+
43
+ def annex_anchor_names(docxml)
44
+ clause_order_annex(docxml).each_with_index do |a, i|
45
+ n = i.zero? ? Counter.new("@", skip_i: true) : Counter.new
46
+ docxml.xpath(ns(a[:path]))
49
47
  .each do |c|
50
- i.increment(c)
51
- annex_names(c, i.print)
48
+ annex_names(c, n.increment(c).print)
49
+ a[:multi] or break
52
50
  end
53
51
  end
54
52
  end
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.3 -->
20
+ <!-- VERSION v1.2.4 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -2068,6 +2068,9 @@
2068
2068
  </define>
2069
2069
  <define name="termdefinition">
2070
2070
  <element name="definition">
2071
+ <optional>
2072
+ <attribute name="type"/>
2073
+ </optional>
2071
2074
  <choice>
2072
2075
  <ref name="verbaldefinition"/>
2073
2076
  <ref name="nonverbalrep"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.8.0".freeze
3
+ VERSION = "0.8.1".freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.5.0"
30
+ spec.add_dependency "metanorma-generic", "~> 2.5.1"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-28 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.5.0
19
+ version: 2.5.1
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.5.0
26
+ version: 2.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement