metanorma-cc 2.2.13 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be02166f761818223e01176f6722d2104e3c839dbcb40cda104ee117fbf98942
4
- data.tar.gz: 60e0f9d9f3330f86a04b11552b817f9c9b457d0dba3cd12cd209ddfae6b10338
3
+ metadata.gz: 40330602d80e0dd98cc08dac602112d1bb30a10028fef79de2ea1c949282e46a
4
+ data.tar.gz: ad9ccf5a0c533523b269ec1b7129f0fdeea59bc8f967528c39f67651b54c4d3b
5
5
  SHA512:
6
- metadata.gz: 588407c54d6785cdf22f4b824c50d8fbcf0c5ccb1a13144bcce2f8d018dbae191a72868fae8ea4d4c3f41d8945443debfdda92d110a42423ed6b03d95d8e70c5
7
- data.tar.gz: 5264ee9f84a1c8cb07d7e1fdc0b28d2e8f3254693017f4cfc6abf75d6a64e92b3d9c3194768367d41b9f5e2b04104b055b1b8ce00988fcfb5a0272e847b722a1
6
+ metadata.gz: 45ec8e44d02e7ade2e331722519d64b4230c714b241f19cd6f76fd756a65d9ac21624533eb620ba96e976dcd536dc696da4d986691562934eec72b237d051e33
7
+ data.tar.gz: a58bec52d72164d02df9f8efb1f5a565e66b16b381492b3637d9a434e345eb3253538cac553d41114a78fb148fb3b6e6917abc288c007566b8b66e79774763d5
@@ -234,9 +234,9 @@
234
234
  </fo:static-content>
235
235
  <xsl:call-template name="insertHeaderFooter"/>
236
236
  <fo:flow flow-name="xsl-region-body">
237
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
237
+ <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
238
238
  <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
239
- </fo:block>
239
+ </fo:block> -->
240
240
  <fo:block>
241
241
  <xsl:call-template name="processMainSectionsDefault"/>
242
242
  </fo:block>
@@ -417,6 +417,12 @@
417
417
  <!-- ============================= -->
418
418
  <!-- ============================= -->
419
419
 
420
+ <xsl:template match="csd:sections/csd:p[@class = 'zzSTDTitle1']" priority="4">
421
+ <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
422
+ <xsl:apply-templates/>
423
+ </fo:block>
424
+ </xsl:template>
425
+
420
426
  <xsl:template match="csd:title" name="title">
421
427
 
422
428
  <xsl:variable name="level">
@@ -888,11 +894,26 @@
888
894
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
889
895
  </xsl:if>
890
896
 
891
- <xsl:value-of select="."/>
897
+ <xsl:variable name="font_family" select="."/>
892
898
 
893
- <xsl:if test="$additional_fonts != ''">
894
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
895
- </xsl:if>
899
+ <xsl:choose>
900
+ <xsl:when test="$additional_fonts = ''">
901
+ <xsl:value-of select="$font_family"/>
902
+ </xsl:when>
903
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
904
+ <xsl:choose>
905
+ <xsl:when test="contains($font_family, ',')">
906
+ <xsl:value-of select="substring-before($font_family, ',')"/>
907
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
908
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
909
+ </xsl:when>
910
+ <xsl:otherwise>
911
+ <xsl:value-of select="$font_family"/>
912
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
913
+ </xsl:otherwise>
914
+ </xsl:choose>
915
+ </xsl:otherwise>
916
+ </xsl:choose>
896
917
  </xsl:attribute>
897
918
  </xsl:when>
898
919
  <xsl:otherwise>
@@ -3360,21 +3381,21 @@
3360
3381
 
3361
3382
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
3362
3383
 
3363
- <fo:block xsl:use-attribute-sets="table-note-style">
3384
+ <fo:block xsl:use-attribute-sets="table-note-style">
3364
3385
 
3365
- <xsl:call-template name="refine_table-note-style"/>
3386
+ <xsl:call-template name="refine_table-note-style"/>
3366
3387
 
3367
- <!-- Table's note/example name (NOTE, for example) -->
3368
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
3388
+ <!-- Table's note/example name (NOTE, for example) -->
3389
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
3369
3390
 
3370
- <xsl:call-template name="refine_table-note-name-style"/>
3391
+ <xsl:call-template name="refine_table-note-name-style"/>
3371
3392
 
3372
- <xsl:apply-templates select="*[local-name() = 'name']"/>
3393
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3373
3394
 
3374
- </fo:inline>
3395
+ </fo:inline>
3375
3396
 
3376
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3377
- </fo:block>
3397
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3398
+ </fo:block>
3378
3399
 
3379
3400
  </xsl:template> <!-- table/note -->
3380
3401
 
@@ -4439,6 +4460,9 @@
4439
4460
  <!-- END Definition List -->
4440
4461
  <!-- ===================== -->
4441
4462
 
4463
+ <!-- default: ignore title in sections/p -->
4464
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4465
+
4442
4466
  <!-- ========================= -->
4443
4467
  <!-- Rich text formatting -->
4444
4468
  <!-- ========================= -->
@@ -6486,8 +6510,12 @@
6486
6510
  <xsl:variable name="isAdded" select="../@added"/>
6487
6511
  <xsl:variable name="isDeleted" select="../@deleted"/>
6488
6512
  <xsl:choose>
6489
- <xsl:when test="ancestor::*[local-name() = 'title']">
6513
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6490
6514
  <fo:inline padding-left="1mm" padding-right="1mm">
6515
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6516
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
6517
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
6518
+ </xsl:if>
6491
6519
  <xsl:variable name="src">
6492
6520
  <xsl:call-template name="image_src"/>
6493
6521
  </xsl:variable>
@@ -6520,25 +6548,45 @@
6520
6548
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6521
6549
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6522
6550
 
6523
- <xsl:variable name="img_src">
6524
- <xsl:choose>
6525
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6526
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6527
- </xsl:choose>
6528
- </xsl:variable>
6551
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
6552
+ <xsl:attribute name="width">
6553
+ <xsl:value-of select="@width"/>
6554
+ </xsl:attribute>
6555
+ </xsl:if>
6556
+
6557
+ <xsl:if test="@height != '' and @height != 'auto'">
6558
+ <xsl:attribute name="height">
6559
+ <xsl:value-of select="@height"/>
6560
+ </xsl:attribute>
6561
+ </xsl:if>
6562
+
6563
+ <xsl:choose>
6564
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6565
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6566
+ </xsl:when>
6567
+ <xsl:otherwise>
6529
6568
 
6530
- <xsl:variable name="image_width_effective">
6569
+ <xsl:variable name="img_src">
6570
+ <xsl:choose>
6571
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6572
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6573
+ </xsl:choose>
6574
+ </xsl:variable>
6531
6575
 
6532
- <xsl:value-of select="$width_effective"/>
6576
+ <xsl:variable name="image_width_effective">
6533
6577
 
6534
- </xsl:variable>
6578
+ <xsl:value-of select="$width_effective"/>
6535
6579
 
6536
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6537
- <xsl:if test="number($scale) &lt; 100">
6580
+ </xsl:variable>
6538
6581
 
6539
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6582
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6583
+ <xsl:if test="number($scale) &lt; 100">
6540
6584
 
6541
- </xsl:if>
6585
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6586
+
6587
+ </xsl:if>
6588
+ </xsl:otherwise>
6589
+ </xsl:choose>
6542
6590
 
6543
6591
  </xsl:if>
6544
6592
 
@@ -10201,7 +10249,7 @@
10201
10249
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10202
10250
  <xsl:apply-templates mode="update_xml_step1"/>
10203
10251
  </xsl:template>
10204
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10252
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10205
10253
  <xsl:copy>
10206
10254
  <xsl:copy-of select="@*"/>
10207
10255
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.2 -->
20
+ <!-- VERSION v1.2.4 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -192,9 +192,11 @@
192
192
  </attribute>
193
193
  </optional>
194
194
  <attribute name="citeas"/>
195
- <attribute name="type">
196
- <ref name="ReferenceFormat"/>
197
- </attribute>
195
+ <optional>
196
+ <attribute name="type">
197
+ <ref name="ReferenceFormat"/>
198
+ </attribute>
199
+ </optional>
198
200
  <optional>
199
201
  <attribute name="alt"/>
200
202
  </optional>
@@ -836,6 +838,26 @@
836
838
  <ref name="paragraph"/>
837
839
  </element>
838
840
  </define>
841
+ <define name="stem">
842
+ <element name="stem">
843
+ <attribute name="type">
844
+ <choice>
845
+ <value>MathML</value>
846
+ <value>AsciiMath</value>
847
+ <value>LatexMath</value>
848
+ </choice>
849
+ </attribute>
850
+ <attribute name="block">
851
+ <data type="boolean"/>
852
+ </attribute>
853
+ <oneOrMore>
854
+ <choice>
855
+ <text/>
856
+ <ref name="AnyElement"/>
857
+ </choice>
858
+ </oneOrMore>
859
+ </element>
860
+ </define>
839
861
  <define name="em">
840
862
  <element name="em">
841
863
  <zeroOrMore>
@@ -2046,6 +2068,9 @@
2046
2068
  </define>
2047
2069
  <define name="termdefinition">
2048
2070
  <element name="definition">
2071
+ <optional>
2072
+ <attribute name="type"/>
2073
+ </optional>
2049
2074
  <choice>
2050
2075
  <ref name="verbaldefinition"/>
2051
2076
  <ref name="nonverbalrep"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.2.13".freeze
3
+ VERSION = "2.3.1".freeze
4
4
  end
5
5
  end
data/metanorma-cc.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.4.1"
32
+ spec.add_dependency "metanorma-generic", "~> 2.5.1"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.13
4
+ version: 2.3.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: 2023-07-24 00:00:00.000000000 Z
11
+ date: 2023-08-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: 2.4.1
19
+ version: 2.5.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: 2.4.1
26
+ version: 2.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement