metanorma-iho 0.2.6 → 0.2.7

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: a0c2a686f87ad955be0535dc3f7dcf731a6dbe3ff9cc9e19590e9f405cae388a
4
- data.tar.gz: aef7a3c731c28b32b6f7e31e9b21f8f4991bfb85f69da21f2cccf2a41d478d28
3
+ metadata.gz: 326df847e98d1f1930b6018faadc68478e3e5067c1db20ed1dc65e8d6495be26
4
+ data.tar.gz: 38541be83ac036ec00baf1e7920757b69c8a87a48b504af8ff69fb22bb0c6e1e
5
5
  SHA512:
6
- metadata.gz: 89cc2a1a41714537930fabb066aa4ad205cf5d0ee0bab66d8ced8fd23b7c3b8f8cabecc1c9e388e32e97ce73c507c8b21445e715ba388849c08c736dd29acf3b
7
- data.tar.gz: e719eabc24d5dbc2f4fdf5b9fd9679d2edaa661c3b2e3764e0a4b4e702daaee352add08c27d9708d28412816c184b78658fa5b0e9f0dad2eac7ae7c297f407a6
6
+ metadata.gz: 0e753f2f4b3cac28f5a429f2231dc91fc54915f067a9f4be6959e701c50dbe360c8ebfb9d96832154365068fa647d8e3a0c83e1a2349d6f62ef558847ffc272c
7
+ data.tar.gz: 1aa3d3a11f9e85f48f4b992787f034a8392d05f06fa76bacb953d7dfa310b6990fa64ed6d53ca52ee06e841836ff7d35d001276fe374ad2700ffd62ea5d7deda
@@ -4,7 +4,8 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master ]
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
8
9
  pull_request:
9
10
 
10
11
  jobs:
@@ -31,32 +32,35 @@ jobs:
31
32
  steps:
32
33
  - uses: actions/checkout@master
33
34
 
34
- - name: Use Ruby
35
- uses: ruby/setup-ruby@v1
35
+ - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
- bundler-cache: true
39
38
 
40
- - name: Update gems
41
- run: bundle install --jobs 4 --retry 3
39
+ - uses: actions/cache@v1
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
42
48
 
43
- - name: Install PlantUML Ubuntu
49
+ - name: install plantuml ubuntu
44
50
  if: matrix.os == 'ubuntu-latest'
45
51
  uses: nick-invision/retry@v1
46
52
  with:
47
53
  polling_interval_seconds: 5
48
54
  timeout_minutes: 5
49
55
  max_attempts: 3
50
- command: sudo apt-get update -y && sudo bash -c "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
56
+ command: >
57
+ sudo apt-get update -y && sudo bash -c
58
+ "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
51
59
 
52
- - name: Install PlantUML macOS
53
- if: matrix.os == 'macos-latest'
60
+ - if: matrix.os == 'macos-latest'
54
61
  run: brew install plantuml
55
62
 
56
- - name: Install PlantUML Windows
57
- if: matrix.os == 'windows-latest'
58
- run: |
59
- cinst -y plantuml
63
+ - if: matrix.os == 'windows-latest'
64
+ run: cinst -y plantuml
60
65
 
61
- - name: Run specs
62
- run: bundle exec rake
66
+ - run: bundle exec rake
@@ -1,13 +1,15 @@
1
1
  = metanorma-iho: Metanorma for IHO
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-iho.svg["Gem Version", link="https://rubygems.org/gems/metanorma-iho"]
4
+ image:https://github.com/metanorma/metanorma-iso/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-iso/actions?workflow=rake"]
4
5
  image:https://codeclimate.com/github/metanorma/metanorma-iho/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-iho"]
5
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-iho.svg["Pull Requests", link="https://github.com/metanorma/metanorma-iho/pulls"]
6
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-iho/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-iho/releases"]
7
8
 
8
9
  == Functionality
9
10
 
10
- This gem processes Metanorma input for generating IHO documents.
11
+ This gem processes https://www.metanorma.com[Metanorma documents] following
12
+ a template for generating IHO standards.
11
13
 
12
14
  The implementation inherits from https://github.com/metanorma/metanorma-standoc.
13
15
 
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -141,6 +149,11 @@
141
149
  <data type="boolean"/>
142
150
  </attribute>
143
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
144
157
  <oneOrMore>
145
158
  <ref name="dt"/>
146
159
  <ref name="dd"/>
@@ -1006,13 +1006,22 @@
1006
1006
  <title-part lang="en">
1007
1007
 
1008
1008
 
1009
+
1009
1010
  </title-part>
1010
1011
  <title-part lang="fr">
1011
1012
 
1012
1013
 
1014
+
1013
1015
  </title-part>
1014
1016
  <title-part lang="zh">第 # 部分:</title-part>
1015
1017
 
1018
+ <title-subpart lang="en">
1019
+
1020
+ </title-subpart>
1021
+ <title-subpart lang="fr">
1022
+
1023
+ </title-subpart>
1024
+
1016
1025
  <title-modified lang="en">modified</title-modified>
1017
1026
  <title-modified lang="fr">modifiée</title-modified>
1018
1027
 
@@ -1486,7 +1495,9 @@
1486
1495
 
1487
1496
 
1488
1497
 
1489
-
1498
+ <!-- <xsl:if test="$namespace = 'bipm'">
1499
+ <fo:block>&#xA0;</fo:block>
1500
+ </xsl:if> -->
1490
1501
 
1491
1502
  <!-- $namespace = 'iso' or -->
1492
1503
 
@@ -1656,6 +1667,7 @@
1656
1667
  <xsl:if test="normalize-space() != ''">
1657
1668
  <fo:block xsl:use-attribute-sets="table-name-style">
1658
1669
 
1670
+
1659
1671
  <xsl:apply-templates/>
1660
1672
  </fo:block>
1661
1673
  </xsl:if>
@@ -2009,6 +2021,7 @@
2009
2021
 
2010
2022
 
2011
2023
 
2024
+
2012
2025
  <!-- <xsl:if test="$namespace = 'bipm'">
2013
2026
  <xsl:attribute name="height">8mm</xsl:attribute>
2014
2027
  </xsl:if> -->
@@ -2096,7 +2109,8 @@
2096
2109
  </xsl:attribute>
2097
2110
  </xsl:if>
2098
2111
  <xsl:call-template name="display-align"/>
2099
- <fo:block>
2112
+ <fo:block>
2113
+
2100
2114
  <xsl:apply-templates/>
2101
2115
  </fo:block>
2102
2116
  </fo:table-cell>
@@ -2313,7 +2327,11 @@
2313
2327
  <xsl:apply-templates/>
2314
2328
  </fo:inline>
2315
2329
  </xsl:template><xsl:template match="*[local-name()='dl']">
2316
- <fo:block-container margin-left="0mm">
2330
+ <fo:block-container>
2331
+
2332
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2333
+
2334
+
2317
2335
  <xsl:if test="parent::*[local-name() = 'note']">
2318
2336
  <xsl:attribute name="margin-left">
2319
2337
  <xsl:choose>
@@ -2323,8 +2341,11 @@
2323
2341
  </xsl:attribute>
2324
2342
 
2325
2343
  </xsl:if>
2326
- <fo:block-container margin-left="0mm">
2327
-
2344
+ <fo:block-container>
2345
+
2346
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2347
+
2348
+
2328
2349
  <xsl:variable name="parent" select="local-name(..)"/>
2329
2350
 
2330
2351
  <xsl:variable name="key_iso">
@@ -2338,9 +2359,12 @@
2338
2359
  <fo:block margin-bottom="12pt" text-align="left">
2339
2360
 
2340
2361
  <xsl:variable name="title-where">
2341
- <xsl:call-template name="getTitle">
2342
- <xsl:with-param name="name" select="'title-where'"/>
2343
- </xsl:call-template>
2362
+
2363
+
2364
+ <xsl:call-template name="getTitle">
2365
+ <xsl:with-param name="name" select="'title-where'"/>
2366
+ </xsl:call-template>
2367
+
2344
2368
  </xsl:variable>
2345
2369
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2346
2370
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2356,9 +2380,12 @@
2356
2380
 
2357
2381
 
2358
2382
  <xsl:variable name="title-where">
2359
- <xsl:call-template name="getTitle">
2360
- <xsl:with-param name="name" select="'title-where'"/>
2361
- </xsl:call-template>
2383
+
2384
+
2385
+ <xsl:call-template name="getTitle">
2386
+ <xsl:with-param name="name" select="'title-where'"/>
2387
+ </xsl:call-template>
2388
+
2362
2389
  </xsl:variable>
2363
2390
  <xsl:value-of select="$title-where"/>
2364
2391
  </fo:block>
@@ -2369,9 +2396,12 @@
2369
2396
 
2370
2397
 
2371
2398
  <xsl:variable name="title-key">
2372
- <xsl:call-template name="getTitle">
2373
- <xsl:with-param name="name" select="'title-key'"/>
2374
- </xsl:call-template>
2399
+
2400
+
2401
+ <xsl:call-template name="getTitle">
2402
+ <xsl:with-param name="name" select="'title-key'"/>
2403
+ </xsl:call-template>
2404
+
2375
2405
  </xsl:variable>
2376
2406
  <xsl:value-of select="$title-key"/>
2377
2407
  </fo:block>
@@ -2949,7 +2979,18 @@
2949
2979
  <xsl:with-param name="previousRow" select="$newRow"/>
2950
2980
  </xsl:apply-templates>
2951
2981
  </xsl:template><xsl:template name="getLang">
2952
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2982
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2983
+ <xsl:variable name="language">
2984
+ <xsl:choose>
2985
+ <xsl:when test="$language_current != ''">
2986
+ <xsl:value-of select="$language_current"/>
2987
+ </xsl:when>
2988
+ <xsl:otherwise>
2989
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2990
+ </xsl:otherwise>
2991
+ </xsl:choose>
2992
+ </xsl:variable>
2993
+
2953
2994
  <xsl:choose>
2954
2995
  <xsl:when test="$language = 'English'">en</xsl:when>
2955
2996
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2984,6 +3025,7 @@
2984
3025
  <xsl:value-of select="substring($str, 2)"/>
2985
3026
  </xsl:template><xsl:template match="mathml:math">
2986
3027
  <fo:inline font-family="STIX Two Math"> <!-- -->
3028
+
2987
3029
  <xsl:variable name="mathml">
2988
3030
  <xsl:apply-templates select="." mode="mathml"/>
2989
3031
  </xsl:variable>
@@ -3066,10 +3108,14 @@
3066
3108
  </fo:inline>
3067
3109
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3068
3110
  <xsl:variable name="title-modified">
3069
- <xsl:call-template name="getTitle">
3070
- <xsl:with-param name="name" select="'title-modified'"/>
3071
- </xsl:call-template>
3111
+
3112
+
3113
+ <xsl:call-template name="getTitle">
3114
+ <xsl:with-param name="name" select="'title-modified'"/>
3115
+ </xsl:call-template>
3116
+
3072
3117
  </xsl:variable>
3118
+
3073
3119
  <xsl:choose>
3074
3120
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3075
3121
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3798,9 +3844,14 @@
3798
3844
 
3799
3845
  <fo:inline>
3800
3846
 
3801
- <xsl:call-template name="getTitle">
3802
- <xsl:with-param name="name" select="'title-source'"/>
3803
- </xsl:call-template>
3847
+
3848
+
3849
+
3850
+ <xsl:call-template name="getTitle">
3851
+ <xsl:with-param name="name" select="'title-source'"/>
3852
+ </xsl:call-template>
3853
+
3854
+
3804
3855
  <xsl:text>: </xsl:text>
3805
3856
  </fo:inline>
3806
3857
 
@@ -3953,9 +4004,12 @@
3953
4004
  </fo:block>
3954
4005
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3955
4006
  <xsl:variable name="title-deprecated">
3956
- <xsl:call-template name="getTitle">
3957
- <xsl:with-param name="name" select="'title-deprecated'"/>
3958
- </xsl:call-template>
4007
+
4008
+
4009
+ <xsl:call-template name="getTitle">
4010
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4011
+ </xsl:call-template>
4012
+
3959
4013
  </xsl:variable>
3960
4014
  <fo:block xsl:use-attribute-sets="deprecates-style">
3961
4015
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4417,13 +4471,22 @@
4417
4471
  </xsl:template><xsl:template name="split">
4418
4472
  <xsl:param name="pText" select="."/>
4419
4473
  <xsl:param name="sep" select="','"/>
4474
+ <xsl:param name="normalize-space" select="'true'"/>
4420
4475
  <xsl:if test="string-length($pText) &gt;0">
4421
4476
  <item>
4422
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4477
+ <xsl:choose>
4478
+ <xsl:when test="$normalize-space = 'true'">
4479
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4480
+ </xsl:when>
4481
+ <xsl:otherwise>
4482
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4483
+ </xsl:otherwise>
4484
+ </xsl:choose>
4423
4485
  </item>
4424
4486
  <xsl:call-template name="split">
4425
4487
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4426
4488
  <xsl:with-param name="sep" select="$sep"/>
4489
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4427
4490
  </xsl:call-template>
4428
4491
  </xsl:if>
4429
4492
  </xsl:template><xsl:template name="getDocumentId">
@@ -4489,4 +4552,23 @@
4489
4552
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4490
4553
  </xsl:call-template>
4491
4554
  </xsl:if>
4555
+ </xsl:template><xsl:template name="repeat">
4556
+ <xsl:param name="char" select="'*'"/>
4557
+ <xsl:param name="count"/>
4558
+ <xsl:if test="$count &gt; 0">
4559
+ <xsl:value-of select="$char"/>
4560
+ <xsl:call-template name="repeat">
4561
+ <xsl:with-param name="char" select="$char"/>
4562
+ <xsl:with-param name="count" select="$count - 1"/>
4563
+ </xsl:call-template>
4564
+ </xsl:if>
4565
+ </xsl:template><xsl:template name="getLocalizedString">
4566
+ <xsl:param name="key"/>
4567
+
4568
+ <xsl:variable name="curr_lang">
4569
+ <xsl:call-template name="getLang"/>
4570
+ </xsl:variable>
4571
+
4572
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4573
+
4492
4574
  </xsl:template></xsl:stylesheet>
@@ -1006,13 +1006,22 @@
1006
1006
  <title-part lang="en">
1007
1007
 
1008
1008
 
1009
+
1009
1010
  </title-part>
1010
1011
  <title-part lang="fr">
1011
1012
 
1012
1013
 
1014
+
1013
1015
  </title-part>
1014
1016
  <title-part lang="zh">第 # 部分:</title-part>
1015
1017
 
1018
+ <title-subpart lang="en">
1019
+
1020
+ </title-subpart>
1021
+ <title-subpart lang="fr">
1022
+
1023
+ </title-subpart>
1024
+
1016
1025
  <title-modified lang="en">modified</title-modified>
1017
1026
  <title-modified lang="fr">modifiée</title-modified>
1018
1027
 
@@ -1486,7 +1495,9 @@
1486
1495
 
1487
1496
 
1488
1497
 
1489
-
1498
+ <!-- <xsl:if test="$namespace = 'bipm'">
1499
+ <fo:block>&#xA0;</fo:block>
1500
+ </xsl:if> -->
1490
1501
 
1491
1502
  <!-- $namespace = 'iso' or -->
1492
1503
 
@@ -1656,6 +1667,7 @@
1656
1667
  <xsl:if test="normalize-space() != ''">
1657
1668
  <fo:block xsl:use-attribute-sets="table-name-style">
1658
1669
 
1670
+
1659
1671
  <xsl:apply-templates/>
1660
1672
  </fo:block>
1661
1673
  </xsl:if>
@@ -2009,6 +2021,7 @@
2009
2021
 
2010
2022
 
2011
2023
 
2024
+
2012
2025
  <!-- <xsl:if test="$namespace = 'bipm'">
2013
2026
  <xsl:attribute name="height">8mm</xsl:attribute>
2014
2027
  </xsl:if> -->
@@ -2096,7 +2109,8 @@
2096
2109
  </xsl:attribute>
2097
2110
  </xsl:if>
2098
2111
  <xsl:call-template name="display-align"/>
2099
- <fo:block>
2112
+ <fo:block>
2113
+
2100
2114
  <xsl:apply-templates/>
2101
2115
  </fo:block>
2102
2116
  </fo:table-cell>
@@ -2313,7 +2327,11 @@
2313
2327
  <xsl:apply-templates/>
2314
2328
  </fo:inline>
2315
2329
  </xsl:template><xsl:template match="*[local-name()='dl']">
2316
- <fo:block-container margin-left="0mm">
2330
+ <fo:block-container>
2331
+
2332
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2333
+
2334
+
2317
2335
  <xsl:if test="parent::*[local-name() = 'note']">
2318
2336
  <xsl:attribute name="margin-left">
2319
2337
  <xsl:choose>
@@ -2323,8 +2341,11 @@
2323
2341
  </xsl:attribute>
2324
2342
 
2325
2343
  </xsl:if>
2326
- <fo:block-container margin-left="0mm">
2327
-
2344
+ <fo:block-container>
2345
+
2346
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2347
+
2348
+
2328
2349
  <xsl:variable name="parent" select="local-name(..)"/>
2329
2350
 
2330
2351
  <xsl:variable name="key_iso">
@@ -2338,9 +2359,12 @@
2338
2359
  <fo:block margin-bottom="12pt" text-align="left">
2339
2360
 
2340
2361
  <xsl:variable name="title-where">
2341
- <xsl:call-template name="getTitle">
2342
- <xsl:with-param name="name" select="'title-where'"/>
2343
- </xsl:call-template>
2362
+
2363
+
2364
+ <xsl:call-template name="getTitle">
2365
+ <xsl:with-param name="name" select="'title-where'"/>
2366
+ </xsl:call-template>
2367
+
2344
2368
  </xsl:variable>
2345
2369
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2346
2370
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2356,9 +2380,12 @@
2356
2380
 
2357
2381
 
2358
2382
  <xsl:variable name="title-where">
2359
- <xsl:call-template name="getTitle">
2360
- <xsl:with-param name="name" select="'title-where'"/>
2361
- </xsl:call-template>
2383
+
2384
+
2385
+ <xsl:call-template name="getTitle">
2386
+ <xsl:with-param name="name" select="'title-where'"/>
2387
+ </xsl:call-template>
2388
+
2362
2389
  </xsl:variable>
2363
2390
  <xsl:value-of select="$title-where"/>
2364
2391
  </fo:block>
@@ -2369,9 +2396,12 @@
2369
2396
 
2370
2397
 
2371
2398
  <xsl:variable name="title-key">
2372
- <xsl:call-template name="getTitle">
2373
- <xsl:with-param name="name" select="'title-key'"/>
2374
- </xsl:call-template>
2399
+
2400
+
2401
+ <xsl:call-template name="getTitle">
2402
+ <xsl:with-param name="name" select="'title-key'"/>
2403
+ </xsl:call-template>
2404
+
2375
2405
  </xsl:variable>
2376
2406
  <xsl:value-of select="$title-key"/>
2377
2407
  </fo:block>
@@ -2949,7 +2979,18 @@
2949
2979
  <xsl:with-param name="previousRow" select="$newRow"/>
2950
2980
  </xsl:apply-templates>
2951
2981
  </xsl:template><xsl:template name="getLang">
2952
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2982
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2983
+ <xsl:variable name="language">
2984
+ <xsl:choose>
2985
+ <xsl:when test="$language_current != ''">
2986
+ <xsl:value-of select="$language_current"/>
2987
+ </xsl:when>
2988
+ <xsl:otherwise>
2989
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2990
+ </xsl:otherwise>
2991
+ </xsl:choose>
2992
+ </xsl:variable>
2993
+
2953
2994
  <xsl:choose>
2954
2995
  <xsl:when test="$language = 'English'">en</xsl:when>
2955
2996
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2984,6 +3025,7 @@
2984
3025
  <xsl:value-of select="substring($str, 2)"/>
2985
3026
  </xsl:template><xsl:template match="mathml:math">
2986
3027
  <fo:inline font-family="STIX Two Math"> <!-- -->
3028
+
2987
3029
  <xsl:variable name="mathml">
2988
3030
  <xsl:apply-templates select="." mode="mathml"/>
2989
3031
  </xsl:variable>
@@ -3066,10 +3108,14 @@
3066
3108
  </fo:inline>
3067
3109
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3068
3110
  <xsl:variable name="title-modified">
3069
- <xsl:call-template name="getTitle">
3070
- <xsl:with-param name="name" select="'title-modified'"/>
3071
- </xsl:call-template>
3111
+
3112
+
3113
+ <xsl:call-template name="getTitle">
3114
+ <xsl:with-param name="name" select="'title-modified'"/>
3115
+ </xsl:call-template>
3116
+
3072
3117
  </xsl:variable>
3118
+
3073
3119
  <xsl:choose>
3074
3120
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3075
3121
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3798,9 +3844,14 @@
3798
3844
 
3799
3845
  <fo:inline>
3800
3846
 
3801
- <xsl:call-template name="getTitle">
3802
- <xsl:with-param name="name" select="'title-source'"/>
3803
- </xsl:call-template>
3847
+
3848
+
3849
+
3850
+ <xsl:call-template name="getTitle">
3851
+ <xsl:with-param name="name" select="'title-source'"/>
3852
+ </xsl:call-template>
3853
+
3854
+
3804
3855
  <xsl:text>: </xsl:text>
3805
3856
  </fo:inline>
3806
3857
 
@@ -3953,9 +4004,12 @@
3953
4004
  </fo:block>
3954
4005
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3955
4006
  <xsl:variable name="title-deprecated">
3956
- <xsl:call-template name="getTitle">
3957
- <xsl:with-param name="name" select="'title-deprecated'"/>
3958
- </xsl:call-template>
4007
+
4008
+
4009
+ <xsl:call-template name="getTitle">
4010
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4011
+ </xsl:call-template>
4012
+
3959
4013
  </xsl:variable>
3960
4014
  <fo:block xsl:use-attribute-sets="deprecates-style">
3961
4015
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4417,13 +4471,22 @@
4417
4471
  </xsl:template><xsl:template name="split">
4418
4472
  <xsl:param name="pText" select="."/>
4419
4473
  <xsl:param name="sep" select="','"/>
4474
+ <xsl:param name="normalize-space" select="'true'"/>
4420
4475
  <xsl:if test="string-length($pText) &gt;0">
4421
4476
  <item>
4422
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4477
+ <xsl:choose>
4478
+ <xsl:when test="$normalize-space = 'true'">
4479
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4480
+ </xsl:when>
4481
+ <xsl:otherwise>
4482
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4483
+ </xsl:otherwise>
4484
+ </xsl:choose>
4423
4485
  </item>
4424
4486
  <xsl:call-template name="split">
4425
4487
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4426
4488
  <xsl:with-param name="sep" select="$sep"/>
4489
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4427
4490
  </xsl:call-template>
4428
4491
  </xsl:if>
4429
4492
  </xsl:template><xsl:template name="getDocumentId">
@@ -4489,4 +4552,23 @@
4489
4552
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4490
4553
  </xsl:call-template>
4491
4554
  </xsl:if>
4555
+ </xsl:template><xsl:template name="repeat">
4556
+ <xsl:param name="char" select="'*'"/>
4557
+ <xsl:param name="count"/>
4558
+ <xsl:if test="$count &gt; 0">
4559
+ <xsl:value-of select="$char"/>
4560
+ <xsl:call-template name="repeat">
4561
+ <xsl:with-param name="char" select="$char"/>
4562
+ <xsl:with-param name="count" select="$count - 1"/>
4563
+ </xsl:call-template>
4564
+ </xsl:if>
4565
+ </xsl:template><xsl:template name="getLocalizedString">
4566
+ <xsl:param name="key"/>
4567
+
4568
+ <xsl:variable name="curr_lang">
4569
+ <xsl:call-template name="getLang"/>
4570
+ </xsl:variable>
4571
+
4572
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4573
+
4492
4574
  </xsl:template></xsl:stylesheet>
@@ -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, value: lbl }
18
+ xref: l10n("#{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
@@ -43,7 +43,7 @@ module IsoDoc
43
43
  lbl = clause.at("./ancestor::xmlns:annex/@obligation").
44
44
  text == "informative" ? @labels["appendix"] : @labels["annex"]
45
45
  @anchors[clause["id"]] =
46
- { label: num, xref: "#{lbl} #{num}",
46
+ { label: num, xref: l10n("#{lbl} #{num}"),
47
47
  level: level, type: "clause" }
48
48
  clause.xpath(ns("./clause | ./references | ./terms | ./definitions")).
49
49
  each_with_index do |c, i|
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.2.6"
3
+ VERSION = "0.2.7"
4
4
  end
5
5
  end
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.6
4
+ version: 0.2.7
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-10-25 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities