metanorma-ribose 1.6.3 → 1.6.4

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: 99c74e5ae8d98c7b4a6766eaed105a0d0daee7d23d4ce88f37b5a36b7814c226
4
- data.tar.gz: b75ee656be1f45ea2dcbb55974d3f11d29439cba1a92f441d35f50f162e4e272
3
+ metadata.gz: c8d13747d6512c513911ea027a3a41108f7416310e806395b4ad640f22c92987
4
+ data.tar.gz: a0498926879d2174ace5a1696fd6cf584916199d9a76edbe96870b3cdc8e59d2
5
5
  SHA512:
6
- metadata.gz: 22b4ee12499083f505a8d0fcd3fcf3741fc9cff6ce68d574c1861a115de386f251db3a7dc55cd87a94b4d909b1f830222ee4b4b538a018622d4e375c920fa15e
7
- data.tar.gz: ef0b984bd1902cae0ce17ad99d449f34543a798d50850854e07181529f61118327ea7d0e3aacec094f14a58872a97d7539f3626392db2a156d7e564d3cea6c5d
6
+ metadata.gz: eb1b495cca8f02b13be45ac124d8b792e00936859dfd8cd791639025c55465c49f9936a3d64194a0da39f2ca84e62b591acfe63de099b2df84ae2b5026ac8fd9
7
+ data.tar.gz: fd44d288034bc4710c83fd378863facff23eb854a3774da10e2dd3295ae133b71b94025424ffde0d59f06b83b4baf179b570b1e8391877d82fda706408db0095
@@ -64,7 +64,8 @@ this general model can be found on its page. Details of the Ribose modifications
64
64
  to this general model can be found on the https://github.com/metanorma/metanorma-model-rsd[RSD model]
65
65
  repository.
66
66
 
67
- ////
68
67
  == Examples
69
- ////
68
+
69
+ Example documents may be found in the https://github.com/metanorma/mn-samples-ribose[mn-samples-ribose]
70
+ repository.
70
71
 
@@ -158,17 +158,7 @@
158
158
  <data type="ID"/>
159
159
  </attribute>
160
160
  <oneOrMore>
161
- <choice>
162
- <ref name="formula"/>
163
- <ref name="ul"/>
164
- <ref name="ol"/>
165
- <ref name="dl"/>
166
- <ref name="quote"/>
167
- <ref name="sourcecode"/>
168
- <ref name="paragraph"/>
169
- <ref name="table"/>
170
- <ref name="figure"/>
171
- </choice>
161
+ <ref name="paragraph"/>
172
162
  </oneOrMore>
173
163
  </element>
174
164
  </define>
@@ -1028,6 +1018,9 @@
1028
1018
  <value>alphabet_upper</value>
1029
1019
  </choice>
1030
1020
  </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1031
1024
  <oneOrMore>
1032
1025
  <ref name="li"/>
1033
1026
  </oneOrMore>
@@ -64,6 +64,11 @@
64
64
  </choice>
65
65
  </attribute>
66
66
  </optional>
67
+ <optional>
68
+ <attribute name="droploc">
69
+ <data type="boolean"/>
70
+ </attribute>
71
+ </optional>
67
72
  <text/>
68
73
  </element>
69
74
  </define>
@@ -859,6 +864,13 @@
859
864
  </define>
860
865
  <define name="standard-document">
861
866
  <element name="standard-document">
867
+ <attribute name="version"/>
868
+ <attribute name="type">
869
+ <choice>
870
+ <value>semantic</value>
871
+ <value>presentation</value>
872
+ </choice>
873
+ </attribute>
862
874
  <ref name="bibdata"/>
863
875
  <optional>
864
876
  <ref name="boilerplate"/>
@@ -880,7 +892,7 @@
880
892
  <oneOrMore>
881
893
  <choice>
882
894
  <ref name="content"/>
883
- <ref name="preface_abstract"/>
895
+ <ref name="abstract"/>
884
896
  <ref name="foreword"/>
885
897
  <ref name="introduction"/>
886
898
  <ref name="acknowledgements"/>
@@ -1481,11 +1493,6 @@
1481
1493
  </optional>
1482
1494
  </element>
1483
1495
  </define>
1484
- <define name="preface_abstract">
1485
- <element name="abstract">
1486
- <ref name="Basic-Section"/>
1487
- </element>
1488
- </define>
1489
1496
  <define name="term-clause">
1490
1497
  <element name="clause">
1491
1498
  <optional>
@@ -59,6 +59,13 @@
59
59
  </define>
60
60
  <define name="rsd-standard">
61
61
  <element name="rsd-standard">
62
+ <attribute name="version"/>
63
+ <attribute name="type">
64
+ <choice>
65
+ <value>semantic</value>
66
+ <value>presentation</value>
67
+ </choice>
68
+ </attribute>
62
69
  <ref name="bibdata"/>
63
70
  <zeroOrMore>
64
71
  <ref name="termdocsource"/>
@@ -91,6 +91,10 @@
91
91
 
92
92
  <xsl:call-template name="addPDFUAmeta"/>
93
93
 
94
+ <xsl:call-template name="addBookmarks">
95
+ <xsl:with-param name="contents" select="$contents"/>
96
+ </xsl:call-template>
97
+
94
98
  <fo:page-sequence master-reference="document" format="i" force-page-count="end-on-even">
95
99
  <fo:static-content flow-name="xsl-footnote-separator">
96
100
  <fo:block>
@@ -163,7 +167,7 @@
163
167
  </xsl:variable>
164
168
  <fo:block font-size="14pt" font-weight="bold" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
165
169
  <fo:block font-weight="bold" line-height="125%">
166
- <xsl:for-each select="xalan:nodeset($contents)//item">
170
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
167
171
  <fo:block>
168
172
  <xsl:if test="@level = 1">
169
173
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -184,9 +188,9 @@
184
188
  </fo:list-item-label>
185
189
  <fo:list-item-body start-indent="body-start()">
186
190
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
187
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
191
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
188
192
 
189
- <xsl:apply-templates/>
193
+ <xsl:apply-templates select="title"/>
190
194
 
191
195
  <fo:inline keep-together.within-line="always">
192
196
  <fo:leader leader-pattern="dots"/>
@@ -261,16 +265,22 @@
261
265
  </xsl:variable>
262
266
 
263
267
  <xsl:variable name="display">
264
- <xsl:choose>
265
- <xsl:when test="ancestor-or-self::rsd:bibitem">false</xsl:when>
266
- <xsl:when test="ancestor-or-self::rsd:term">false</xsl:when>
268
+ <xsl:choose>
267
269
  <xsl:when test="$level &gt;= 3">false</xsl:when>
268
270
  <xsl:otherwise>true</xsl:otherwise>
269
271
  </xsl:choose>
270
272
  </xsl:variable>
271
273
 
274
+ <xsl:variable name="skip">
275
+ <xsl:choose>
276
+ <xsl:when test="ancestor-or-self::rsd:bibitem">true</xsl:when>
277
+ <xsl:when test="ancestor-or-self::rsd:term">true</xsl:when>
278
+ <xsl:otherwise>false</xsl:otherwise>
279
+ </xsl:choose>
280
+ </xsl:variable>
281
+
272
282
 
273
- <xsl:if test="$display = 'true'">
283
+ <xsl:if test="$skip = 'false'">
274
284
 
275
285
  <xsl:variable name="section">
276
286
  <xsl:call-template name="getSection"/>
@@ -284,10 +294,13 @@
284
294
  <xsl:value-of select="local-name()"/>
285
295
  </xsl:variable>
286
296
 
287
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
288
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
297
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
298
+ <title>
299
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
300
+ </title>
301
+ <xsl:apply-templates mode="contents"/>
289
302
  </item>
290
- <xsl:apply-templates mode="contents"/>
303
+
291
304
  </xsl:if>
292
305
 
293
306
  </xsl:template>
@@ -898,6 +911,12 @@
898
911
 
899
912
  </title-edition>
900
913
 
914
+ <title-edition lang="fr">
915
+
916
+ <xsl:text>Édition </xsl:text>
917
+
918
+ </title-edition>
919
+
901
920
 
902
921
  <title-toc lang="en">
903
922
 
@@ -1006,7 +1025,9 @@
1006
1025
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1007
1026
  </xsl:otherwise>
1008
1027
  </xsl:choose>
1009
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
1028
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
1029
+
1030
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1010
1031
 
1011
1032
  <xsl:attribute name="color">blue</xsl:attribute>
1012
1033
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2942,12 +2963,101 @@
2942
2963
 
2943
2964
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2944
2965
  </fo:block>
2945
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2966
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2946
2967
  <xsl:apply-templates mode="contents"/>
2947
2968
  <xsl:text> </xsl:text>
2948
- </xsl:template><xsl:template match="text()" mode="contents">
2969
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
2970
+ <xsl:apply-templates mode="bookmarks"/>
2971
+ <xsl:text> </xsl:text>
2972
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2949
2973
  <xsl:value-of select="."/>
2950
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2974
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2975
+ <xsl:value-of select="."/>
2976
+ </xsl:template><xsl:template match="node()" mode="contents">
2977
+ <xsl:apply-templates mode="contents"/>
2978
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
2979
+ <xsl:apply-templates mode="bookmarks"/>
2980
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
2981
+ <xsl:apply-templates select="."/>
2982
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
2983
+ <xsl:apply-templates mode="bookmarks"/>
2984
+ </xsl:template><xsl:template name="addBookmarks">
2985
+ <xsl:param name="contents"/>
2986
+ <xsl:if test="xalan:nodeset($contents)//item">
2987
+ <fo:bookmark-tree>
2988
+ <xsl:choose>
2989
+ <xsl:when test="xalan:nodeset($contents)/doc">
2990
+ <xsl:choose>
2991
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
2992
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
2993
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
2994
+ <fo:bookmark-title>
2995
+ <xsl:variable name="bookmark-title_">
2996
+ <xsl:choose>
2997
+ <xsl:when test="@lang = 'en'">
2998
+
2999
+
3000
+ </xsl:when>
3001
+ <xsl:when test="@lang = 'fr'">
3002
+
3003
+
3004
+ </xsl:when>
3005
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3006
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3007
+ </xsl:choose>
3008
+ </xsl:variable>
3009
+ <xsl:choose>
3010
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3011
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3012
+ </xsl:when>
3013
+ <xsl:otherwise>
3014
+ <xsl:choose>
3015
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3016
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3017
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3018
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3019
+ </xsl:choose>
3020
+ </xsl:otherwise>
3021
+ </xsl:choose>
3022
+ </fo:bookmark-title>
3023
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3024
+ </fo:bookmark>
3025
+
3026
+ </xsl:for-each>
3027
+ </xsl:when>
3028
+ <xsl:otherwise>
3029
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3030
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3031
+ </xsl:for-each>
3032
+ </xsl:otherwise>
3033
+ </xsl:choose>
3034
+ </xsl:when>
3035
+ <xsl:otherwise>
3036
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3037
+ </xsl:otherwise>
3038
+ </xsl:choose>
3039
+
3040
+
3041
+
3042
+
3043
+
3044
+
3045
+
3046
+
3047
+ </fo:bookmark-tree>
3048
+ </xsl:if>
3049
+ </xsl:template><xsl:template match="item" mode="bookmark">
3050
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3051
+ <fo:bookmark-title>
3052
+ <xsl:if test="@section != ''">
3053
+ <xsl:value-of select="@section"/>
3054
+ <xsl:text> </xsl:text>
3055
+ </xsl:if>
3056
+ <xsl:value-of select="normalize-space(title)"/>
3057
+ </fo:bookmark-title>
3058
+ <xsl:apply-templates mode="bookmark"/>
3059
+ </fo:bookmark>
3060
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2951
3061
  <xsl:if test="normalize-space() != ''">
2952
3062
  <fo:block xsl:use-attribute-sets="figure-name-style">
2953
3063
 
@@ -3005,7 +3115,7 @@
3005
3115
  <xsl:apply-templates/>
3006
3116
  </xsl:otherwise>
3007
3117
  </xsl:choose>
3008
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3118
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3009
3119
  <xsl:text> </xsl:text>
3010
3120
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3011
3121
  <xsl:copy>
@@ -3607,20 +3717,29 @@
3607
3717
  <!-- 0xA0 to space replacement -->
3608
3718
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3609
3719
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3610
- <fo:block-container margin-left="0mm">
3611
- <xsl:if test="parent::*[local-name() = 'note']">
3612
- <xsl:attribute name="margin-left">
3613
- <xsl:choose>
3614
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3615
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3616
- </xsl:choose>
3617
- </xsl:attribute>
3618
-
3619
- </xsl:if>
3620
- <fo:block-container margin-left="0mm">
3621
- <xsl:apply-templates select="." mode="ul_ol"/>
3622
- </fo:block-container>
3623
- </fo:block-container>
3720
+ <xsl:choose>
3721
+ <xsl:when test="parent::*[local-name() = 'note']">
3722
+ <fo:block-container>
3723
+ <xsl:attribute name="margin-left">
3724
+ <xsl:choose>
3725
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3726
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3727
+ </xsl:choose>
3728
+ </xsl:attribute>
3729
+
3730
+ <fo:block-container margin-left="0mm">
3731
+ <fo:block>
3732
+ <xsl:apply-templates select="." mode="ul_ol"/>
3733
+ </fo:block>
3734
+ </fo:block-container>
3735
+ </fo:block-container>
3736
+ </xsl:when>
3737
+ <xsl:otherwise>
3738
+ <fo:block>
3739
+ <xsl:apply-templates select="." mode="ul_ol"/>
3740
+ </fo:block>
3741
+ </xsl:otherwise>
3742
+ </xsl:choose>
3624
3743
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3625
3744
  <!-- <row>
3626
3745
  <date>05-07-2013</date>
@@ -3916,6 +4035,7 @@
3916
4035
 
3917
4036
 
3918
4037
 
4038
+
3919
4039
  </xsl:variable>
3920
4040
  <xsl:if test="$documentNS != $XSLNS">
3921
4041
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3941,4 +4061,21 @@
3941
4061
  </xsl:otherwise>
3942
4062
  </xsl:choose>
3943
4063
  </xsl:attribute>
4064
+ </xsl:template><xsl:template name="add-letter-spacing">
4065
+ <xsl:param name="text"/>
4066
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4067
+ <xsl:if test="string-length($text) &gt; 0">
4068
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4069
+ <fo:inline padding-right="{$letter-spacing}mm">
4070
+ <xsl:if test="$char = '®'">
4071
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4072
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4073
+ </xsl:if>
4074
+ <xsl:value-of select="$char"/>
4075
+ </fo:inline>
4076
+ <xsl:call-template name="add-letter-spacing">
4077
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4078
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4079
+ </xsl:call-template>
4080
+ </xsl:if>
3944
4081
  </xsl:template></xsl:stylesheet>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "1.6.3"
3
+ VERSION = "1.6.4"
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
31
  spec.add_dependency "isodoc", "~> 1.2.0"
32
- spec.add_dependency 'metanorma-generic', '~> 1.6.0'
32
+ spec.add_dependency 'metanorma-generic', '~> 1.7.0'
33
33
 
34
34
  spec.add_development_dependency "byebug", "~> 9.1"
35
35
  spec.add_development_dependency "sassc", "2.4.0"
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: 1.6.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2020-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: isodoc
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.6.0
33
+ version: 1.7.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.6.0
40
+ version: 1.7.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement