metanorma-iho 0.2.9 → 0.2.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: 69c27cc6a8527a59360a770e49deea1fe9f0a6872066e78deabebb782340093d
4
- data.tar.gz: 9365b1d5ee9e87e3686b23578e23eddecd7753892d195ea2fafee9c8ae224112
3
+ metadata.gz: 87a39f4abb7c7aaab9bbe561734faa2c3d70f8393b3f8504a615c64f2a0db67f
4
+ data.tar.gz: f0421c67957d2598f3a944a648185c1ae2379578867f89890ab24517e7c53feb
5
5
  SHA512:
6
- metadata.gz: 9de8fea2a2b6298a624936452844dbda153f0c1c28fe36a71350770dbdbafde7e1fbe47e289c95bf7e4bdca6ea3e98b920927af68d760e3c661c9a6fbc9cef9e
7
- data.tar.gz: 3c108832d1c736ba8b50ce07c1aa155e134ddffba55c19af31189ecb2ded9d5c5ae35c8b89661779b85d3f74b168da15f8d0a683060876107f20f6de3ee788cb
6
+ metadata.gz: b8c7854a188f356f8e8c187e1ac6d3e3e8ba10b34c2e3acc69c85af6d0542cfe366958ce068d2ecf2a6bd72f95cb0ea9c1e9c886cfc8edc5302dbaf5db135073
7
+ data.tar.gz: db18b490b4d9b8d8a6d9401064488bda9d0cc6f47e854c356bb05eb7f4db48e3f1d0633cac7479f7898b04031ea8048b11f3dfcafbafab2980894ef2c2bf8dd3
@@ -729,12 +729,27 @@
729
729
  </define>
730
730
  <define name="index">
731
731
  <element name="index">
732
- <attribute name="primary"/>
732
+ <attribute name="to">
733
+ <data type="IDREF"/>
734
+ </attribute>
735
+ <element name="primary">
736
+ <oneOrMore>
737
+ <ref name="PureTextElement"/>
738
+ </oneOrMore>
739
+ </element>
733
740
  <optional>
734
- <attribute name="secondary"/>
741
+ <element name="secondary">
742
+ <oneOrMore>
743
+ <ref name="PureTextElement"/>
744
+ </oneOrMore>
745
+ </element>
735
746
  </optional>
736
747
  <optional>
737
- <attribute name="tertiary"/>
748
+ <element name="tertiary">
749
+ <oneOrMore>
750
+ <ref name="PureTextElement"/>
751
+ </oneOrMore>
752
+ </element>
738
753
  </optional>
739
754
  </element>
740
755
  </define>
@@ -55,6 +55,13 @@
55
55
  <param name="pattern">\i\c*|\c+#\c+</param>
56
56
  </data>
57
57
  </attribute>
58
+ <optional>
59
+ <attribute name="to">
60
+ <data type="string">
61
+ <param name="pattern">\i\c*|\c+#\c+</param>
62
+ </data>
63
+ </attribute>
64
+ </optional>
58
65
  <optional>
59
66
  <attribute name="type">
60
67
  <ref name="ReferenceFormat"/>
@@ -1336,6 +1336,7 @@
1336
1336
 
1337
1337
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1338
1338
 
1339
+
1339
1340
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1340
1341
 
1341
1342
 
@@ -2362,7 +2363,9 @@
2362
2363
  </xsl:template><xsl:template match="*[local-name()='dl']">
2363
2364
  <fo:block-container>
2364
2365
 
2365
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2366
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2367
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2368
+ </xsl:if>
2366
2369
 
2367
2370
 
2368
2371
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2377,6 +2380,7 @@
2377
2380
  <fo:block-container>
2378
2381
 
2379
2382
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2383
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2380
2384
 
2381
2385
 
2382
2386
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2564,12 +2568,32 @@
2564
2568
  </xsl:otherwise>
2565
2569
  </xsl:choose>
2566
2570
  </xsl:template><xsl:template name="getMaxLength_dt">
2567
- <xsl:for-each select="*[local-name()='dt']">
2568
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2569
- <xsl:if test="position() = 1">
2570
- <xsl:value-of select="string-length(normalize-space(.))"/>
2571
- </xsl:if>
2572
- </xsl:for-each>
2571
+ <xsl:variable name="lengths">
2572
+ <xsl:for-each select="*[local-name()='dt']">
2573
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2574
+ <xsl:variable name="attributes">
2575
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2576
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2577
+ </xsl:variable>
2578
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2579
+ </xsl:for-each>
2580
+ </xsl:variable>
2581
+ <xsl:variable name="maxLength">
2582
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2583
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2584
+ <xsl:if test="position() = 1">
2585
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2586
+ </xsl:if>
2587
+ </xsl:for-each> -->
2588
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2589
+ <xsl:sort select="." data-type="number" order="descending"/>
2590
+ <xsl:if test="position() = 1">
2591
+ <xsl:value-of select="."/>
2592
+ </xsl:if>
2593
+ </xsl:for-each>
2594
+ </xsl:variable>
2595
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2596
+ <xsl:value-of select="$maxLength"/>
2573
2597
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2574
2598
  <xsl:param name="key_iso"/>
2575
2599
 
@@ -3373,6 +3397,8 @@
3373
3397
  <xsl:variable name="bookmark-title_">
3374
3398
  <xsl:call-template name="getLangVersion">
3375
3399
  <xsl:with-param name="lang" select="@lang"/>
3400
+ <xsl:with-param name="doctype" select="@doctype"/>
3401
+ <xsl:with-param name="title" select="@title-part"/>
3376
3402
  </xsl:call-template>
3377
3403
  </xsl:variable>
3378
3404
  <xsl:choose>
@@ -3390,13 +3416,34 @@
3390
3416
  </xsl:choose>
3391
3417
  </fo:bookmark-title>
3392
3418
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3419
+
3420
+ <xsl:call-template name="insertFigureBookmarks">
3421
+ <xsl:with-param name="contents" select="contents"/>
3422
+ </xsl:call-template>
3423
+
3424
+ <xsl:call-template name="insertTableBookmarks">
3425
+ <xsl:with-param name="contents" select="contents"/>
3426
+ <xsl:with-param name="lang" select="@lang"/>
3427
+ </xsl:call-template>
3428
+
3393
3429
  </fo:bookmark>
3394
3430
 
3395
3431
  </xsl:for-each>
3396
3432
  </xsl:when>
3397
3433
  <xsl:otherwise>
3398
3434
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3435
+
3399
3436
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3437
+
3438
+ <xsl:call-template name="insertFigureBookmarks">
3439
+ <xsl:with-param name="contents" select="contents"/>
3440
+ </xsl:call-template>
3441
+
3442
+ <xsl:call-template name="insertTableBookmarks">
3443
+ <xsl:with-param name="contents" select="contents"/>
3444
+ <xsl:with-param name="lang" select="@lang"/>
3445
+ </xsl:call-template>
3446
+
3400
3447
  </xsl:for-each>
3401
3448
  </xsl:otherwise>
3402
3449
  </xsl:choose>
@@ -3415,8 +3462,44 @@
3415
3462
 
3416
3463
  </fo:bookmark-tree>
3417
3464
  </xsl:if>
3465
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3466
+ <xsl:param name="contents"/>
3467
+ <xsl:if test="xalan:nodeset($contents)/figure">
3468
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3469
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3470
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3471
+ <fo:bookmark internal-destination="{@id}">
3472
+ <fo:bookmark-title>
3473
+ <xsl:value-of select="normalize-space(title)"/>
3474
+ </fo:bookmark-title>
3475
+ </fo:bookmark>
3476
+ </xsl:for-each>
3477
+ </fo:bookmark>
3478
+ </xsl:if>
3479
+ </xsl:template><xsl:template name="insertTableBookmarks">
3480
+ <xsl:param name="contents"/>
3481
+ <xsl:param name="lang"/>
3482
+ <xsl:if test="xalan:nodeset($contents)/table">
3483
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3484
+ <fo:bookmark-title>
3485
+ <xsl:choose>
3486
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3487
+ <xsl:otherwise>Tables</xsl:otherwise>
3488
+ </xsl:choose>
3489
+ </fo:bookmark-title>
3490
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3491
+ <fo:bookmark internal-destination="{@id}">
3492
+ <fo:bookmark-title>
3493
+ <xsl:value-of select="normalize-space(title)"/>
3494
+ </fo:bookmark-title>
3495
+ </fo:bookmark>
3496
+ </xsl:for-each>
3497
+ </fo:bookmark>
3498
+ </xsl:if>
3418
3499
  </xsl:template><xsl:template name="getLangVersion">
3419
3500
  <xsl:param name="lang"/>
3501
+ <xsl:param name="doctype" select="''"/>
3502
+ <xsl:param name="title" select="''"/>
3420
3503
  <xsl:choose>
3421
3504
  <xsl:when test="$lang = 'en'">
3422
3505
 
@@ -3912,7 +3995,8 @@
3912
3995
  <fo:block-container margin-left="0mm">
3913
3996
 
3914
3997
  <fo:block xsl:use-attribute-sets="quote-style">
3915
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3998
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3999
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3916
4000
  </fo:block>
3917
4001
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3918
4002
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -1336,6 +1336,7 @@
1336
1336
 
1337
1337
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1338
1338
 
1339
+
1339
1340
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1340
1341
 
1341
1342
 
@@ -2362,7 +2363,9 @@
2362
2363
  </xsl:template><xsl:template match="*[local-name()='dl']">
2363
2364
  <fo:block-container>
2364
2365
 
2365
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2366
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2367
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2368
+ </xsl:if>
2366
2369
 
2367
2370
 
2368
2371
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2377,6 +2380,7 @@
2377
2380
  <fo:block-container>
2378
2381
 
2379
2382
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2383
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2380
2384
 
2381
2385
 
2382
2386
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2564,12 +2568,32 @@
2564
2568
  </xsl:otherwise>
2565
2569
  </xsl:choose>
2566
2570
  </xsl:template><xsl:template name="getMaxLength_dt">
2567
- <xsl:for-each select="*[local-name()='dt']">
2568
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2569
- <xsl:if test="position() = 1">
2570
- <xsl:value-of select="string-length(normalize-space(.))"/>
2571
- </xsl:if>
2572
- </xsl:for-each>
2571
+ <xsl:variable name="lengths">
2572
+ <xsl:for-each select="*[local-name()='dt']">
2573
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2574
+ <xsl:variable name="attributes">
2575
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2576
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2577
+ </xsl:variable>
2578
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2579
+ </xsl:for-each>
2580
+ </xsl:variable>
2581
+ <xsl:variable name="maxLength">
2582
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2583
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2584
+ <xsl:if test="position() = 1">
2585
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2586
+ </xsl:if>
2587
+ </xsl:for-each> -->
2588
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2589
+ <xsl:sort select="." data-type="number" order="descending"/>
2590
+ <xsl:if test="position() = 1">
2591
+ <xsl:value-of select="."/>
2592
+ </xsl:if>
2593
+ </xsl:for-each>
2594
+ </xsl:variable>
2595
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2596
+ <xsl:value-of select="$maxLength"/>
2573
2597
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2574
2598
  <xsl:param name="key_iso"/>
2575
2599
 
@@ -3373,6 +3397,8 @@
3373
3397
  <xsl:variable name="bookmark-title_">
3374
3398
  <xsl:call-template name="getLangVersion">
3375
3399
  <xsl:with-param name="lang" select="@lang"/>
3400
+ <xsl:with-param name="doctype" select="@doctype"/>
3401
+ <xsl:with-param name="title" select="@title-part"/>
3376
3402
  </xsl:call-template>
3377
3403
  </xsl:variable>
3378
3404
  <xsl:choose>
@@ -3390,13 +3416,34 @@
3390
3416
  </xsl:choose>
3391
3417
  </fo:bookmark-title>
3392
3418
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3419
+
3420
+ <xsl:call-template name="insertFigureBookmarks">
3421
+ <xsl:with-param name="contents" select="contents"/>
3422
+ </xsl:call-template>
3423
+
3424
+ <xsl:call-template name="insertTableBookmarks">
3425
+ <xsl:with-param name="contents" select="contents"/>
3426
+ <xsl:with-param name="lang" select="@lang"/>
3427
+ </xsl:call-template>
3428
+
3393
3429
  </fo:bookmark>
3394
3430
 
3395
3431
  </xsl:for-each>
3396
3432
  </xsl:when>
3397
3433
  <xsl:otherwise>
3398
3434
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3435
+
3399
3436
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3437
+
3438
+ <xsl:call-template name="insertFigureBookmarks">
3439
+ <xsl:with-param name="contents" select="contents"/>
3440
+ </xsl:call-template>
3441
+
3442
+ <xsl:call-template name="insertTableBookmarks">
3443
+ <xsl:with-param name="contents" select="contents"/>
3444
+ <xsl:with-param name="lang" select="@lang"/>
3445
+ </xsl:call-template>
3446
+
3400
3447
  </xsl:for-each>
3401
3448
  </xsl:otherwise>
3402
3449
  </xsl:choose>
@@ -3415,8 +3462,44 @@
3415
3462
 
3416
3463
  </fo:bookmark-tree>
3417
3464
  </xsl:if>
3465
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3466
+ <xsl:param name="contents"/>
3467
+ <xsl:if test="xalan:nodeset($contents)/figure">
3468
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3469
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3470
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3471
+ <fo:bookmark internal-destination="{@id}">
3472
+ <fo:bookmark-title>
3473
+ <xsl:value-of select="normalize-space(title)"/>
3474
+ </fo:bookmark-title>
3475
+ </fo:bookmark>
3476
+ </xsl:for-each>
3477
+ </fo:bookmark>
3478
+ </xsl:if>
3479
+ </xsl:template><xsl:template name="insertTableBookmarks">
3480
+ <xsl:param name="contents"/>
3481
+ <xsl:param name="lang"/>
3482
+ <xsl:if test="xalan:nodeset($contents)/table">
3483
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3484
+ <fo:bookmark-title>
3485
+ <xsl:choose>
3486
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3487
+ <xsl:otherwise>Tables</xsl:otherwise>
3488
+ </xsl:choose>
3489
+ </fo:bookmark-title>
3490
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3491
+ <fo:bookmark internal-destination="{@id}">
3492
+ <fo:bookmark-title>
3493
+ <xsl:value-of select="normalize-space(title)"/>
3494
+ </fo:bookmark-title>
3495
+ </fo:bookmark>
3496
+ </xsl:for-each>
3497
+ </fo:bookmark>
3498
+ </xsl:if>
3418
3499
  </xsl:template><xsl:template name="getLangVersion">
3419
3500
  <xsl:param name="lang"/>
3501
+ <xsl:param name="doctype" select="''"/>
3502
+ <xsl:param name="title" select="''"/>
3420
3503
  <xsl:choose>
3421
3504
  <xsl:when test="$lang = 'en'">
3422
3505
 
@@ -3912,7 +3995,8 @@
3912
3995
  <fo:block-container margin-left="0mm">
3913
3996
 
3914
3997
  <fo:block xsl:use-attribute-sets="quote-style">
3915
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3998
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3999
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3916
4000
  </fo:block>
3917
4001
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3918
4002
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -15,6 +15,20 @@ module Metanorma
15
15
  )
16
16
  end
17
17
 
18
+ def fonts_manifest
19
+ {
20
+ "Arial" => nil,
21
+ "Cambria Math" => nil,
22
+ "Courier" => nil,
23
+ "Fira Code" => nil,
24
+ "Source Sans Pro" => [ "Light" ],
25
+ "Source Serif Pro" => nil,
26
+ "Source Code Pro" => [ "Light" ],
27
+ "Source Han Sans" => nil,
28
+ "STIX Two Math" => nil,
29
+ }
30
+ end
31
+
18
32
  def version
19
33
  "Metanorma::IHO #{Metanorma::IHO::VERSION}"
20
34
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.2.9"
3
+ VERSION = "0.2.10"
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ 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-generic', '~> 1.8.0'
30
+ spec.add_dependency 'metanorma-generic', '~> 1.8.1'
31
31
 
32
32
  spec.add_development_dependency "byebug", "~> 9.1"
33
33
  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.9
4
+ version: 0.2.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: 2020-12-14 00:00:00.000000000 Z
11
+ date: 2020-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.8.0
33
+ version: 1.8.1
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.8.0
40
+ version: 1.8.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -235,7 +235,6 @@ files:
235
235
  - lib/isodoc/iho/xref.rb
236
236
  - lib/metanorma-iho.rb
237
237
  - lib/metanorma/iho.rb
238
- - lib/metanorma/iho/fonts_manifest.yaml
239
238
  - lib/metanorma/iho/processor.rb
240
239
  - lib/metanorma/iho/version.rb
241
240
  - metanorma-iho.gemspec
@@ -1,8 +0,0 @@
1
- ---
2
- Source Sans Pro:
3
- - Light
4
- Source Serif Pro:
5
- Source Code Pro:
6
- - Light
7
- Source Han Sans:
8
- FiraCode: