metanorma-csa 1.7.0 → 1.7.1

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: 03664b85f4eab48b265d24aaabc416c09d4aedcf83451a672866402d90a5c54f
4
- data.tar.gz: 723c23cc0d9411ed6569c3281803574040d07fa89086f93fab1de5f79546ac9f
3
+ metadata.gz: e6fe06c1107b70d768044a3ebc469e00b060b466c0a4582b84344d25460daff8
4
+ data.tar.gz: 3bdd15ce9f800edd24868b63ffe09f46d110b71906a67446a7000e8291ffa33d
5
5
  SHA512:
6
- metadata.gz: 5231750eb0d40277ebce1bb1f6c6320fd7abb04c6c303bcbdc9af67d18f851c484659cb6baf7052a383105b460303f2ffe672883d9443f0aa197c638a976d116
7
- data.tar.gz: d37944dba89c7f98af07f9d77bbc0d7acbf9aa9ff325ad6e69e854ec270a22cd8acb217a0f5cd71ee98d283928faaf40f739892684a646cf68d249cef0b5b50e
6
+ metadata.gz: 2ccc69f6f1dd8e66f96787f93ded9d5e867a73c0c38358908b7616fd9f25ddf5e3a3009089c0144ef50523e25fb6de4c50305e874d2fba315d42049d28e326eb
7
+ data.tar.gz: e2127ad0bf2f0dec437c30a677b0bae3f3283946bb83d5eda4597daebfb97aa5304fb0e6e333f895f274677d86d3f369163dc8ef5a4625dbe169c02d435cf475
@@ -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"/>
@@ -1252,6 +1252,7 @@
1252
1252
 
1253
1253
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1254
1254
 
1255
+
1255
1256
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1256
1257
 
1257
1258
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -2261,7 +2262,9 @@
2261
2262
  </xsl:template><xsl:template match="*[local-name()='dl']">
2262
2263
  <fo:block-container>
2263
2264
 
2264
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2265
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2266
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2267
+ </xsl:if>
2265
2268
 
2266
2269
 
2267
2270
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2276,6 +2279,7 @@
2276
2279
  <fo:block-container>
2277
2280
 
2278
2281
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2282
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2279
2283
 
2280
2284
 
2281
2285
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2459,12 +2463,32 @@
2459
2463
  </xsl:otherwise>
2460
2464
  </xsl:choose>
2461
2465
  </xsl:template><xsl:template name="getMaxLength_dt">
2462
- <xsl:for-each select="*[local-name()='dt']">
2463
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2464
- <xsl:if test="position() = 1">
2465
- <xsl:value-of select="string-length(normalize-space(.))"/>
2466
- </xsl:if>
2467
- </xsl:for-each>
2466
+ <xsl:variable name="lengths">
2467
+ <xsl:for-each select="*[local-name()='dt']">
2468
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2469
+ <xsl:variable name="attributes">
2470
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2471
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2472
+ </xsl:variable>
2473
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2474
+ </xsl:for-each>
2475
+ </xsl:variable>
2476
+ <xsl:variable name="maxLength">
2477
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2478
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2479
+ <xsl:if test="position() = 1">
2480
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2481
+ </xsl:if>
2482
+ </xsl:for-each> -->
2483
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2484
+ <xsl:sort select="." data-type="number" order="descending"/>
2485
+ <xsl:if test="position() = 1">
2486
+ <xsl:value-of select="."/>
2487
+ </xsl:if>
2488
+ </xsl:for-each>
2489
+ </xsl:variable>
2490
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2491
+ <xsl:value-of select="$maxLength"/>
2468
2492
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2469
2493
  <xsl:param name="key_iso"/>
2470
2494
 
@@ -3265,6 +3289,8 @@
3265
3289
  <xsl:variable name="bookmark-title_">
3266
3290
  <xsl:call-template name="getLangVersion">
3267
3291
  <xsl:with-param name="lang" select="@lang"/>
3292
+ <xsl:with-param name="doctype" select="@doctype"/>
3293
+ <xsl:with-param name="title" select="@title-part"/>
3268
3294
  </xsl:call-template>
3269
3295
  </xsl:variable>
3270
3296
  <xsl:choose>
@@ -3282,13 +3308,34 @@
3282
3308
  </xsl:choose>
3283
3309
  </fo:bookmark-title>
3284
3310
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3311
+
3312
+ <xsl:call-template name="insertFigureBookmarks">
3313
+ <xsl:with-param name="contents" select="contents"/>
3314
+ </xsl:call-template>
3315
+
3316
+ <xsl:call-template name="insertTableBookmarks">
3317
+ <xsl:with-param name="contents" select="contents"/>
3318
+ <xsl:with-param name="lang" select="@lang"/>
3319
+ </xsl:call-template>
3320
+
3285
3321
  </fo:bookmark>
3286
3322
 
3287
3323
  </xsl:for-each>
3288
3324
  </xsl:when>
3289
3325
  <xsl:otherwise>
3290
3326
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3327
+
3291
3328
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3329
+
3330
+ <xsl:call-template name="insertFigureBookmarks">
3331
+ <xsl:with-param name="contents" select="contents"/>
3332
+ </xsl:call-template>
3333
+
3334
+ <xsl:call-template name="insertTableBookmarks">
3335
+ <xsl:with-param name="contents" select="contents"/>
3336
+ <xsl:with-param name="lang" select="@lang"/>
3337
+ </xsl:call-template>
3338
+
3292
3339
  </xsl:for-each>
3293
3340
  </xsl:otherwise>
3294
3341
  </xsl:choose>
@@ -3307,8 +3354,44 @@
3307
3354
 
3308
3355
  </fo:bookmark-tree>
3309
3356
  </xsl:if>
3357
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3358
+ <xsl:param name="contents"/>
3359
+ <xsl:if test="xalan:nodeset($contents)/figure">
3360
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3361
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3362
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3363
+ <fo:bookmark internal-destination="{@id}">
3364
+ <fo:bookmark-title>
3365
+ <xsl:value-of select="normalize-space(title)"/>
3366
+ </fo:bookmark-title>
3367
+ </fo:bookmark>
3368
+ </xsl:for-each>
3369
+ </fo:bookmark>
3370
+ </xsl:if>
3371
+ </xsl:template><xsl:template name="insertTableBookmarks">
3372
+ <xsl:param name="contents"/>
3373
+ <xsl:param name="lang"/>
3374
+ <xsl:if test="xalan:nodeset($contents)/table">
3375
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3376
+ <fo:bookmark-title>
3377
+ <xsl:choose>
3378
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3379
+ <xsl:otherwise>Tables</xsl:otherwise>
3380
+ </xsl:choose>
3381
+ </fo:bookmark-title>
3382
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3383
+ <fo:bookmark internal-destination="{@id}">
3384
+ <fo:bookmark-title>
3385
+ <xsl:value-of select="normalize-space(title)"/>
3386
+ </fo:bookmark-title>
3387
+ </fo:bookmark>
3388
+ </xsl:for-each>
3389
+ </fo:bookmark>
3390
+ </xsl:if>
3310
3391
  </xsl:template><xsl:template name="getLangVersion">
3311
3392
  <xsl:param name="lang"/>
3393
+ <xsl:param name="doctype" select="''"/>
3394
+ <xsl:param name="title" select="''"/>
3312
3395
  <xsl:choose>
3313
3396
  <xsl:when test="$lang = 'en'">
3314
3397
 
@@ -3804,7 +3887,8 @@
3804
3887
  <fo:block-container margin-left="0mm">
3805
3888
 
3806
3889
  <fo:block xsl:use-attribute-sets="quote-style">
3807
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3890
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3891
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3808
3892
  </fo:block>
3809
3893
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3810
3894
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -20,6 +20,14 @@ module Metanorma
20
20
  )
21
21
  end
22
22
 
23
+ def fonts_manifest
24
+ {
25
+ "AzoSans" => nil,
26
+ "STIX Two Math" => nil,
27
+ "Source Code Pro" => nil,
28
+ }
29
+ end
30
+
23
31
  def version
24
32
  "Metanorma::Csa #{Metanorma::Csa::VERSION}"
25
33
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Metanorma
4
4
  module Csa
5
- VERSION = '1.7.0'
5
+ VERSION = '1.7.1'
6
6
  end
7
7
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
- spec.add_dependency "metanorma-generic", "~> 1.8.0"
31
+ spec.add_dependency "metanorma-generic", "~> 1.8.1"
32
32
 
33
33
  spec.add_development_dependency "byebug", "~> 9.1"
34
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-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
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: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.0
19
+ version: 1.8.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.8.0
26
+ version: 1.8.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -225,7 +225,6 @@ files:
225
225
  - lib/isodoc/csa/xref.rb
226
226
  - lib/metanorma-csa.rb
227
227
  - lib/metanorma/csa.rb
228
- - lib/metanorma/csa/fonts_manifest.yaml
229
228
  - lib/metanorma/csa/processor.rb
230
229
  - lib/metanorma/csa/version.rb
231
230
  - metanorma-csa.gemspec
@@ -1,4 +0,0 @@
1
- ---
2
- AzoSans:
3
- Source Code Pro:
4
- - Light