metanorma-iho 1.2.0 → 1.2.1

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: eef8cb86a10c9a1caeb5dad98f5a4ace51653f020031f37b84cfbd88fe7259dd
4
- data.tar.gz: f57b1e0c73207fccbb00190582d1a621d7dd65b7838ed23c108c405398517b88
3
+ metadata.gz: de5b87c7f048d73869e48dc8d13e8ee88c157b61e7918451d08aeff9fbcf9de5
4
+ data.tar.gz: d0c0a3cd504f0237963e8229017d50ecbd115f00d1c5271b35d47f9f776163ff
5
5
  SHA512:
6
- metadata.gz: 649c7a8e4ebb6f4591babb8a9874e36507f6bea3d7adfa9dabdfe976eb4e02c16bf60cf606bafe147d2241e1c6dae0b370666fe046c873671564bf46d4315c1d
7
- data.tar.gz: 78d13a73ecc42f173fffb01bf62049fc7ef26c7761c4d772e234ee783386b5afab6557175a6408037d8d176328b59cf1b9745dad3f35eed17238a0aadbfc79a1
6
+ metadata.gz: abf166b6da0b2b9164bf5ed37d2a11704134f59e5b8abf78b23970dfa8349b97830bb6180f39d820bc569e38d643b3b97bd4b385ee1583429a65f1344fdcac0a
7
+ data.tar.gz: afc91a749a3fb3abb5d21aa2428f8699c7883448b057c678287c7703c731671a1dbe0f9d2aee4608339fd393f79480f145484a24a765bfd16fd85cad3cbe0f85
@@ -48,7 +48,7 @@
48
48
  <xsl:template name="layout-master-set">
49
49
  <fo:layout-master-set>
50
50
  <!-- cover page -->
51
- <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
51
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
52
52
  <fo:region-body margin-top="0mm" margin-bottom="5mm" margin-left="0mm" margin-right="5mm"/>
53
53
  </fo:simple-page-master>
54
54
 
@@ -364,7 +364,7 @@
364
364
  <xsl:template name="cover-page">
365
365
  <!-- =========================== -->
366
366
  <!-- Cover Page -->
367
- <fo:page-sequence master-reference="cover">
367
+ <fo:page-sequence master-reference="cover-page">
368
368
  <fo:flow flow-name="xsl-region-body">
369
369
 
370
370
  <xsl:variable name="isCoverPageImage" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and 1 = 1)"/>
@@ -465,7 +465,8 @@
465
465
  <fo:block font-size="28pt" role="H1" line-height="115%">
466
466
  <xsl:copy-of select="$title-main"/>
467
467
  <xsl:if test="normalize-space($title-main) = ''">
468
- <xsl:copy-of select="$title-en"/>
468
+ <xsl:copy-of select="$title-main_"/>
469
+ <xsl:if test="normalize-space($title-main_) = ''"><xsl:copy-of select="$title-en"/></xsl:if>
469
470
  </xsl:if>
470
471
  </fo:block>
471
472
  <xsl:if test="normalize-space($title-part) != ''">
@@ -6219,6 +6220,16 @@
6219
6220
  </xsl:variable>
6220
6221
  <xsl:variable name="quot">"</xsl:variable>
6221
6222
  <xsl:variable name="styles_">
6223
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
6224
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
6225
+ <style name="border-top">none</style>
6226
+ <style name="border-right">none</style>
6227
+ <style name="border-left">none</style>
6228
+ <style name="border-bottom">none</style>
6229
+ <style name="color">inherit</style>
6230
+ <style name="background-color">transparent</style>
6231
+ </xsl:if>
6232
+
6222
6233
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
6223
6234
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
6224
6235
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
@@ -8217,7 +8228,10 @@
8217
8228
 
8218
8229
  <xsl:call-template name="setNamedDestination"/>
8219
8230
 
8220
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8231
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
8232
+ <xsl:if test="not(parent::mn:references)">
8233
+ <xsl:copy-of select="@id"/>
8234
+ </xsl:if>
8221
8235
 
8222
8236
  <xsl:call-template name="setBlockSpanAll"/>
8223
8237
 
@@ -10923,8 +10937,8 @@
10923
10937
  </xsl:template> <!-- bibitem -->
10924
10938
 
10925
10939
  <!-- Bibliography (non-normative references) -->
10926
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
10927
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10940
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
10941
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10928
10942
  <xsl:call-template name="bibitem"/>
10929
10943
 
10930
10944
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
@@ -10954,7 +10968,7 @@
10954
10968
  </fo:list-item>
10955
10969
  </xsl:otherwise>
10956
10970
  </xsl:choose>
10957
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
10971
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
10958
10972
  <xsl:with-param name="skip">false</xsl:with-param>
10959
10973
  </xsl:apply-templates>
10960
10974
  </xsl:template>
@@ -10971,8 +10985,26 @@
10971
10985
  </xsl:apply-templates>
10972
10986
  <xsl:apply-templates select="mn:formattedref"/>
10973
10987
  <!-- end bibitem processing -->
10988
+
10989
+ <xsl:call-template name="processBibliographyNote"/>
10974
10990
  </xsl:template> <!-- processBibitem (bibitem) -->
10975
10991
 
10992
+ <xsl:template name="processBibliographyNote">
10993
+ <xsl:if test="self::mn:note">
10994
+ <xsl:variable name="note_node">
10995
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10996
+ <xsl:copy> <!-- skip @id -->
10997
+ <xsl:copy-of select="node()"/>
10998
+ </xsl:copy>
10999
+ </xsl:element>
11000
+ </xsl:variable>
11001
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
11002
+ <xsl:call-template name="note"/>
11003
+ </xsl:for-each> -->
11004
+ <xsl:call-template name="note"/>
11005
+ </xsl:if>
11006
+ </xsl:template>
11007
+
10976
11008
  <xsl:template match="mn:title" mode="title">
10977
11009
  <fo:inline><xsl:apply-templates/></fo:inline>
10978
11010
  </xsl:template>
@@ -11518,6 +11550,48 @@
11518
11550
  <!-- End Form's elements processing -->
11519
11551
  <!-- =================== -->
11520
11552
 
11553
+ <xsl:attribute-set name="toc-style">
11554
+ </xsl:attribute-set>
11555
+
11556
+ <xsl:template name="refine_toc-style">
11557
+ </xsl:template>
11558
+
11559
+ <xsl:attribute-set name="toc-title-style">
11560
+ </xsl:attribute-set>
11561
+
11562
+ <xsl:attribute-set name="toc-title-page-style">
11563
+ </xsl:attribute-set> <!-- toc-title-page-style -->
11564
+
11565
+ <xsl:attribute-set name="toc-item-block-style">
11566
+ </xsl:attribute-set>
11567
+
11568
+ <xsl:template name="refine_toc-item-block-style">
11569
+ </xsl:template>
11570
+
11571
+ <xsl:attribute-set name="toc-item-style">
11572
+ <xsl:attribute name="role">TOCI</xsl:attribute>
11573
+ </xsl:attribute-set> <!-- END: toc-item-style -->
11574
+
11575
+ <xsl:template name="refine_toc-item-style">
11576
+ </xsl:template> <!-- END: refine_toc-item-style -->
11577
+
11578
+ <xsl:attribute-set name="toc-leader-style">
11579
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
11580
+
11581
+ <xsl:attribute-set name="toc-pagenumber-style">
11582
+ </xsl:attribute-set>
11583
+
11584
+ <!-- List of Figures, Tables -->
11585
+ <xsl:attribute-set name="toc-listof-title-style">
11586
+ </xsl:attribute-set>
11587
+
11588
+ <xsl:attribute-set name="toc-listof-item-block-style">
11589
+ </xsl:attribute-set>
11590
+
11591
+ <xsl:attribute-set name="toc-listof-item-style">
11592
+ <xsl:attribute name="role">TOCI</xsl:attribute>
11593
+ </xsl:attribute-set>
11594
+
11521
11595
  <xsl:template name="processPrefaceSectionsDefault_Contents">
11522
11596
  <xsl:variable name="nodes_preface_">
11523
11597
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -48,7 +48,7 @@
48
48
  <xsl:template name="layout-master-set">
49
49
  <fo:layout-master-set>
50
50
  <!-- cover page -->
51
- <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
51
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
52
52
  <fo:region-body margin-top="0mm" margin-bottom="5mm" margin-left="0mm" margin-right="5mm"/>
53
53
  </fo:simple-page-master>
54
54
 
@@ -364,7 +364,7 @@
364
364
  <xsl:template name="cover-page">
365
365
  <!-- =========================== -->
366
366
  <!-- Cover Page -->
367
- <fo:page-sequence master-reference="cover">
367
+ <fo:page-sequence master-reference="cover-page">
368
368
  <fo:flow flow-name="xsl-region-body">
369
369
 
370
370
  <xsl:variable name="isCoverPageImage" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and 1 = 1)"/>
@@ -465,7 +465,8 @@
465
465
  <fo:block font-size="28pt" role="H1" line-height="115%">
466
466
  <xsl:copy-of select="$title-main"/>
467
467
  <xsl:if test="normalize-space($title-main) = ''">
468
- <xsl:copy-of select="$title-en"/>
468
+ <xsl:copy-of select="$title-main_"/>
469
+ <xsl:if test="normalize-space($title-main_) = ''"><xsl:copy-of select="$title-en"/></xsl:if>
469
470
  </xsl:if>
470
471
  </fo:block>
471
472
  <xsl:if test="normalize-space($title-part) != ''">
@@ -6219,6 +6220,16 @@
6219
6220
  </xsl:variable>
6220
6221
  <xsl:variable name="quot">"</xsl:variable>
6221
6222
  <xsl:variable name="styles_">
6223
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
6224
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
6225
+ <style name="border-top">none</style>
6226
+ <style name="border-right">none</style>
6227
+ <style name="border-left">none</style>
6228
+ <style name="border-bottom">none</style>
6229
+ <style name="color">inherit</style>
6230
+ <style name="background-color">transparent</style>
6231
+ </xsl:if>
6232
+
6222
6233
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
6223
6234
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
6224
6235
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
@@ -8217,7 +8228,10 @@
8217
8228
 
8218
8229
  <xsl:call-template name="setNamedDestination"/>
8219
8230
 
8220
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8231
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
8232
+ <xsl:if test="not(parent::mn:references)">
8233
+ <xsl:copy-of select="@id"/>
8234
+ </xsl:if>
8221
8235
 
8222
8236
  <xsl:call-template name="setBlockSpanAll"/>
8223
8237
 
@@ -10923,8 +10937,8 @@
10923
10937
  </xsl:template> <!-- bibitem -->
10924
10938
 
10925
10939
  <!-- Bibliography (non-normative references) -->
10926
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
10927
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10940
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
10941
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10928
10942
  <xsl:call-template name="bibitem"/>
10929
10943
 
10930
10944
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
@@ -10954,7 +10968,7 @@
10954
10968
  </fo:list-item>
10955
10969
  </xsl:otherwise>
10956
10970
  </xsl:choose>
10957
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
10971
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
10958
10972
  <xsl:with-param name="skip">false</xsl:with-param>
10959
10973
  </xsl:apply-templates>
10960
10974
  </xsl:template>
@@ -10971,8 +10985,26 @@
10971
10985
  </xsl:apply-templates>
10972
10986
  <xsl:apply-templates select="mn:formattedref"/>
10973
10987
  <!-- end bibitem processing -->
10988
+
10989
+ <xsl:call-template name="processBibliographyNote"/>
10974
10990
  </xsl:template> <!-- processBibitem (bibitem) -->
10975
10991
 
10992
+ <xsl:template name="processBibliographyNote">
10993
+ <xsl:if test="self::mn:note">
10994
+ <xsl:variable name="note_node">
10995
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10996
+ <xsl:copy> <!-- skip @id -->
10997
+ <xsl:copy-of select="node()"/>
10998
+ </xsl:copy>
10999
+ </xsl:element>
11000
+ </xsl:variable>
11001
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
11002
+ <xsl:call-template name="note"/>
11003
+ </xsl:for-each> -->
11004
+ <xsl:call-template name="note"/>
11005
+ </xsl:if>
11006
+ </xsl:template>
11007
+
10976
11008
  <xsl:template match="mn:title" mode="title">
10977
11009
  <fo:inline><xsl:apply-templates/></fo:inline>
10978
11010
  </xsl:template>
@@ -11518,6 +11550,48 @@
11518
11550
  <!-- End Form's elements processing -->
11519
11551
  <!-- =================== -->
11520
11552
 
11553
+ <xsl:attribute-set name="toc-style">
11554
+ </xsl:attribute-set>
11555
+
11556
+ <xsl:template name="refine_toc-style">
11557
+ </xsl:template>
11558
+
11559
+ <xsl:attribute-set name="toc-title-style">
11560
+ </xsl:attribute-set>
11561
+
11562
+ <xsl:attribute-set name="toc-title-page-style">
11563
+ </xsl:attribute-set> <!-- toc-title-page-style -->
11564
+
11565
+ <xsl:attribute-set name="toc-item-block-style">
11566
+ </xsl:attribute-set>
11567
+
11568
+ <xsl:template name="refine_toc-item-block-style">
11569
+ </xsl:template>
11570
+
11571
+ <xsl:attribute-set name="toc-item-style">
11572
+ <xsl:attribute name="role">TOCI</xsl:attribute>
11573
+ </xsl:attribute-set> <!-- END: toc-item-style -->
11574
+
11575
+ <xsl:template name="refine_toc-item-style">
11576
+ </xsl:template> <!-- END: refine_toc-item-style -->
11577
+
11578
+ <xsl:attribute-set name="toc-leader-style">
11579
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
11580
+
11581
+ <xsl:attribute-set name="toc-pagenumber-style">
11582
+ </xsl:attribute-set>
11583
+
11584
+ <!-- List of Figures, Tables -->
11585
+ <xsl:attribute-set name="toc-listof-title-style">
11586
+ </xsl:attribute-set>
11587
+
11588
+ <xsl:attribute-set name="toc-listof-item-block-style">
11589
+ </xsl:attribute-set>
11590
+
11591
+ <xsl:attribute-set name="toc-listof-item-style">
11592
+ <xsl:attribute name="role">TOCI</xsl:attribute>
11593
+ </xsl:attribute-set>
11594
+
11521
11595
  <xsl:template name="processPrefaceSectionsDefault_Contents">
11522
11596
  <xsl:variable name="nodes_preface_">
11523
11597
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -92,8 +92,9 @@ _bib)
92
92
  end
93
93
 
94
94
  def dochistory_description(item)
95
- d = item.at(ns("./amend/description")) or return ""
96
- d.children.to_xml
95
+ d = item.xpath(ns("./amend/description"))
96
+ d.empty? and return ""
97
+ d.map { |d1| semx_fmt_dup(d1).to_xml }.join("\n")
97
98
  end
98
99
 
99
100
  def ddMMMyyyy(isodate)
@@ -198,14 +198,14 @@ Applicable to modify and delete</a:documentation>
198
198
  </zeroOrMore>
199
199
  </element>
200
200
  </optional>
201
- <optional>
201
+ <zeroOrMore>
202
202
  <element name="description">
203
- <a:documentation>Description of the change described in this block</a:documentation>
204
- <zeroOrMore>
203
+ <a:documentation>Description(s) of the change described in this block</a:documentation>
204
+ <oneOrMore>
205
205
  <ref name="BasicBlock"/>
206
- </zeroOrMore>
206
+ </oneOrMore>
207
207
  </element>
208
- </optional>
208
+ </zeroOrMore>
209
209
  <optional>
210
210
  <element name="newcontent">
211
211
  <a:documentation>New content to be added to the document; applicable to add and modify</a:documentation>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <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">
3
- <!-- VERSION v2.0.8 -->
3
+ <!-- VERSION v2.1.0 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -735,6 +735,12 @@ titlecase, or lowercase</a:documentation>
735
735
  <ref name="BlockAttributes"/>
736
736
  </define>
737
737
  <define name="TableAttributes" combine="interleave">
738
+ <optional>
739
+ <attribute name="plain">
740
+ <a:documentation>Render as a plain attribute, with no shading or borders</a:documentation>
741
+ <data type="boolean"/>
742
+ </attribute>
743
+ </optional>
738
744
  <optional>
739
745
  <attribute name="width">
740
746
  <a:documentation>Width of the table block in rendering</a:documentation>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.2.0".freeze
3
+ VERSION = "1.2.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(">= 3.1.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 3.0.4"
30
+ spec.add_dependency "metanorma-generic", "~> 3.1.0"
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: 1.2.0
4
+ version: 1.2.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: 2025-07-05 00:00:00.000000000 Z
11
+ date: 2025-07-21 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: 3.0.4
19
+ version: 3.1.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: 3.0.4
26
+ version: 3.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement