metanorma-iho 0.8.0 → 0.8.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: 6e745ee37c741e2fbb8ad9398012b6211c61ed73e585ec78272538295fd23005
4
- data.tar.gz: 0f9688d8696eaa1417ebb7d25053b902dcde60f316a5c87637f656d8355f7afa
3
+ metadata.gz: 913b4069b7d31fb5f55bf8eda5302e14191f426c40b3a9bddec90cad1ca9e9e1
4
+ data.tar.gz: 6bb8615883d63dee342945fbc7158132152a99e5a1a8172527a14020145873df
5
5
  SHA512:
6
- metadata.gz: 9c798099b130b2d7a6810aed66b1c553da76fbd9f8c9fbfe3018a8db05460b93073937502b89bfd2bee3e810b31910ffa0cf3619badf33b800ed01e6fb1ba5a2
7
- data.tar.gz: dec07c7dd9ded93dd4eff6758eb699964967bc88a18a9d1bbac62a97d09851fc337baa8bbf4ebd7e1f3bcb7ac0820297cd2271c947df763d03a0543adf8e4524
6
+ metadata.gz: ef7027702fb5400193b2a5cf810dfb9e3c905cc431a8abbe382ddf8edbeb89ee423023cf1115ac769e8c51ad66b60bcdf6356c688e02b9182ca0c06ff043afca
7
+ data.tar.gz: 6dfacb6d8e8fa73afccbd9c5f2e0cac2c3a18c3ffb2b07084f33be5558b15759d3bbdb901d06d3d7094307edcfec47aafa48ac2ccdfcf10d5dee5f6373bc5d0c
@@ -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>
@@ -11,7 +11,7 @@ module IsoDoc
11
11
  end
12
12
 
13
13
  def pdf_stylesheet(docxml)
14
- case docxml&.at(ns("//bibdata/ext/doctype"))&.text
14
+ case @doctype
15
15
  when "standard" then "iho.standard.xsl"
16
16
  else
17
17
  "iho.specification.xsl"
@@ -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.2".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.2"
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.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: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-09-11 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.2
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.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement