metanorma-m3aawg 1.6.2 → 1.6.3

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: 5c2e09acb297b880bb414e4ab8d3a27583d8b6e02d12f10ba20d36db3157b72f
4
- data.tar.gz: 6b6395caeacba006b65d258b80ddecae051a8989bf92c19d0a73f523127e9fa5
3
+ metadata.gz: 05e03f4d8aa09a9f187402ebdc4458ed44a74ce997f2e73eb4d8aa7f6fc74166
4
+ data.tar.gz: 03b1472ddeb5befa4ca2b1c4c7f9792b2445fc3e76e6f2ab74d21abe844f3e6a
5
5
  SHA512:
6
- metadata.gz: cc7fa5298b88fc633b802e1ad873db706dec4f9c2d15a6932937206e88403a693dcc4b4afd94d564541cb7f0647f614580888473d0f44cb05c6dca92e62c8540
7
- data.tar.gz: 2daf22dedf4b18319c873efa2a495f338e3f88dc4ca6cd2baaeca592990d95d8f9530558d156b185b162758ab3f1d6103e36b3668e2a299fcdc7d7fbb58f4043
6
+ metadata.gz: aa0e526bc5c4121ca63de30e5442d3c6ae25d0e98295d6e043de06a9d18c1b41e23b65301be77ef594a6e0a80d579fac6f5836d03c4ce1786e8172185f511df8
7
+ data.tar.gz: 70174fb0222d2d757fd8985ddf49cb6872cb74453de568369c8785b6fd0f94d31d9e0b21b2333ef872f519b0ab213dadac247c28a786352a3d8564c75bfa89fb
@@ -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"/>
@@ -218,55 +218,89 @@
218
218
  </xsl:call-template>
219
219
  </xsl:variable>
220
220
  <fo:block font-size="12pt" font-weight="bold" text-decoration="underline" margin-bottom="4pt"><xsl:value-of select="$title-toc"/></fo:block>
221
- <fo:table table-layout="fixed" width="100%" font-size="10pt">
222
- <fo:table-column column-width="25mm"/>
223
- <fo:table-column column-width="155mm"/>
224
- <fo:table-body>
225
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
226
- <fo:table-row height="6mm">
227
- <fo:table-cell>
228
- <fo:block font-weight="bold">
229
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
230
- <xsl:choose>
231
- <xsl:when test="@section = ''">
232
- <xsl:apply-templates select="title"/>
233
- </xsl:when>
234
- <xsl:when test="@type = 'references' and @section = ''">
235
- <xsl:apply-templates select="title"/>
236
- </xsl:when>
237
- <xsl:when test="@level = 1">
238
- <xsl:value-of select="@section"/>
239
- </xsl:when>
240
- <xsl:otherwise/>
241
- </xsl:choose>
242
- </fo:basic-link>
243
- </fo:block>
244
- </fo:table-cell>
245
- <fo:table-cell>
246
- <fo:block text-align-last="justify">
247
- <xsl:if test="@level = 1">
248
- <xsl:attribute name="font-weight">bold</xsl:attribute>
249
- </xsl:if>
250
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
251
- <xsl:choose>
252
- <xsl:when test="@section = ''"/>
253
- <xsl:when test="@type = 'references' and @section = ''"/>
254
- <xsl:otherwise>
255
- <xsl:apply-templates select="title"/>
256
- </xsl:otherwise>
257
- </xsl:choose>
258
-
259
- <fo:inline keep-together.within-line="always">
260
- <fo:leader font-weight="normal" leader-pattern="dots"/>
261
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
262
- </fo:inline>
263
- </fo:basic-link>
264
- </fo:block>
265
- </fo:table-cell>
266
- </fo:table-row>
267
- </xsl:for-each>
268
- </fo:table-body>
269
- </fo:table>
221
+ <fo:block font-size="10pt">
222
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
223
+ <xsl:choose>
224
+ <xsl:when test="@section = ''">
225
+ <fo:table table-layout="fixed" width="100%">
226
+ <fo:table-column column-width="180mm"/>
227
+ <fo:table-body>
228
+ <fo:table-row height="6mm">
229
+ <fo:table-cell>
230
+ <fo:block text-align-last="justify">
231
+ <xsl:if test="@level = 1">
232
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
233
+ </xsl:if>
234
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
235
+ <fo:inline font-weight="bold">
236
+ <xsl:apply-templates select="title"/><xsl:text> </xsl:text>
237
+ </fo:inline>
238
+ <fo:inline keep-together.within-line="always">
239
+ <fo:leader font-weight="normal" leader-pattern="dots"/>
240
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
241
+ </fo:inline>
242
+ </fo:basic-link>
243
+ </fo:block>
244
+ </fo:table-cell>
245
+ </fo:table-row>
246
+ </fo:table-body>
247
+ </fo:table>
248
+ </xsl:when>
249
+ <xsl:otherwise>
250
+ <fo:table table-layout="fixed" width="100%">
251
+ <fo:table-column column-width="5mm"/> <!-- 25mm -->
252
+ <fo:table-column column-width="175mm"/> <!-- 155mm -->
253
+ <fo:table-body>
254
+ <fo:table-row height="6mm">
255
+ <fo:table-cell>
256
+ <fo:block font-weight="bold">
257
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
258
+ <xsl:choose>
259
+ <!-- <xsl:when test="@section = ''">
260
+ <xsl:apply-templates select="title"/>
261
+ </xsl:when> -->
262
+ <!-- <xsl:when test="@type = 'references' and @section = ''">
263
+ <xsl:apply-templates select="title"/>
264
+ </xsl:when> -->
265
+ <xsl:when test="@level = 1">
266
+ <xsl:value-of select="@section"/>
267
+ </xsl:when>
268
+ <xsl:otherwise/>
269
+ </xsl:choose>
270
+ </fo:basic-link>
271
+ </fo:block>
272
+ </fo:table-cell>
273
+ <fo:table-cell>
274
+ <fo:block text-align-last="justify">
275
+ <xsl:if test="@level = 1">
276
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
277
+ </xsl:if>
278
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
279
+ <!-- <xsl:choose>
280
+ <xsl:when test="@section = ''"></xsl:when>
281
+ <xsl:otherwise>
282
+ <xsl:apply-templates select="title"/>
283
+ </xsl:otherwise>
284
+ </xsl:choose> -->
285
+ <xsl:apply-templates select="title"/><xsl:text> </xsl:text>
286
+ <fo:inline keep-together.within-line="always">
287
+ <fo:leader font-weight="normal" leader-pattern="dots"/>
288
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
289
+ </fo:inline>
290
+ </fo:basic-link>
291
+ </fo:block>
292
+ </fo:table-cell>
293
+ </fo:table-row>
294
+ </fo:table-body>
295
+ </fo:table>
296
+ </xsl:otherwise>
297
+
298
+ </xsl:choose>
299
+
300
+
301
+
302
+ </xsl:for-each>
303
+ </fo:block>
270
304
  </fo:block-container>
