metanorma-jis 1.0.5 → 1.0.6

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: d4ff985af7fc1b5ab74a4ee61850124c6e36a3a83147644d07eb69e5be745058
4
- data.tar.gz: 3ea4831e961be0aba07344cd093a7944ee73fcf096d125312ee9bbc7ddb7716f
3
+ metadata.gz: 52feb035503f2766a2c0281b2ea081358ca155ce13f606e9a0ce7641144c2bfa
4
+ data.tar.gz: 1f0cef17898c1245e14cece9fac7ff3fe1cabec0d4acac1d8b60e909867ef547
5
5
  SHA512:
6
- metadata.gz: 607db2ddd112f5f47d487af9404f1bb65f3b3d689f28234e15d480a745d4b3e91547faeb267e2b33404e6a0b4b457af27059a4190be70703a89a63c90427d2fc
7
- data.tar.gz: 9b908b1459da1193eb16eafe5e512af43263e4b10d099b60013fdb20e307f00639191f7c044b29946fb532e0965f20a8a0bd4a46b4915c293e35702532c744bc
6
+ metadata.gz: 473ff382fe45f94e9a7f10811f09e884de519482b43c8da4631ed357788b8d3743c8fde273f8f932d34196d1a11d7eb63782724afd716f243488115692eb32ac
7
+ data.tar.gz: daf7b6b8cab952334628287d116d49312f874be5d8ca1c593681ba0754f7f34b8bf0242c6fc1d94904a54bb47317e296a294410035d9c85ba034907708391cc6
@@ -1787,6 +1787,9 @@
1787
1787
  <xsl:variable name="title">
1788
1788
  <xsl:call-template name="getName"/>
1789
1789
  </xsl:variable>
1790
+ <xsl:variable name="variant_title">
1791
+ <xsl:copy-of select="mn:variant-title[@type = 'toc']/node()"/>
1792
+ </xsl:variable>
1790
1793
 
1791
1794
  <xsl:variable name="root">
1792
1795
  <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
@@ -1798,9 +1801,18 @@
1798
1801
  <xsl:attribute name="level">1</xsl:attribute>
1799
1802
  </xsl:if>
1800
1803
  <mnx:title>
1801
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
1802
- <xsl:with-param name="mode">contents</xsl:with-param>
1803
- </xsl:apply-templates>
1804
+ <xsl:choose>
1805
+ <xsl:when test="normalize-space($variant_title) != ''">
1806
+ <xsl:apply-templates select="xalan:nodeset($variant_title)" mode="contents_item">
1807
+ <xsl:with-param name="mode">contents</xsl:with-param>
1808
+ </xsl:apply-templates>
1809
+ </xsl:when>
1810
+ <xsl:otherwise>
1811
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
1812
+ <xsl:with-param name="mode">contents</xsl:with-param>
1813
+ </xsl:apply-templates>
1814
+ </xsl:otherwise>
1815
+ </xsl:choose>
1804
1816
  </mnx:title>
1805
1817
  <xsl:if test="$type != 'index'">
1806
1818
  <xsl:apply-templates mode="contents"/>
@@ -6109,7 +6121,24 @@
6109
6121
  <xsl:template match="mn:metanorma-extension/*[local-name() = 'UnitsML']" mode="update_xml_step1"/>
6110
6122
 
6111
6123
  <!-- remove image/emf -->
6112
- <xsl:template match="mn:image/mn:emf" mode="update_xml_step1"/>
6124
+ <xsl:template match="mn:image//mn:emf" mode="update_xml_step1"/>
6125
+
6126
+ <!-- https://github.com/metanorma/metanorma/issues/540 -->
6127
+ <xsl:template match="mn:image[mn:altsource]" priority="3" mode="update_xml_step1">
6128
+ <xsl:copy>
6129
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
6130
+ <xsl:choose>
6131
+ <xsl:when test="mn:altsource[contains(@tag, 'pdf')]">
6132
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/@*" mode="update_xml_step1"/>
6133
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'pdf')]/node()" mode="update_xml_step1"/>
6134
+ </xsl:when>
6135
+ <xsl:otherwise>
6136
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/@*" mode="update_xml_step1"/>
6137
+ <xsl:apply-templates select="mn:altsource[contains(@tag, 'default')]/node()" mode="update_xml_step1"/>
6138
+ </xsl:otherwise>
6139
+ </xsl:choose>
6140
+ </xsl:copy>
6141
+ </xsl:template>
6113
6142
 
6114
6143
  <!-- remove preprocess-xslt -->
6115
6144
  <xsl:template match="mn:preprocess-xslt" mode="update_xml_step1"/>
@@ -6337,6 +6366,15 @@
6337
6366
  </xsl:choose>
6338
6367
  </xsl:template>
6339
6368
 
6369
+ <!-- https://github.com/metanorma/metanorma-iso/issues/1535 -->
6370
+ <xsl:template match="mn:ol[mn:fmt-ol]" mode="update_xml_step1">
6371
+ <xsl:apply-templates select="mn:fmt-ol" mode="update_xml_step1"/>
6372
+ </xsl:template>
6373
+
6374
+ <xsl:template match="mn:ul[mn:fmt-ul]" mode="update_xml_step1">
6375
+ <xsl:apply-templates select="mn:fmt-ul" mode="update_xml_step1"/>
6376
+ </xsl:template>
6377
+
6340
6378
  <!-- li/fmt-name -->
6341
6379
  <xsl:template match="mn:li/mn:fmt-name" priority="2" mode="update_xml_step1">
6342
6380
  <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
@@ -9668,6 +9706,8 @@
9668
9706
  <xsl:if test="ancestor::mn:preface">
9669
9707
  <xsl:attribute name="border">none</xsl:attribute>
9670
9708
  </xsl:if>
9709
+
9710
+ <xsl:call-template name="setNoBordersForTableList"/>
9671
9711
  </xsl:template> <!-- refine_table-style -->
9672
9712
 
9673
9713
  <xsl:attribute-set name="table-number-style">
@@ -9710,6 +9750,8 @@
9710
9750
  <xsl:attribute name="border-top">none</xsl:attribute>
9711
9751
  <xsl:attribute name="border-bottom">none</xsl:attribute>
9712
9752
  </xsl:if>
9753
+
9754
+ <xsl:call-template name="setNoBordersForTableList"/>
9713
9755
  </xsl:template> <!-- refine_table-header-row-style -->
9714
9756
 
9715
9757
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
@@ -9718,6 +9760,8 @@
9718
9760
  </xsl:attribute-set>
9719
9761
 
9720
9762
  <xsl:template name="refine_table-footer-row-style">
9763
+
9764
+ <xsl:call-template name="setNoBordersForTableList"/>
9721
9765
  </xsl:template> <!-- refine_table-footer-row-style -->
9722
9766
 
9723
9767
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
@@ -9727,6 +9771,8 @@
9727
9771
  <xsl:template name="refine_table-body-row-style">
9728
9772
 
9729
9773
  <xsl:call-template name="setBordersTableArray"/>
9774
+
9775
+ <xsl:call-template name="setNoBordersForTableList"/>
9730
9776
  </xsl:template> <!-- refine_table-body-row-style -->
9731
9777
 
9732
9778
  <xsl:attribute-set name="table-header-cell-style">
@@ -9753,6 +9799,16 @@
9753
9799
  </xsl:if>
9754
9800
 
9755
9801
  <xsl:call-template name="setTableCellAttributes"/>
9802
+
9803
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
9804
+ <xsl:attribute name="display-align">before</xsl:attribute>
9805
+ <xsl:attribute name="text-align">left</xsl:attribute>
9806
+ <xsl:if test="following-sibling::*">
9807
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
9808
+ </xsl:if>
9809
+ <xsl:call-template name="setNoBordersForTableList"/>
9810
+ </xsl:if>
9811
+
9756
9812
  </xsl:template> <!-- refine_table-header-cell-style -->
9757
9813
 
9758
9814
  <xsl:attribute-set name="table-cell-style">
@@ -9774,6 +9830,15 @@
9774
9830
  <xsl:attribute name="border">none</xsl:attribute>
9775
9831
  </xsl:if>
9776
9832
 
9833
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
9834
+ <xsl:attribute name="display-align">before</xsl:attribute>
9835
+ <xsl:attribute name="text-align">left</xsl:attribute>
9836
+ <xsl:if test="following-sibling::*">
9837
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
9838
+ </xsl:if>
9839
+ <xsl:call-template name="setNoBordersForTableList"/>
9840
+ </xsl:if>
9841
+
9777
9842
  </xsl:template> <!-- refine_table-cell-style -->
9778
9843
 
9779
9844
  <xsl:attribute-set name="table-footer-cell-style">
@@ -9786,6 +9851,8 @@
9786
9851
  </xsl:attribute-set> <!-- table-footer-cell-style -->
9787
9852
 
9788
9853
  <xsl:template name="refine_table-footer-cell-style">
9854
+
9855
+ <xsl:call-template name="setNoBordersForTableList"/>
9789
9856
  </xsl:template> <!-- refine_table-footer-cell-style -->
9790
9857
 
9791
9858
  <xsl:attribute-set name="table-note-style">
@@ -9835,6 +9902,16 @@
9835
9902
  <xsl:template name="refine_table-fn-body-style">
9836
9903
  </xsl:template>
9837
9904
 
9905
+ <xsl:template name="setNoBordersForTableList">
9906
+ <xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
9907
+ <xsl:attribute name="border">none</xsl:attribute>
9908
+ <xsl:attribute name="border-top">none</xsl:attribute>
9909
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
9910
+ <xsl:attribute name="border-left">none</xsl:attribute>
9911
+ <xsl:attribute name="border-right">none</xsl:attribute>
9912
+ </xsl:if>
9913
+ </xsl:template>
9914
+
9838
9915
  <!-- ========================== -->
9839
9916
  <!-- END Table styles -->
9840
9917
  <!-- ========================== -->
@@ -15555,6 +15632,10 @@
15555
15632
  </fo:list-item>
15556
15633
  </xsl:template>
15557
15634
 
15635
+ <xsl:template match="mn:fmt-ol | mn:fmt-ul">
15636
+ <xsl:apply-templates/>
15637
+ </xsl:template>
15638
+
15558
15639
  <!-- ===================================== -->
15559
15640
  <!-- END Lists processing -->
15560
15641
  <!-- ===================================== -->
@@ -6,11 +6,11 @@ module IsoDoc
6
6
  class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
7
7
  def annex1(elem)
8
8
  elem["commentary"] == "true" and return commentary(elem)
9
- lbl = @xrefs.anchor(elem["id"], :label)
10
- if t = elem.at(ns("./title"))
11
- t.children = "<strong>#{to_xml(t.children)}</strong>"
12
- end
13
- prefix_name(elem, { caption: "<br/>" }, lbl, "title")
9
+ super
10
+ end
11
+
12
+ def annex_delim(_elem)
13
+ "<br/>"
14
14
  end
15
15
 
16
16
  def annex(docxml)
@@ -101,7 +101,7 @@ module IsoDoc
101
101
  %(#{@meta.get[:"investigative-committee"]} #{@i18n.membership_table})
102
102
  y = YAML.safe_load(s.children.to_xml(encoding: "UTF-8"))
103
103
  d = clause.at(ns("./key")) || clause.at(ns("./dl"))
104
- s && y.is_a?(Array) or return [nil, nil, nil, nil]
104
+ (s && y.is_a?(Array)) or return [nil, nil, nil, nil]
105
105
  [s, t, y, d]
106
106
  end
107
107
 
@@ -111,7 +111,8 @@ module IsoDoc
111
111
  n = y["name"]
112
112
  if n.is_a?(Hash)
113
113
  n = if @lang == "ja" then "#{n['surname']} #{n['givenname']}"
114
- else "#{n['givenname']} #{n['surname']}" end
114
+ else "#{n['givenname']} #{n['surname']}"
115
+ end
115
116
  end
116
117
  <<~XML
117
118
  <tr #{add_id_text}><td #{add_id_text}>#{r}</td><td #{add_id_text}>#{n}</td><td #{add_id_text}>#{y['affiliation']}</td></tr>
@@ -31,7 +31,7 @@ module IsoDoc
31
31
  @autonumbering_style == :japanese ? "\u30fb" : "."
32
32
  end
33
33
 
34
- def clause_counter(num, opts = { })
34
+ def clause_counter(num = 0, opts = { })
35
35
  opts[:numerals] ||= @autonumbering_style
36
36
  opts[:separator] ||= clausesep
37
37
  super
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Jis
3
- VERSION = "1.0.5".freeze
3
+ VERSION = "1.0.6".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-16 00:00:00.000000000 Z
11
+ date: 2026-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: japanese_calendar