metanorma-iho 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iho/basicdoc.rng +4 -11
- data/lib/asciidoctor/iho/iho.rng +7 -0
- data/lib/asciidoctor/iho/isodoc.rng +13 -6
- data/lib/isodoc/iho/iho.specification.xsl +166 -29
- data/lib/isodoc/iho/iho.standard.xsl +166 -29
- data/lib/isodoc/iho/xref.rb +1 -1
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +1 -2
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfcef8b84ef111f6f524d3be2ab6e10a1f5a167e78340028484ddce1e2dbcd2e
|
4
|
+
data.tar.gz: b43a8f171ddce0f39422172bce91c522abbbb26cd4ed71374feaa4156b544766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f394dc0d1fb60c38446fc4c9331b8e8d6c7a21a9669584740912cc7c4c299a5ea80d0a026af23d2f2b519a3bbe2bf500cb64d4cdb3721fe27aa86c3960ae924
|
7
|
+
data.tar.gz: d009ab8824da4788e723e734320c3d95641fc52541fbce2f3f2af843bcf653382c52b15c78114389bf4da46abd9b3b484c7da51b7f7d6c239c2db0925dd6939b
|
@@ -158,17 +158,7 @@
|
|
158
158
|
<data type="ID"/>
|
159
159
|
</attribute>
|
160
160
|
<oneOrMore>
|
161
|
-
<
|
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>
|
data/lib/asciidoctor/iho/iho.rng
CHANGED
@@ -148,6 +148,13 @@
|
|
148
148
|
</define>
|
149
149
|
<define name="iho-standard">
|
150
150
|
<element name="iho-standard">
|
151
|
+
<attribute name="version"/>
|
152
|
+
<attribute name="type">
|
153
|
+
<choice>
|
154
|
+
<value>semantic</value>
|
155
|
+
<value>presentation</value>
|
156
|
+
</choice>
|
157
|
+
</attribute>
|
151
158
|
<ref name="bibdata"/>
|
152
159
|
<zeroOrMore>
|
153
160
|
<ref name="termdocsource"/>
|
@@ -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="
|
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>
|
@@ -111,6 +111,10 @@
|
|
111
111
|
|
112
112
|
<xsl:call-template name="addPDFUAmeta"/>
|
113
113
|
|
114
|
+
<xsl:call-template name="addBookmarks">
|
115
|
+
<xsl:with-param name="contents" select="$contents"/>
|
116
|
+
</xsl:call-template>
|
117
|
+
|
114
118
|
<!-- =========================== -->
|
115
119
|
<!-- Cover Page -->
|
116
120
|
<fo:page-sequence master-reference="cover">
|
@@ -217,7 +221,7 @@
|
|
217
221
|
<xsl:text disable-output-escaping="yes">--></xsl:text>
|
218
222
|
</xsl:if>
|
219
223
|
|
220
|
-
<xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
224
|
+
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
221
225
|
<fo:block>
|
222
226
|
<xsl:if test="@level = 1">
|
223
227
|
<xsl:attribute name="margin-top">6pt</xsl:attribute>
|
@@ -243,8 +247,8 @@
|
|
243
247
|
</fo:list-item-label>
|
244
248
|
<fo:list-item-body start-indent="body-start()">
|
245
249
|
<fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
|
246
|
-
<fo:basic-link internal-destination="{@id}" fox:alt-text="{
|
247
|
-
<xsl:apply-templates/>
|
250
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
251
|
+
<xsl:apply-templates select="title"/>
|
248
252
|
<fo:inline keep-together.within-line="always">
|
249
253
|
<fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
|
250
254
|
<fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
|
@@ -361,15 +365,21 @@
|
|
361
365
|
</xsl:variable>
|
362
366
|
|
363
367
|
<xsl:variable name="display">
|
364
|
-
<xsl:choose>
|
365
|
-
<xsl:when test="ancestor-or-self::iho:bibitem">false</xsl:when>
|
366
|
-
<xsl:when test="ancestor-or-self::iho:term">false</xsl:when>
|
368
|
+
<xsl:choose>
|
367
369
|
<xsl:when test="$level <= 2">true</xsl:when>
|
368
370
|
<xsl:otherwise>false</xsl:otherwise>
|
369
371
|
</xsl:choose>
|
370
372
|
</xsl:variable>
|
371
373
|
|
372
|
-
<xsl:
|
374
|
+
<xsl:variable name="skip">
|
375
|
+
<xsl:choose>
|
376
|
+
<xsl:when test="ancestor-or-self::iho:bibitem">true</xsl:when>
|
377
|
+
<xsl:when test="ancestor-or-self::iho:term">true</xsl:when>
|
378
|
+
<xsl:otherwise>false</xsl:otherwise>
|
379
|
+
</xsl:choose>
|
380
|
+
</xsl:variable>
|
381
|
+
|
382
|
+
<xsl:if test="$skip = 'false'">
|
373
383
|
|
374
384
|
<xsl:variable name="section">
|
375
385
|
<xsl:call-template name="getSection"/>
|
@@ -388,10 +398,13 @@
|
|
388
398
|
<xsl:if test="ancestor-or-self::iho:annex">annex</xsl:if>
|
389
399
|
</xsl:variable>
|
390
400
|
|
391
|
-
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}">
|
392
|
-
<
|
401
|
+
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
|
402
|
+
<title>
|
403
|
+
<xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
|
404
|
+
</title>
|
405
|
+
<xsl:apply-templates mode="contents"/>
|
393
406
|
</item>
|
394
|
-
|
407
|
+
|
395
408
|
</xsl:if>
|
396
409
|
|
397
410
|
</xsl:template>
|
@@ -954,6 +967,12 @@
|
|
954
967
|
|
955
968
|
</title-edition>
|
956
969
|
|
970
|
+
<title-edition lang="fr">
|
971
|
+
|
972
|
+
<xsl:text>Édition </xsl:text>
|
973
|
+
|
974
|
+
</title-edition>
|
975
|
+
|
957
976
|
|
958
977
|
<title-toc lang="en">
|
959
978
|
|
@@ -1062,7 +1081,9 @@
|
|
1062
1081
|
<xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
|
1063
1082
|
</xsl:otherwise>
|
1064
1083
|
</xsl:choose>
|
1065
|
-
</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="'
'"/><xsl:attribute-set name="
|
1084
|
+
</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="'
'"/><xsl:attribute-set name="root-style">
|
1085
|
+
|
1086
|
+
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1066
1087
|
|
1067
1088
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1068
1089
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
@@ -3008,12 +3029,101 @@
|
|
3008
3029
|
|
3009
3030
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3010
3031
|
</fo:block>
|
3011
|
-
</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">
|
3032
|
+
</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">
|
3012
3033
|
<xsl:apply-templates mode="contents"/>
|
3013
3034
|
<xsl:text> </xsl:text>
|
3014
|
-
</xsl:template><xsl:template match="
|
3035
|
+
</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">
|
3036
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3037
|
+
<xsl:text> </xsl:text>
|
3038
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3015
3039
|
<xsl:value-of select="."/>
|
3016
|
-
</xsl:template><xsl:template match="*[local-name() = '
|
3040
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3041
|
+
<xsl:value-of select="."/>
|
3042
|
+
</xsl:template><xsl:template match="node()" mode="contents">
|
3043
|
+
<xsl:apply-templates mode="contents"/>
|
3044
|
+
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3045
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3046
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3047
|
+
<xsl:apply-templates select="."/>
|
3048
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3049
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3050
|
+
</xsl:template><xsl:template name="addBookmarks">
|
3051
|
+
<xsl:param name="contents"/>
|
3052
|
+
<xsl:if test="xalan:nodeset($contents)//item">
|
3053
|
+
<fo:bookmark-tree>
|
3054
|
+
<xsl:choose>
|
3055
|
+
<xsl:when test="xalan:nodeset($contents)/doc">
|
3056
|
+
<xsl:choose>
|
3057
|
+
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
3058
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3059
|
+
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
3060
|
+
<fo:bookmark-title>
|
3061
|
+
<xsl:variable name="bookmark-title_">
|
3062
|
+
<xsl:choose>
|
3063
|
+
<xsl:when test="@lang = 'en'">
|
3064
|
+
|
3065
|
+
|
3066
|
+
</xsl:when>
|
3067
|
+
<xsl:when test="@lang = 'fr'">
|
3068
|
+
|
3069
|
+
|
3070
|
+
</xsl:when>
|
3071
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
3072
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
3073
|
+
</xsl:choose>
|
3074
|
+
</xsl:variable>
|
3075
|
+
<xsl:choose>
|
3076
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
3077
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
3078
|
+
</xsl:when>
|
3079
|
+
<xsl:otherwise>
|
3080
|
+
<xsl:choose>
|
3081
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
3082
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
3083
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
3084
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
3085
|
+
</xsl:choose>
|
3086
|
+
</xsl:otherwise>
|
3087
|
+
</xsl:choose>
|
3088
|
+
</fo:bookmark-title>
|
3089
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3090
|
+
</fo:bookmark>
|
3091
|
+
|
3092
|
+
</xsl:for-each>
|
3093
|
+
</xsl:when>
|
3094
|
+
<xsl:otherwise>
|
3095
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3096
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3097
|
+
</xsl:for-each>
|
3098
|
+
</xsl:otherwise>
|
3099
|
+
</xsl:choose>
|
3100
|
+
</xsl:when>
|
3101
|
+
<xsl:otherwise>
|
3102
|
+
<xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
|
3103
|
+
</xsl:otherwise>
|
3104
|
+
</xsl:choose>
|
3105
|
+
|
3106
|
+
|
3107
|
+
|
3108
|
+
|
3109
|
+
|
3110
|
+
|
3111
|
+
|
3112
|
+
|
3113
|
+
</fo:bookmark-tree>
|
3114
|
+
</xsl:if>
|
3115
|
+
</xsl:template><xsl:template match="item" mode="bookmark">
|
3116
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
3117
|
+
<fo:bookmark-title>
|
3118
|
+
<xsl:if test="@section != ''">
|
3119
|
+
<xsl:value-of select="@section"/>
|
3120
|
+
<xsl:text> </xsl:text>
|
3121
|
+
</xsl:if>
|
3122
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3123
|
+
</fo:bookmark-title>
|
3124
|
+
<xsl:apply-templates mode="bookmark"/>
|
3125
|
+
</fo:bookmark>
|
3126
|
+
</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">
|
3017
3127
|
<xsl:if test="normalize-space() != ''">
|
3018
3128
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
3019
3129
|
|
@@ -3071,7 +3181,7 @@
|
|
3071
3181
|
<xsl:apply-templates/>
|
3072
3182
|
</xsl:otherwise>
|
3073
3183
|
</xsl:choose>
|
3074
|
-
</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">
|
3184
|
+
</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">
|
3075
3185
|
<xsl:text> </xsl:text>
|
3076
3186
|
</xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
3077
3187
|
<xsl:copy>
|
@@ -3677,20 +3787,29 @@
|
|
3677
3787
|
<!-- 0xA0 to space replacement -->
|
3678
3788
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
3679
3789
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
3680
|
-
<
|
3681
|
-
<xsl:
|
3682
|
-
<
|
3683
|
-
<xsl:
|
3684
|
-
<xsl:
|
3685
|
-
|
3686
|
-
|
3687
|
-
|
3688
|
-
|
3689
|
-
|
3690
|
-
|
3691
|
-
|
3692
|
-
|
3693
|
-
|
3790
|
+
<xsl:choose>
|
3791
|
+
<xsl:when test="parent::*[local-name() = 'note']">
|
3792
|
+
<fo:block-container>
|
3793
|
+
<xsl:attribute name="margin-left">
|
3794
|
+
<xsl:choose>
|
3795
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
3796
|
+
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
3797
|
+
</xsl:choose>
|
3798
|
+
</xsl:attribute>
|
3799
|
+
|
3800
|
+
<fo:block-container margin-left="0mm">
|
3801
|
+
<fo:block>
|
3802
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
3803
|
+
</fo:block>
|
3804
|
+
</fo:block-container>
|
3805
|
+
</fo:block-container>
|
3806
|
+
</xsl:when>
|
3807
|
+
<xsl:otherwise>
|
3808
|
+
<fo:block>
|
3809
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
3810
|
+
</fo:block>
|
3811
|
+
</xsl:otherwise>
|
3812
|
+
</xsl:choose>
|
3694
3813
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
3695
3814
|
<!-- <row>
|
3696
3815
|
<date>05-07-2013</date>
|
@@ -4087,6 +4206,7 @@
|
|
4087
4206
|
|
4088
4207
|
|
4089
4208
|
|
4209
|
+
|
4090
4210
|
</xsl:variable>
|
4091
4211
|
<xsl:if test="$documentNS != $XSLNS">
|
4092
4212
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
@@ -4112,4 +4232,21 @@
|
|
4112
4232
|
</xsl:otherwise>
|
4113
4233
|
</xsl:choose>
|
4114
4234
|
</xsl:attribute>
|
4235
|
+
</xsl:template><xsl:template name="add-letter-spacing">
|
4236
|
+
<xsl:param name="text"/>
|
4237
|
+
<xsl:param name="letter-spacing" select="'0.15'"/>
|
4238
|
+
<xsl:if test="string-length($text) > 0">
|
4239
|
+
<xsl:variable name="char" select="substring($text, 1, 1)"/>
|
4240
|
+
<fo:inline padding-right="{$letter-spacing}mm">
|
4241
|
+
<xsl:if test="$char = '®'">
|
4242
|
+
<xsl:attribute name="font-size">58%</xsl:attribute>
|
4243
|
+
<xsl:attribute name="baseline-shift">30%</xsl:attribute>
|
4244
|
+
</xsl:if>
|
4245
|
+
<xsl:value-of select="$char"/>
|
4246
|
+
</fo:inline>
|
4247
|
+
<xsl:call-template name="add-letter-spacing">
|
4248
|
+
<xsl:with-param name="text" select="substring($text, 2)"/>
|
4249
|
+
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
4250
|
+
</xsl:call-template>
|
4251
|
+
</xsl:if>
|
4115
4252
|
</xsl:template></xsl:stylesheet>
|
@@ -111,6 +111,10 @@
|
|
111
111
|
|
112
112
|
<xsl:call-template name="addPDFUAmeta"/>
|
113
113
|
|
114
|
+
<xsl:call-template name="addBookmarks">
|
115
|
+
<xsl:with-param name="contents" select="$contents"/>
|
116
|
+
</xsl:call-template>
|
117
|
+
|
114
118
|
<!-- =========================== -->
|
115
119
|
<!-- Cover Page -->
|
116
120
|
<fo:page-sequence master-reference="cover">
|
@@ -217,7 +221,7 @@
|
|
217
221
|
<xsl:text disable-output-escaping="yes">--></xsl:text>
|
218
222
|
</xsl:if>
|
219
223
|
|
220
|
-
<xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
224
|
+
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
221
225
|
<fo:block>
|
222
226
|
<xsl:if test="@level = 1">
|
223
227
|
<xsl:attribute name="margin-top">6pt</xsl:attribute>
|
@@ -243,8 +247,8 @@
|
|
243
247
|
</fo:list-item-label>
|
244
248
|
<fo:list-item-body start-indent="body-start()">
|
245
249
|
<fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
|
246
|
-
<fo:basic-link internal-destination="{@id}" fox:alt-text="{
|
247
|
-
<xsl:apply-templates/>
|
250
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
251
|
+
<xsl:apply-templates select="title"/>
|
248
252
|
<fo:inline keep-together.within-line="always">
|
249
253
|
<fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
|
250
254
|
<fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
|
@@ -361,15 +365,21 @@
|
|
361
365
|
</xsl:variable>
|
362
366
|
|
363
367
|
<xsl:variable name="display">
|
364
|
-
<xsl:choose>
|
365
|
-
<xsl:when test="ancestor-or-self::iho:bibitem">false</xsl:when>
|
366
|
-
<xsl:when test="ancestor-or-self::iho:term">false</xsl:when>
|
368
|
+
<xsl:choose>
|
367
369
|
<xsl:when test="$level <= 2">true</xsl:when>
|
368
370
|
<xsl:otherwise>false</xsl:otherwise>
|
369
371
|
</xsl:choose>
|
370
372
|
</xsl:variable>
|
371
373
|
|
372
|
-
<xsl:
|
374
|
+
<xsl:variable name="skip">
|
375
|
+
<xsl:choose>
|
376
|
+
<xsl:when test="ancestor-or-self::iho:bibitem">true</xsl:when>
|
377
|
+
<xsl:when test="ancestor-or-self::iho:term">true</xsl:when>
|
378
|
+
<xsl:otherwise>false</xsl:otherwise>
|
379
|
+
</xsl:choose>
|
380
|
+
</xsl:variable>
|
381
|
+
|
382
|
+
<xsl:if test="$skip = 'false'">
|
373
383
|
|
374
384
|
<xsl:variable name="section">
|
375
385
|
<xsl:call-template name="getSection"/>
|
@@ -388,10 +398,13 @@
|
|
388
398
|
<xsl:if test="ancestor-or-self::iho:annex">annex</xsl:if>
|
389
399
|
</xsl:variable>
|
390
400
|
|
391
|
-
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}">
|
392
|
-
<
|
401
|
+
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
|
402
|
+
<title>
|
403
|
+
<xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
|
404
|
+
</title>
|
405
|
+
<xsl:apply-templates mode="contents"/>
|
393
406
|
</item>
|
394
|
-
|
407
|
+
|
395
408
|
</xsl:if>
|
396
409
|
|
397
410
|
</xsl:template>
|
@@ -954,6 +967,12 @@
|
|
954
967
|
|
955
968
|
</title-edition>
|
956
969
|
|
970
|
+
<title-edition lang="fr">
|
971
|
+
|
972
|
+
<xsl:text>Édition </xsl:text>
|
973
|
+
|
974
|
+
</title-edition>
|
975
|
+
|
957
976
|
|
958
977
|
<title-toc lang="en">
|
959
978
|
|
@@ -1062,7 +1081,9 @@
|
|
1062
1081
|
<xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
|
1063
1082
|
</xsl:otherwise>
|
1064
1083
|
</xsl:choose>
|
1065
|
-
</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="'
'"/><xsl:attribute-set name="
|
1084
|
+
</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="'
'"/><xsl:attribute-set name="root-style">
|
1085
|
+
|
1086
|
+
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1066
1087
|
|
1067
1088
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1068
1089
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
@@ -3008,12 +3029,101 @@
|
|
3008
3029
|
|
3009
3030
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3010
3031
|
</fo:block>
|
3011
|
-
</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">
|
3032
|
+
</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">
|
3012
3033
|
<xsl:apply-templates mode="contents"/>
|
3013
3034
|
<xsl:text> </xsl:text>
|
3014
|
-
</xsl:template><xsl:template match="
|
3035
|
+
</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">
|
3036
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3037
|
+
<xsl:text> </xsl:text>
|
3038
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3015
3039
|
<xsl:value-of select="."/>
|
3016
|
-
</xsl:template><xsl:template match="*[local-name() = '
|
3040
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3041
|
+
<xsl:value-of select="."/>
|
3042
|
+
</xsl:template><xsl:template match="node()" mode="contents">
|
3043
|
+
<xsl:apply-templates mode="contents"/>
|
3044
|
+
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3045
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3046
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3047
|
+
<xsl:apply-templates select="."/>
|
3048
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3049
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3050
|
+
</xsl:template><xsl:template name="addBookmarks">
|
3051
|
+
<xsl:param name="contents"/>
|
3052
|
+
<xsl:if test="xalan:nodeset($contents)//item">
|
3053
|
+
<fo:bookmark-tree>
|
3054
|
+
<xsl:choose>
|
3055
|
+
<xsl:when test="xalan:nodeset($contents)/doc">
|
3056
|
+
<xsl:choose>
|
3057
|
+
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
3058
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3059
|
+
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
3060
|
+
<fo:bookmark-title>
|
3061
|
+
<xsl:variable name="bookmark-title_">
|
3062
|
+
<xsl:choose>
|
3063
|
+
<xsl:when test="@lang = 'en'">
|
3064
|
+
|
3065
|
+
|
3066
|
+
</xsl:when>
|
3067
|
+
<xsl:when test="@lang = 'fr'">
|
3068
|
+
|
3069
|
+
|
3070
|
+
</xsl:when>
|
3071
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
3072
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
3073
|
+
</xsl:choose>
|
3074
|
+
</xsl:variable>
|
3075
|
+
<xsl:choose>
|
3076
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
3077
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
3078
|
+
</xsl:when>
|
3079
|
+
<xsl:otherwise>
|
3080
|
+
<xsl:choose>
|
3081
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
3082
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
3083
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
3084
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
3085
|
+
</xsl:choose>
|
3086
|
+
</xsl:otherwise>
|
3087
|
+
</xsl:choose>
|
3088
|
+
</fo:bookmark-title>
|
3089
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3090
|
+
</fo:bookmark>
|
3091
|
+
|
3092
|
+
</xsl:for-each>
|
3093
|
+
</xsl:when>
|
3094
|
+
<xsl:otherwise>
|
3095
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3096
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3097
|
+
</xsl:for-each>
|
3098
|
+
</xsl:otherwise>
|
3099
|
+
</xsl:choose>
|
3100
|
+
</xsl:when>
|
3101
|
+
<xsl:otherwise>
|
3102
|
+
<xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
|
3103
|
+
</xsl:otherwise>
|
3104
|
+
</xsl:choose>
|
3105
|
+
|
3106
|
+
|
3107
|
+
|
3108
|
+
|
3109
|
+
|
3110
|
+
|
3111
|
+
|
3112
|
+
|
3113
|
+
</fo:bookmark-tree>
|
3114
|
+
</xsl:if>
|
3115
|
+
</xsl:template><xsl:template match="item" mode="bookmark">
|
3116
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
3117
|
+
<fo:bookmark-title>
|
3118
|
+
<xsl:if test="@section != ''">
|
3119
|
+
<xsl:value-of select="@section"/>
|
3120
|
+
<xsl:text> </xsl:text>
|
3121
|
+
</xsl:if>
|
3122
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3123
|
+
</fo:bookmark-title>
|
3124
|
+
<xsl:apply-templates mode="bookmark"/>
|
3125
|
+
</fo:bookmark>
|
3126
|
+
</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">
|
3017
3127
|
<xsl:if test="normalize-space() != ''">
|
3018
3128
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
3019
3129
|
|
@@ -3071,7 +3181,7 @@
|
|
3071
3181
|
<xsl:apply-templates/>
|
3072
3182
|
</xsl:otherwise>
|
3073
3183
|
</xsl:choose>
|
3074
|
-
</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">
|
3184
|
+
</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">
|
3075
3185
|
<xsl:text> </xsl:text>
|
3076
3186
|
</xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
3077
3187
|
<xsl:copy>
|
@@ -3677,20 +3787,29 @@
|
|
3677
3787
|
<!-- 0xA0 to space replacement -->
|
3678
3788
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
3679
3789
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
3680
|
-
<
|
3681
|
-
<xsl:
|
3682
|
-
<
|
3683
|
-
<xsl:
|
3684
|
-
<xsl:
|
3685
|
-
|
3686
|
-
|
3687
|
-
|
3688
|
-
|
3689
|
-
|
3690
|
-
|
3691
|
-
|
3692
|
-
|
3693
|
-
|
3790
|
+
<xsl:choose>
|
3791
|
+
<xsl:when test="parent::*[local-name() = 'note']">
|
3792
|
+
<fo:block-container>
|
3793
|
+
<xsl:attribute name="margin-left">
|
3794
|
+
<xsl:choose>
|
3795
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
3796
|
+
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
3797
|
+
</xsl:choose>
|
3798
|
+
</xsl:attribute>
|
3799
|
+
|
3800
|
+
<fo:block-container margin-left="0mm">
|
3801
|
+
<fo:block>
|
3802
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
3803
|
+
</fo:block>
|
3804
|
+
</fo:block-container>
|
3805
|
+
</fo:block-container>
|
3806
|
+
</xsl:when>
|
3807
|
+
<xsl:otherwise>
|
3808
|
+
<fo:block>
|
3809
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
3810
|
+
</fo:block>
|
3811
|
+
</xsl:otherwise>
|
3812
|
+
</xsl:choose>
|
3694
3813
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
3695
3814
|
<!-- <row>
|
3696
3815
|
<date>05-07-2013</date>
|
@@ -4087,6 +4206,7 @@
|
|
4087
4206
|
|
4088
4207
|
|
4089
4208
|
|
4209
|
+
|
4090
4210
|
</xsl:variable>
|
4091
4211
|
<xsl:if test="$documentNS != $XSLNS">
|
4092
4212
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
@@ -4112,4 +4232,21 @@
|
|
4112
4232
|
</xsl:otherwise>
|
4113
4233
|
</xsl:choose>
|
4114
4234
|
</xsl:attribute>
|
4235
|
+
</xsl:template><xsl:template name="add-letter-spacing">
|
4236
|
+
<xsl:param name="text"/>
|
4237
|
+
<xsl:param name="letter-spacing" select="'0.15'"/>
|
4238
|
+
<xsl:if test="string-length($text) > 0">
|
4239
|
+
<xsl:variable name="char" select="substring($text, 1, 1)"/>
|
4240
|
+
<fo:inline padding-right="{$letter-spacing}mm">
|
4241
|
+
<xsl:if test="$char = '®'">
|
4242
|
+
<xsl:attribute name="font-size">58%</xsl:attribute>
|
4243
|
+
<xsl:attribute name="baseline-shift">30%</xsl:attribute>
|
4244
|
+
</xsl:if>
|
4245
|
+
<xsl:value-of select="$char"/>
|
4246
|
+
</fo:inline>
|
4247
|
+
<xsl:call-template name="add-letter-spacing">
|
4248
|
+
<xsl:with-param name="text" select="substring($text, 2)"/>
|
4249
|
+
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
4250
|
+
</xsl:call-template>
|
4251
|
+
</xsl:if>
|
4115
4252
|
</xsl:template></xsl:stylesheet>
|
data/lib/isodoc/iho/xref.rb
CHANGED
@@ -15,7 +15,7 @@ module IsoDoc
|
|
15
15
|
@labels["appendix"] : @labels["annex"]
|
16
16
|
@anchors[clause["id"]] =
|
17
17
|
{ label: annex_name_lbl(clause, num), type: "clause",
|
18
|
-
xref: "#{lbl} #{num}", level: 1 }
|
18
|
+
xref: "#{lbl} #{num}", level: 1, value: lbl }
|
19
19
|
if a = single_annex_special_section(clause)
|
20
20
|
annex_names1(a, "#{num}", 1)
|
21
21
|
else
|
data/metanorma-iho.gemspec
CHANGED
@@ -27,9 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
28
28
|
|
29
29
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
30
|
-
spec.add_dependency "metanorma-standoc", "~> 1.5.0"
|
31
30
|
spec.add_dependency "isodoc", "~> 1.2.0"
|
32
|
-
spec.add_dependency 'metanorma-generic', '~> 1.
|
31
|
+
spec.add_dependency 'metanorma-generic', '~> 1.7.0'
|
33
32
|
|
34
33
|
spec.add_development_dependency "byebug", "~> 9.1"
|
35
34
|
spec.add_development_dependency "sassc", "2.4.0"
|
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.2.
|
4
|
+
version: 0.2.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
|
+
date: 2020-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.3.4
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: metanorma-standoc
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.5.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.5.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: isodoc
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +44,14 @@ dependencies:
|
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
47
|
+
version: 1.7.0
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
54
|
+
version: 1.7.0
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: byebug
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|