271
305
 
272
306
  <fo:block break-after="page"/>
@@ -1235,6 +1269,7 @@
1235
1269
 
1236
1270
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1237
1271
 
1272
+
1238
1273
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1239
1274
 
1240
1275
 
@@ -2242,7 +2277,9 @@
2242
2277
  </xsl:template><xsl:template match="*[local-name()='dl']">
2243
2278
  <fo:block-container>
2244
2279
 
2245
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2280
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2281
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2282
+ </xsl:if>
2246
2283
 
2247
2284
 
2248
2285
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2257,6 +2294,7 @@
2257
2294
  <fo:block-container>
2258
2295
 
2259
2296
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2297
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2260
2298
 
2261
2299
 
2262
2300
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2440,12 +2478,32 @@
2440
2478
  </xsl:otherwise>
2441
2479
  </xsl:choose>
2442
2480
  </xsl:template><xsl:template name="getMaxLength_dt">
2443
- <xsl:for-each select="*[local-name()='dt']">
2444
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2445
- <xsl:if test="position() = 1">
2446
- <xsl:value-of select="string-length(normalize-space(.))"/>
2447
- </xsl:if>
2448
- </xsl:for-each>
2481
+ <xsl:variable name="lengths">
2482
+ <xsl:for-each select="*[local-name()='dt']">
2483
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2484
+ <xsl:variable name="attributes">
2485
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2486
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2487
+ </xsl:variable>
2488
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2489
+ </xsl:for-each>
2490
+ </xsl:variable>
2491
+ <xsl:variable name="maxLength">
2492
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2493
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2494
+ <xsl:if test="position() = 1">
2495
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2496
+ </xsl:if>
2497
+ </xsl:for-each> -->
2498
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2499
+ <xsl:sort select="." data-type="number" order="descending"/>
2500
+ <xsl:if test="position() = 1">
2501
+ <xsl:value-of select="."/>
2502
+ </xsl:if>
2503
+ </xsl:for-each>
2504
+ </xsl:variable>
2505
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2506
+ <xsl:value-of select="$maxLength"/>
2449
2507
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2450
2508
  <xsl:param name="key_iso"/>
2451
2509
 
@@ -3253,6 +3311,8 @@
3253
3311
  <xsl:variable name="bookmark-title_">
3254
3312
  <xsl:call-template name="getLangVersion">
3255
3313
  <xsl:with-param name="lang" select="@lang"/>
3314
+ <xsl:with-param name="doctype" select="@doctype"/>
3315
+ <xsl:with-param name="title" select="@title-part"/>
3256
3316
  </xsl:call-template>
3257
3317
  </xsl:variable>
3258
3318
  <xsl:choose>
@@ -3270,13 +3330,34 @@
3270
3330
  </xsl:choose>
3271
3331
  </fo:bookmark-title>
3272
3332
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3333
+
3334
+ <xsl:call-template name="insertFigureBookmarks">
3335
+ <xsl:with-param name="contents" select="contents"/>
3336
+ </xsl:call-template>
3337
+
3338
+ <xsl:call-template name="insertTableBookmarks">
3339
+ <xsl:with-param name="contents" select="contents"/>
3340
+ <xsl:with-param name="lang" select="@lang"/>
3341
+ </xsl:call-template>
3342
+
3273
3343
  </fo:bookmark>
3274
3344
 
3275
3345
  </xsl:for-each>
3276
3346
  </xsl:when>
3277
3347
  <xsl:otherwise>
3278
3348
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3349
+
3279
3350
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3351
+
3352
+ <xsl:call-template name="insertFigureBookmarks">
3353
+ <xsl:with-param name="contents" select="contents"/>
3354
+ </xsl:call-template>
3355
+
3356
+ <xsl:call-template name="insertTableBookmarks">
3357
+ <xsl:with-param name="contents" select="contents"/>
3358
+ <xsl:with-param name="lang" select="@lang"/>
3359
+ </xsl:call-template>
3360
+
3280
3361
  </xsl:for-each>
3281
3362
  </xsl:otherwise>
3282
3363
  </xsl:choose>
@@ -3295,8 +3376,44 @@
3295
3376
 
3296
3377
  </fo:bookmark-tree>
3297
3378
  </xsl:if>
3379
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3380
+ <xsl:param name="contents"/>
3381
+ <xsl:if test="xalan:nodeset($contents)/figure">
3382
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3383
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3384
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3385
+ <fo:bookmark internal-destination="{@id}">
3386
+ <fo:bookmark-title>
3387
+ <xsl:value-of select="normalize-space(title)"/>
3388
+ </fo:bookmark-title>
3389
+ </fo:bookmark>
3390
+ </xsl:for-each>
3391
+ </fo:bookmark>
3392
+ </xsl:if>
3393
+ </xsl:template><xsl:template name="insertTableBookmarks">
3394
+ <xsl:param name="contents"/>
3395
+ <xsl:param name="lang"/>
3396
+ <xsl:if test="xalan:nodeset($contents)/table">
3397
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3398
+ <fo:bookmark-title>
3399
+ <xsl:choose>
3400
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3401
+ <xsl:otherwise>Tables</xsl:otherwise>
3402
+ </xsl:choose>
3403
+ </fo:bookmark-title>
3404
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3405
+ <fo:bookmark internal-destination="{@id}">
3406
+ <fo:bookmark-title>
3407
+ <xsl:value-of select="normalize-space(title)"/>
3408
+ </fo:bookmark-title>
3409
+ </fo:bookmark>
3410
+ </xsl:for-each>
3411
+ </fo:bookmark>
3412
+ </xsl:if>
3298
3413
  </xsl:template><xsl:template name="getLangVersion">
3299
3414
  <xsl:param name="lang"/>
3415
+ <xsl:param name="doctype" select="''"/>
3416
+ <xsl:param name="title" select="''"/>
3300
3417
  <xsl:choose>
3301
3418
  <xsl:when test="$lang = 'en'">
3302
3419
 
@@ -3779,7 +3896,8 @@
3779
3896
  <fo:block-container margin-left="0mm">
3780
3897
 
3781
3898
  <fo:block xsl:use-attribute-sets="quote-style">
3782
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3899
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3900
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3783
3901
  </fo:block>
3784
3902
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3785
3903
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -21,6 +21,18 @@ module Metanorma
21
21
  )
22
22
  end
23
23
 
24
+ def fonts_manifest
25
+ {
26
+ "Arial" => nil,
27
+ "Cambria Math" => nil,
28
+ "Courier" => nil,
29
+ "Courier New" => nil,
30
+ "Garamond" => nil,
31
+ "Overpass" => nil,
32
+ "Space Mono" => nil,
33
+ }
34
+ end
35
+
24
36
  def version
25
37
  "Metanorma::M3AAWG #{Metanorma::M3AAWG::VERSION}"
26
38
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module M3AAWG
3
- VERSION = "1.6.2"
3
+ VERSION = "1.6.3"
4
4
  end
5
5
  end
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "htmlentities", "~> 4.3.4"
32
32
  spec.add_dependency "thread_safe"
33
33
 
34
- spec.add_dependency "metanorma-generic", "~> 1.8.0"
34
+ spec.add_dependency "metanorma-generic", "~> 1.8.1"
35
35
 
36
36
  spec.add_development_dependency "byebug", "~> 9.1"
37
37
  spec.add_development_dependency "sassc", "~> 2.4.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-m3aawg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
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
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.8.0
47
+ version: 1.8.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.8.0
54
+ version: 1.8.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: byebug
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -253,7 +253,6 @@ files:
253
253
  - lib/isodoc/m3aawg/xref.rb
254
254
  - lib/metanorma-m3aawg.rb
255
255
  - lib/metanorma/m3aawg.rb
256
- - lib/metanorma/m3aawg/fonts_manifest.yaml
257
256
  - lib/metanorma/m3aawg/processor.rb
258
257
  - lib/metanorma/m3aawg/version.rb
259
258
  - metanorma-m3d.gemspec
@@ -1,5 +0,0 @@
1
- ---
2
- Overpass:
3
- Space Mono:
4
- Garamond:
5
- Courier New: