metanorma-ribose 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: 6050feccc1fe58b1346459237604117fc356f67789dff7c37a79f58ca292bf01
4
- data.tar.gz: 7f5266ed502813bcd9eb610bb022adf98b08cca5573f9b9deb4353e5e9803435
3
+ metadata.gz: 2b0e21983161b3c3054a720ba0c6cec67e16f4019f105bf7a3bd744809decdcf
4
+ data.tar.gz: f068cf5635d32d5f810197a5ce89bef28cd90c00a0b6b92a77fff703d4919363
5
5
  SHA512:
6
- metadata.gz: 8d8a75a61dacfe0084e371a5ade4739d6b080108866f1f3d589b60a5678def496aac3f95d9e8ec911df53e772a9bd5422ac1cbd59dcc2c33185051ec9274e5a1
7
- data.tar.gz: '08051535eca77df632609d2e459f2c32802f38e8de4a34389cf07e0ab189abf34fefa4d593587e7686cf70a3bd86bd694ba93b4a37a92ff13eef63b9e84c2313'
6
+ metadata.gz: f8c76b2af573a73fc7637d1d94a67733c17bdd8e2eb554c66764b4445edeedee61793b9f5dc02bfd15cd5625568c0d63032a2be066885b063c217f66ff984605
7
+ data.tar.gz: 0edf7d93d97578f10f34b2817873e27e8609e4dc5cb05e33ce93c8fcdaba39ae927979a3d4abeeba52c6abf8be9c2d4e943b06f8633fed671b74702c41b45747
@@ -681,7 +681,7 @@ ol {
681
681
  ul li {
682
682
  list-style: none; }
683
683
 
684
- ul > li:before {
684
+ ul > li::before {
685
685
  content: "\2014";
686
686
  display: inline-block;
687
687
  width: 1em;
@@ -705,7 +705,7 @@ ol ul > li:first-child {
705
705
  #toc-list li {
706
706
  list-style-type: none; }
707
707
 
708
- #toc li:before {
708
+ #toc li::before {
709
709
  content: " ";
710
710
  display: none; }
711
711
 
@@ -296,7 +296,7 @@ ul li {
296
296
  list-style: none;
297
297
  }
298
298
 
299
- ul>li:before {
299
+ ul>li::before {
300
300
  content: "\2014";
301
301
  display: inline-block;
302
302
  width: 1em;
@@ -326,7 +326,7 @@ ol ul > li:first-child {
326
326
  list-style-type: none;
327
327
  }
328
328
 
329
- #toc li:before {
329
+ #toc li::before {
330
330
  content: " ";
331
331
  display: none;
332
332
  }
@@ -13,16 +13,6 @@ module IsoDoc
13
13
  Metanorma::Ribose.configuration
14
14
  end
15
15
 
16
- def make_body3(body, docxml)
17
- body.div class: "main-section" do |div3|
18
- boilerplate docxml, div3
19
- front docxml, div3
20
- middle docxml, div3
21
- footnotes div3
22
- comments div3
23
- end
24
- end
25
-
26
16
  include BaseConvert
27
17
  include Init
28
18
  end
@@ -10,6 +10,8 @@ module IsoDoc
10
10
  prefix_name(elem, "<br/><br/>", lbl, "title")
11
11
  end
12
12
 
13
+ def middle_title(docxml); end
14
+
13
15
  def termsource1(elem)
14
16
  mod = elem.at(ns("./modification")) and
15
17
  termsource_modification(mod)
@@ -1526,11 +1526,26 @@
1526
1526
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1527
1527
  </xsl:if>
1528
1528
 
1529
- <xsl:value-of select="."/>
1529
+ <xsl:variable name="font_family" select="."/>
1530
1530
 
1531
- <xsl:if test="$additional_fonts != ''">
1532
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1533
- </xsl:if>
1531
+ <xsl:choose>
1532
+ <xsl:when test="$additional_fonts = ''">
1533
+ <xsl:value-of select="$font_family"/>
1534
+ </xsl:when>
1535
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1536
+ <xsl:choose>
1537
+ <xsl:when test="contains($font_family, ',')">
1538
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1539
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1540
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1541
+ </xsl:when>
1542
+ <xsl:otherwise>
1543
+ <xsl:value-of select="$font_family"/>
1544
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1545
+ </xsl:otherwise>
1546
+ </xsl:choose>
1547
+ </xsl:otherwise>
1548
+ </xsl:choose>
1534
1549
  </xsl:attribute>
1535
1550
  </xsl:when>
1536
1551
  <xsl:otherwise>
@@ -4128,21 +4143,21 @@
4128
4143
 
4129
4144
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4130
4145
 
4131
- <fo:block xsl:use-attribute-sets="table-note-style">
4146
+ <fo:block xsl:use-attribute-sets="table-note-style">
4132
4147
 
4133
- <xsl:call-template name="refine_table-note-style"/>
4148
+ <xsl:call-template name="refine_table-note-style"/>
4134
4149
 
4135
- <!-- Table's note/example name (NOTE, for example) -->
4136
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4150
+ <!-- Table's note/example name (NOTE, for example) -->
4151
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4137
4152
 
4138
- <xsl:call-template name="refine_table-note-name-style"/>
4153
+ <xsl:call-template name="refine_table-note-name-style"/>
4139
4154
 
4140
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4155
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4141
4156
 
4142
- </fo:inline>
4157
+ </fo:inline>
4143
4158
 
4144
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4145
- </fo:block>
4159
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4160
+ </fo:block>
4146
4161
 
4147
4162
  </xsl:template> <!-- table/note -->
4148
4163
 
@@ -5210,6 +5225,9 @@
5210
5225
  <!-- END Definition List -->
5211
5226
  <!-- ===================== -->
5212
5227
 
5228
+ <!-- default: ignore title in sections/p -->
5229
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5230
+
5213
5231
  <!-- ========================= -->
5214
5232
  <!-- Rich text formatting -->
5215
5233
  <!-- ========================= -->
@@ -7269,8 +7287,12 @@
7269
7287
  <xsl:variable name="isAdded" select="../@added"/>
7270
7288
  <xsl:variable name="isDeleted" select="../@deleted"/>
7271
7289
  <xsl:choose>
7272
- <xsl:when test="ancestor::*[local-name() = 'title']">
7290
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7273
7291
  <fo:inline padding-left="1mm" padding-right="1mm">
7292
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7293
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7294
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7295
+ </xsl:if>
7274
7296
  <xsl:variable name="src">
7275
7297
  <xsl:call-template name="image_src"/>
7276
7298
  </xsl:variable>
@@ -7303,25 +7325,45 @@
7303
7325
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7304
7326
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7305
7327
 
7306
- <xsl:variable name="img_src">
7307
- <xsl:choose>
7308
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7309
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7310
- </xsl:choose>
7311
- </xsl:variable>
7328
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7329
+ <xsl:attribute name="width">
7330
+ <xsl:value-of select="@width"/>
7331
+ </xsl:attribute>
7332
+ </xsl:if>
7312
7333
 
7313
- <xsl:variable name="image_width_effective">
7334
+ <xsl:if test="@height != '' and @height != 'auto'">
7335
+ <xsl:attribute name="height">
7336
+ <xsl:value-of select="@height"/>
7337
+ </xsl:attribute>
7338
+ </xsl:if>
7314
7339
 
7315
- <xsl:value-of select="$width_effective"/>
7340
+ <xsl:choose>
7341
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7342
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7343
+ </xsl:when>
7344
+ <xsl:otherwise>
7316
7345
 
7317
- </xsl:variable>
7346
+ <xsl:variable name="img_src">
7347
+ <xsl:choose>
7348
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7349
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7350
+ </xsl:choose>
7351
+ </xsl:variable>
7318
7352
 
7319
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7320
- <xsl:if test="number($scale) &lt; 100">
7353
+ <xsl:variable name="image_width_effective">
7321
7354
 
7322
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7355
+ <xsl:value-of select="$width_effective"/>
7323
7356
 
7324
- </xsl:if>
7357
+ </xsl:variable>
7358
+
7359
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7360
+ <xsl:if test="number($scale) &lt; 100">
7361
+
7362
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7363
+
7364
+ </xsl:if>
7365
+ </xsl:otherwise>
7366
+ </xsl:choose>
7325
7367
 
7326
7368
  </xsl:if>
7327
7369
 
@@ -10975,7 +11017,7 @@
10975
11017
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10976
11018
  <xsl:apply-templates mode="update_xml_step1"/>
10977
11019
  </xsl:template>
10978
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11020
+ <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">
10979
11021
  <xsl:copy>
10980
11022
  <xsl:copy-of select="@*"/>
10981
11023
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -14,9 +14,6 @@ module IsoDoc
14
14
  end
15
15
 
16
16
  def initial_anchor_names(doc)
17
- if blank?(@parse_settings) || @parse_settings[:clauses]
18
- preface_names(doc.at(ns("//executivesummary")))
19
- end
20
17
  super
21
18
  if blank?(@parse_settings) || @parse_settings[:clauses]
22
19
  introduction_names(doc.at(ns("//introduction")))
@@ -24,7 +21,7 @@ module IsoDoc
24
21
  if blank?(@parse_settings)
25
22
  sequential_asset_names(
26
23
  doc.xpath(
27
- ns("//preface/abstract | //foreword | //introduction | "\
24
+ ns("//preface/abstract | //foreword | //introduction | " \
28
25
  "//preface/clause | //acknowledgements | //executivesummary"),
29
26
  ),
30
27
  )
@@ -36,7 +33,7 @@ module IsoDoc
36
33
  { label: num, level: level, xref: num }
37
34
  # subclauses are not prefixed with "Clause"
38
35
  i = Counter.new
39
- clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
36
+ clause.xpath(ns("./clause | ./terms | ./term | ./definitions | " \
40
37
  "./references")).each do |c|
41
38
  i.increment(c)
42
39
  section_names1(c, "#{num}.#{i.print}", level + 1)
@@ -45,15 +42,13 @@ module IsoDoc
45
42
 
46
43
  # we can reference 0-number clauses in introduction
47
44
  def introduction_names(clause)
48
- return if clause.nil?
49
-
45
+ clause.nil? and return
50
46
  clause.at(ns("./clause")) and
51
47
  @anchors[clause["id"]] = { label: "0", level: 1, type: "clause",
52
48
  xref: clause.at(ns("./title"))&.text }
53
49
  i = Counter.new
54
50
  clause.xpath(ns("./clause")).each do |c|
55
- i.increment(c)
56
- section_names1(c, "0.#{i.print}", 2)
51
+ section_names1(c, "0.#{i.increment(c).print}", 2)
57
52
  end
58
53
  end
59
54
  end
@@ -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 Ribose
3
- VERSION = "2.2.13".freeze
3
+ VERSION = "2.3.1".freeze
4
4
  end
5
5
  end
@@ -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-ribose
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