metanorma-ribose 2.1.8.1 → 2.1.10

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: 49a6039f8dfaf5bfb62b8240a29cb3be67bb36c85f572f1ad94b2c9f949b6beb
4
- data.tar.gz: 51e16ed6a2a3c55ac11d53e2f57855e5c85f81815631c73a8812341d5cb75444
3
+ metadata.gz: ef9a985447d820480b91f3e3ddeb51dacaaf704aba771de6e359b3b525ec9669
4
+ data.tar.gz: 356fdaf4ffc1ad22287ab3daa9bf24fe7eda1efb5b7879c3e5b2238cc5eec891
5
5
  SHA512:
6
- metadata.gz: 16127cb7ba8291037f8c015a6983f817ff7ee2cff85095a7645ae490b5da0e5aaeebb48181fd23fab520af41f3a2b51e7cee11910ce378398d744d5fa501618e
7
- data.tar.gz: a73e644bb3d92a83340e5b568673085e4925130cacb7f6903c6076b5611e2ba1d16dfc98c017c8d6f453d07239a35b40a40cff92458ae75c77f5d80efa302629
6
+ metadata.gz: 8399e3993cdf02d45ae4f91a2b4d78a6b37ec23fd08215aeae37efe51118ba862cd572535edd18b7b61a30a07d2001df005a56f189e86fae67768d793202d667
7
+ data.tar.gz: e90b600180866ff7798a14dd14039b6f4822000533e9743a60e877f98cc5f9c1e72de9a62f352dd5e385ae18464f497e8ba513a92207a62d4891e0411445934f
@@ -5,8 +5,8 @@ require_relative "xref"
5
5
  module IsoDoc
6
6
  module Ribose
7
7
  module Init
8
- def metadata_init(lang, script, labels)
9
- @meta = Metadata.new(lang, script, labels)
8
+ def metadata_init(lang, script, locale, labels)
9
+ @meta = Metadata.new(lang, script, locale, labels)
10
10
  end
11
11
 
12
12
  def xref_init(lang, script, _klass, labels, options)
@@ -14,9 +14,9 @@ module IsoDoc
14
14
  @xrefs = Xref.new(lang, script, html, labels, options)
15
15
  end
16
16
 
17
- def i18n_init(lang, script, i18nyaml = nil)
17
+ def i18n_init(lang, script, locale, i18nyaml = nil)
18
18
  @i18n = I18n.new(
19
- lang, script, i18nyaml: i18nyaml ||
19
+ lang, script, locale: locale, i18nyaml: i18nyaml ||
20
20
  Metanorma::Ribose.configuration.i18nyaml || @i18nyaml
21
21
  )
22
22
  end
@@ -7093,6 +7093,18 @@
7093
7093
  </xsl:copy>
7094
7094
  </xsl:template>
7095
7095
 
7096
+ <xsl:template match="*[local-name() = 'sub']" mode="contents_item">
7097
+ <xsl:copy>
7098
+ <xsl:apply-templates mode="contents_item"/>
7099
+ </xsl:copy>
7100
+ </xsl:template>
7101
+
7102
+ <xsl:template match="*[local-name() = 'sup']" mode="contents_item">
7103
+ <xsl:copy>
7104
+ <xsl:apply-templates mode="contents_item"/>
7105
+ </xsl:copy>
7106
+ </xsl:template>
7107
+
7096
7108
  <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
7097
7109
  <xsl:copy-of select="."/>
7098
7110
  </xsl:template>
@@ -8066,7 +8078,7 @@
8066
8078
  <!-- ====== -->
8067
8079
  <!-- eref -->
8068
8080
  <!-- ====== -->
8069
- <xsl:template match="*[local-name() = 'eref']">
8081
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
8070
8082
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
8071
8083
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
8072
8084
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -8560,21 +8572,29 @@
8560
8572
  </xsl:variable>
8561
8573
 
8562
8574
  <xsl:template match="@*|node()" mode="index_add_id">
8575
+ <xsl:param name="docid"/>
8563
8576
  <xsl:copy>
8564
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
8577
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
8578
+ <xsl:with-param name="docid" select="$docid"/>
8579
+ </xsl:apply-templates>
8565
8580
  </xsl:copy>
8566
8581
  </xsl:template>
8567
8582
 
8568
8583
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
8584
+ <xsl:param name="docid"/>
8569
8585
  <xsl:variable name="id">
8570
- <xsl:call-template name="generateIndexXrefId"/>
8586
+ <xsl:call-template name="generateIndexXrefId">
8587
+ <xsl:with-param name="docid" select="$docid"/>
8588
+ </xsl:call-template>
8571
8589
  </xsl:variable>
8572
8590
  <xsl:copy> <!-- add id to xref -->
8573
8591
  <xsl:apply-templates select="@*" mode="index_add_id"/>
8574
8592
  <xsl:attribute name="id">
8575
8593
  <xsl:value-of select="$id"/>
8576
8594
  </xsl:attribute>
8577
- <xsl:apply-templates mode="index_add_id"/>
8595
+ <xsl:apply-templates mode="index_add_id">
8596
+ <xsl:with-param name="docid" select="$docid"/>
8597
+ </xsl:apply-templates>
8578
8598
  </xsl:copy>
8579
8599
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
8580
8600
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -8586,7 +8606,9 @@
8586
8606
  <xsl:attribute name="id">
8587
8607
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
8588
8608
  </xsl:attribute>
8589
- <xsl:apply-templates mode="index_add_id"/>
8609
+ <xsl:apply-templates mode="index_add_id">
8610
+ <xsl:with-param name="docid" select="$docid"/>
8611
+ </xsl:apply-templates>
8590
8612
  </xsl:copy>
8591
8613
  </xsl:if>
8592
8614
  </xsl:template>
@@ -8623,12 +8645,33 @@
8623
8645
  </xsl:when>
8624
8646
  <xsl:when test="self::* and local-name(.) = 'xref'">
8625
8647
  <xsl:variable name="id" select="@id"/>
8626
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
8627
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8628
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
8629
8648
 
8649
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8630
8650
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
8631
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
8651
+
8652
+ <xsl:variable name="pages_">
8653
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
8654
+ <xsl:choose>
8655
+ <xsl:when test="@id = $id">
8656
+ <page><xsl:value-of select="."/></page>
8657
+ </xsl:when>
8658
+ <xsl:when test="@id = $id_next">
8659
+ <page_next><xsl:value-of select="."/></page_next>
8660
+ </xsl:when>
8661
+ <xsl:when test="@id = $id_prev">
8662
+ <page_prev><xsl:value-of select="."/></page_prev>
8663
+ </xsl:when>
8664
+ </xsl:choose>
8665
+ </xsl:for-each>
8666
+ </xsl:variable>
8667
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
8668
+
8669
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
8670
+ <xsl:variable name="page" select="$pages/page"/>
8671
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
8672
+ <xsl:variable name="page_next" select="$pages/page_next"/>
8673
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
8674
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
8632
8675
 
8633
8676
  <xsl:choose>
8634
8677
  <!-- 2nd pass -->
@@ -8688,16 +8731,20 @@
8688
8731
  </xsl:template>
8689
8732
 
8690
8733
  <xsl:template name="generateIndexXrefId">
8734
+ <xsl:param name="docid"/>
8735
+
8691
8736
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
8692
8737
 
8693
- <xsl:variable name="docid">
8694
- <xsl:call-template name="getDocumentId"/>
8738
+ <xsl:variable name="docid_curr">
8739
+ <xsl:value-of select="$docid"/>
8740
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
8695
8741
  </xsl:variable>
8742
+
8696
8743
  <xsl:variable name="item_number">
8697
8744
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
8698
8745
  </xsl:variable>
8699
8746
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
8700
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8747
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8701
8748
  </xsl:template>
8702
8749
 
8703
8750
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -73,8 +73,14 @@
73
73
  <text/>
74
74
  </element>
75
75
  </define>
76
- <define name="script">
76
+ <define name="locale">
77
77
  <a:documentation>ISO-639</a:documentation>
78
+ <element name="locale">
79
+ <text/>
80
+ </element>
81
+ </define>
82
+ <define name="script">
83
+ <a:documentation>ISO-3166</a:documentation>
78
84
  <element name="script">
79
85
  <text/>
80
86
  </element>
@@ -93,6 +99,9 @@
93
99
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
100
  <attribute name="language"/>
95
101
  </optional>
102
+ <optional>
103
+ <attribute name="locale"/>
104
+ </optional>
96
105
  <optional>
97
106
  <attribute name="script"/>
98
107
  </optional>
@@ -136,6 +145,9 @@
136
145
  <!-- multiple languages and scripts possible: comma delimit them if so -->
137
146
  <attribute name="language"/>
138
147
  </optional>
148
+ <optional>
149
+ <attribute name="locale"/>
150
+ </optional>
139
151
  <optional>
140
152
  <attribute name="script"/>
141
153
  </optional>
@@ -650,6 +662,9 @@
650
662
  <zeroOrMore>
651
663
  <ref name="language"/>
652
664
  </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="locale"/>
667
+ </zeroOrMore>
653
668
  <zeroOrMore>
654
669
  <ref name="script"/>
655
670
  </zeroOrMore>
@@ -741,6 +756,9 @@
741
756
  <zeroOrMore>
742
757
  <ref name="language"/>
743
758
  </zeroOrMore>
759
+ <zeroOrMore>
760
+ <ref name="locale"/>
761
+ </zeroOrMore>
744
762
  <zeroOrMore>
745
763
  <ref name="script"/>
746
764
  </zeroOrMore>
@@ -854,6 +872,15 @@
854
872
  <optional>
855
873
  <attribute name="type"/>
856
874
  </optional>
875
+ <optional>
876
+ <attribute name="language"/>
877
+ </optional>
878
+ <optional>
879
+ <attribute name="locale"/>
880
+ </optional>
881
+ <optional>
882
+ <attribute name="script"/>
883
+ </optional>
857
884
  <data type="anyURI"/>
858
885
  </define>
859
886
  <define name="DateType">
@@ -882,6 +909,7 @@
882
909
  <value>vote-started</value>
883
910
  <value>vote-ended</value>
884
911
  <value>announced</value>
912
+ <value>stable-until</value>
885
913
  </choice>
886
914
  </define>
887
915
  <define name="bdate">
@@ -930,6 +958,9 @@
930
958
  <optional>
931
959
  <attribute name="language"/>
932
960
  </optional>
961
+ <optional>
962
+ <attribute name="locale"/>
963
+ </optional>
933
964
  <optional>
934
965
  <attribute name="script"/>
935
966
  </optional>
@@ -205,6 +205,15 @@
205
205
  <data type="boolean"/>
206
206
  </attribute>
207
207
  </optional>
208
+ <optional>
209
+ <attribute name="style">
210
+ <choice>
211
+ <value>basic</value>
212
+ <value>full</value>
213
+ <value>short</value>
214
+ </choice>
215
+ </attribute>
216
+ </optional>
208
217
  <ref name="XrefBody"/>
209
218
  </element>
210
219
  </define>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.1.8.1".freeze
3
+ VERSION = "2.1.10".freeze
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
30
30
 
31
- spec.add_dependency "metanorma-generic", "~> 2.2.0"
31
+ spec.add_dependency "metanorma-generic", "~> 2.2.2"
32
32
 
33
33
  spec.add_development_dependency "debug"
34
34
  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.8.1
4
+ version: 2.1.10
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-09-07 00:00:00.000000000 Z
11
+ date: 2022-10-10 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.0
19
+ version: 2.2.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.2.0
26
+ version: 2.2.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement