metanorma-iho 0.7.14 → 0.8.0

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: cbf9a1bfd7a68cc123adc041a0efb220a3771c652784026a284a124ed79333d2
4
- data.tar.gz: 9c79bbf9ed708071e41538de30f5bacf1cf297e6ee9b8ffd2044ac2090ebdbc8
3
+ metadata.gz: 6e745ee37c741e2fbb8ad9398012b6211c61ed73e585ec78272538295fd23005
4
+ data.tar.gz: 0f9688d8696eaa1417ebb7d25053b902dcde60f316a5c87637f656d8355f7afa
5
5
  SHA512:
6
- metadata.gz: 9e18eaf1bfa537e3afa2f43161881f0841757d07a065286fba2bc1f8ddb17319c8ce567225fe89950c0f070c9d0279e6d73bf5ed305591d2200aecd9b411b74f
7
- data.tar.gz: e4e898a3782cd148ba63daa180c87eb62b254fd7e977a8b66f94c3a0af18d937805b8f4f3622875401bfd8091f4fa392f8650e3ca180133e6f5072278ce6e566
6
+ metadata.gz: 9c798099b130b2d7a6810aed66b1c553da76fbd9f8c9fbfe3018a8db05460b93073937502b89bfd2bee3e810b31910ffa0cf3619badf33b800ed01e6fb1ba5a2
7
+ data.tar.gz: dec07c7dd9ded93dd4eff6758eb699964967bc88a18a9d1bbac62a97d09851fc337baa8bbf4ebd7e1f3bcb7ac0820297cd2271c947df763d03a0543adf8e4524
@@ -12,23 +12,6 @@ module IsoDoc
12
12
  Metanorma::IHO.configuration
13
13
  end
14
14
 
15
- =begin
16
- def make_body3(body, docxml)
17
- body.div **{ class: "main-section" } do |div3|
18
- boilerplate docxml, div3
19
- preface_block docxml, div3
20
- abstract docxml, div3
21
- foreword docxml, div3
22
- introduction docxml, div3
23
- preface docxml, div3
24
- acknowledgements docxml, div3
25
- middle docxml, div3
26
- footnotes div3
27
- comments div3
28
- end
29
- end
30
- =end
31
-
32
15
  include BaseConvert
33
16
  include Init
34
17
  end
@@ -4762,6 +4762,9 @@
4762
4762
  <!-- END Definition List -->
4763
4763
  <!-- ===================== -->
4764
4764
 
4765
+ <!-- default: ignore title in sections/p -->
4766
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4767
+
4765
4768
  <!-- ========================= -->
4766
4769
  <!-- Rich text formatting -->
4767
4770
  <!-- ========================= -->
@@ -6914,25 +6917,45 @@
6914
6917
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6915
6918
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6916
6919
 
6917
- <xsl:variable name="img_src">
6918
- <xsl:choose>
6919
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6920
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6921
- </xsl:choose>
6922
- </xsl:variable>
6920
+ <xsl:if test="@width != '' and @width != 'auto'">
6921
+ <xsl:attribute name="width">
6922
+ <xsl:value-of select="@width"/>
6923
+ </xsl:attribute>
6924
+ </xsl:if>
6923
6925
 
6924
- <xsl:variable name="image_width_effective">
6926
+ <xsl:if test="@height != '' and @height != 'auto'">
6927
+ <xsl:attribute name="height">
6928
+ <xsl:value-of select="@height"/>
6929
+ </xsl:attribute>
6930
+ </xsl:if>
6925
6931
 
6926
- <xsl:value-of select="$width_effective"/>
6932
+ <xsl:choose>
6933
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6934
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6935
+ </xsl:when>
6936
+ <xsl:otherwise>
6927
6937
 
6928
- </xsl:variable>
6938
+ <xsl:variable name="img_src">
6939
+ <xsl:choose>
6940
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6941
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6942
+ </xsl:choose>
6943
+ </xsl:variable>
6929
6944
 
6930
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6931
- <xsl:if test="number($scale) &lt; 100">
6945
+ <xsl:variable name="image_width_effective">
6932
6946
 
6933
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6947
+ <xsl:value-of select="$width_effective"/>
6934
6948
 
6935
- </xsl:if>
6949
+ </xsl:variable>
6950
+
6951
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6952
+ <xsl:if test="number($scale) &lt; 100">
6953
+
6954
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6955
+
6956
+ </xsl:if>
6957
+ </xsl:otherwise>
6958
+ </xsl:choose>
6936
6959
 
6937
6960
  </xsl:if>
6938
6961
 
@@ -10586,7 +10609,7 @@
10586
10609
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10587
10610
  <xsl:apply-templates mode="update_xml_step1"/>
10588
10611
  </xsl:template>
10589
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10612
+ <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">
10590
10613
  <xsl:copy>
10591
10614
  <xsl:copy-of select="@*"/>
10592
10615
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4762,6 +4762,9 @@
4762
4762
  <!-- END Definition List -->
4763
4763
  <!-- ===================== -->
4764
4764
 
4765
+ <!-- default: ignore title in sections/p -->
4766
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4767
+
4765
4768
  <!-- ========================= -->
4766
4769
  <!-- Rich text formatting -->
4767
4770
  <!-- ========================= -->
@@ -6914,25 +6917,45 @@
6914
6917
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6915
6918
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6916
6919
 
6917
- <xsl:variable name="img_src">
6918
- <xsl:choose>
6919
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6920
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6921
- </xsl:choose>
6922
- </xsl:variable>
6920
+ <xsl:if test="@width != '' and @width != 'auto'">
6921
+ <xsl:attribute name="width">
6922
+ <xsl:value-of select="@width"/>
6923
+ </xsl:attribute>
6924
+ </xsl:if>
6923
6925
 
6924
- <xsl:variable name="image_width_effective">
6926
+ <xsl:if test="@height != '' and @height != 'auto'">
6927
+ <xsl:attribute name="height">
6928
+ <xsl:value-of select="@height"/>
6929
+ </xsl:attribute>
6930
+ </xsl:if>
6925
6931
 
6926
- <xsl:value-of select="$width_effective"/>
6932
+ <xsl:choose>
6933
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6934
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6935
+ </xsl:when>
6936
+ <xsl:otherwise>
6927
6937
 
6928
- </xsl:variable>
6938
+ <xsl:variable name="img_src">
6939
+ <xsl:choose>
6940
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6941
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6942
+ </xsl:choose>
6943
+ </xsl:variable>
6929
6944
 
6930
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6931
- <xsl:if test="number($scale) &lt; 100">
6945
+ <xsl:variable name="image_width_effective">
6932
6946
 
6933
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6947
+ <xsl:value-of select="$width_effective"/>
6934
6948
 
6935
- </xsl:if>
6949
+ </xsl:variable>
6950
+
6951
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6952
+ <xsl:if test="number($scale) &lt; 100">
6953
+
6954
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6955
+
6956
+ </xsl:if>
6957
+ </xsl:otherwise>
6958
+ </xsl:choose>
6936
6959
 
6937
6960
  </xsl:if>
6938
6961
 
@@ -10586,7 +10609,7 @@
10586
10609
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10587
10610
  <xsl:apply-templates mode="update_xml_step1"/>
10588
10611
  </xsl:template>
10589
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10612
+ <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">
10590
10613
  <xsl:copy>
10591
10614
  <xsl:copy-of select="@*"/>
10592
10615
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -19,6 +19,8 @@ _bib)
19
19
  "[#{ordinal}]<tab/>"
20
20
  end
21
21
 
22
+ def middle_title(docxml); end
23
+
22
24
  def preface_rearrange(doc)
23
25
  preface_move(doc.at(ns("//preface/abstract")),
24
26
  %w(foreword executivesummary introduction clause acknowledgements), doc)
@@ -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.3 -->
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>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.7.14".freeze
3
+ VERSION = "0.8.0".freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.4.1"
30
+ spec.add_dependency "metanorma-generic", "~> 2.5.0"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.7.14
4
+ version: 0.8.0
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-07 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.0
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.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement