metanorma-iho 1.0.0 → 1.0.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: eca7ce0b97986804a03d34b28a9340a1db8a67794682f3972ccef345177c551f
4
- data.tar.gz: 857fc0984a08a2094e1c08b0fb945ee178f4eca3134173d50619758132e7213a
3
+ metadata.gz: 9c69fb1fa7ffaa584eb5f056c9e35b8c47b5a864ed79c518dadcd2badb75aa27
4
+ data.tar.gz: fd19d981d27d26211c6955120c65dc1fc2b7dfdddca987fa539bd463f1a60810
5
5
  SHA512:
6
- metadata.gz: daa2911323774f07433c7a4a88557465288b5be28fe246b32acb6b84b86db6da39b2c2ccac193a4d1de12127438eee0186e6c0fb8c482517e5addf8a61b4e997
7
- data.tar.gz: 06b59c30143f00c3c651615af2e3070e481338a146cb77d3d08d88044631f396c9546c9ad5c70ea186b5b4ac455e6456b6e61662e8ee5e0b7d1c7069db80781d
6
+ metadata.gz: 0b2b97c6194a316247e56cbf946d42507644bd6abe1f9e1bc511e8b8dc75cc30e43ce5b525d37fbd34264c5c4cf71bdf58068a252e6f051c8c49f05fa2a84960
7
+ data.tar.gz: 461af02ce4d8cab801a1b2c615e3e15bf5269de393324ddf729a7c8a994f6fdc2df6478ed7351f34977ce73bb41bb2afa64260ab548cb9e0182b731d9c2ae254
@@ -9,6 +9,10 @@ module IsoDoc
9
9
  super
10
10
  end
11
11
  end
12
+
13
+ def configuration
14
+ Metanorma::IHO.configuration
15
+ end
12
16
  end
13
17
  end
14
18
  end
@@ -229,6 +229,46 @@ h6:hover > a.anchor,
229
229
  .inline-header:hover > a.anchor {
230
230
  visibility: visible; }
231
231
 
232
+ /* collapsible snippets: collapsible before hidable */
233
+ .hidable {
234
+ max-height: 0;
235
+ overflow: hidden;
236
+ transition: max-height 0.2s ease-out; }
237
+
238
+ .collapsible {
239
+ background-color: #777;
240
+ color: white;
241
+ cursor: pointer;
242
+ padding: 12px 0;
243
+ margin: 0;
244
+ width: 100%;
245
+ border: none;
246
+ text-align: left;
247
+ outline: none;
248
+ font-size: 15px; }
249
+
250
+ .active, .collapsible:hover {
251
+ background-color: #555; }
252
+
253
+ .collapsible:after {
254
+ content: '\25bc';
255
+ color: white;
256
+ font-weight: bold;
257
+ float: right;
258
+ margin-left: 12px;
259
+ margin-right: 12px; }
260
+
261
+ .active:after {
262
+ content: "\25b2"; }
263
+
264
+ /* collapsible: */
265
+ .collapsible + .hidable {
266
+ margin-top: 0; }
267
+
268
+ .collapsible:not(.active) + .hidable {
269
+ overflow: hidden;
270
+ padding: 0; }
271
+
232
272
  #standard-band {
233
273
  background-color: #0AC442; }
234
274
 
@@ -4,13 +4,7 @@ require_relative "init"
4
4
 
5
5
  module IsoDoc
6
6
  module IHO
7
- # A {Converter} implementation that generates HTML output, and a document
8
- # schema encapsulation of the document for validation
9
- #
10
7
  class HtmlConvert < IsoDoc::Generic::HtmlConvert
11
- def configuration
12
- Metanorma::IHO.configuration
13
- end
14
8
 
15
9
  include BaseConvert
16
10
  include Init
@@ -2702,13 +2702,35 @@
2702
2702
  </xsl:for-each>
2703
2703
  </xsl:element>
2704
2704
 
2705
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2705
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2706
2706
 
2707
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2707
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2708
2708
 
2709
2709
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2710
2710
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2711
2711
 
2712
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2713
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] | /*/*[local-name()='indexsect']">
2714
+ <xsl:sort select="@displayorder" data-type="number"/>
2715
+ <xsl:choose>
2716
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2717
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2718
+ <xsl:attribute name="main_page_sequence"/>
2719
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2720
+ </xsl:element>
2721
+ </xsl:when>
2722
+ <xsl:otherwise> <!-- bibliography -->
2723
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2724
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2725
+ <xsl:attribute name="main_page_sequence"/>
2726
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2727
+ </xsl:element>
2728
+ </xsl:element>
2729
+ </xsl:otherwise>
2730
+ </xsl:choose>
2731
+ </xsl:for-each>
2732
+ </xsl:template>
2733
+
2712
2734
  <xsl:template name="insertAnnexInSeparatePageSequences">
2713
2735
  <xsl:for-each select="/*/*[local-name()='annex']">
2714
2736
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -11588,10 +11610,12 @@
11588
11610
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11589
11611
  <xsl:copy>
11590
11612
  <xsl:copy-of select="@*"/>
11591
- <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11592
- <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11593
- <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11594
- <xsl:value-of select="."/>
11613
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11614
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11615
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11616
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11617
+ <xsl:value-of select="normalize-space(.)"/>
11618
+ </xsl:if>
11595
11619
  </xsl:if>
11596
11620
  </xsl:copy>
11597
11621
  </xsl:template>
@@ -12466,7 +12490,8 @@
12466
12490
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12467
12491
  <xsl:choose>
12468
12492
  <xsl:when test="normalize-space() != ''">
12469
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12493
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12494
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12470
12495
  </xsl:when>
12471
12496
  <xsl:otherwise>
12472
12497
  <!-- _{filename}_attachments -->
@@ -2702,13 +2702,35 @@
2702
2702
  </xsl:for-each>
2703
2703
  </xsl:element>
2704
2704
 
2705
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2705
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2706
2706
 
2707
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2707
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2708
2708
 
2709
2709
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2710
2710
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2711
2711
 
2712
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2713
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] | /*/*[local-name()='indexsect']">
2714
+ <xsl:sort select="@displayorder" data-type="number"/>
2715
+ <xsl:choose>
2716
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2717
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2718
+ <xsl:attribute name="main_page_sequence"/>
2719
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2720
+ </xsl:element>
2721
+ </xsl:when>
2722
+ <xsl:otherwise> <!-- bibliography -->
2723
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2724
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2725
+ <xsl:attribute name="main_page_sequence"/>
2726
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2727
+ </xsl:element>
2728
+ </xsl:element>
2729
+ </xsl:otherwise>
2730
+ </xsl:choose>
2731
+ </xsl:for-each>
2732
+ </xsl:template>
2733
+
2712
2734
  <xsl:template name="insertAnnexInSeparatePageSequences">
2713
2735
  <xsl:for-each select="/*/*[local-name()='annex']">
2714
2736
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -11588,10 +11610,12 @@
11588
11610
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11589
11611
  <xsl:copy>
11590
11612
  <xsl:copy-of select="@*"/>
11591
- <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11592
- <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11593
- <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11594
- <xsl:value-of select="."/>
11613
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11614
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11615
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11616
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11617
+ <xsl:value-of select="normalize-space(.)"/>
11618
+ </xsl:if>
11595
11619
  </xsl:if>
11596
11620
  </xsl:copy>
11597
11621
  </xsl:template>
@@ -12466,7 +12490,8 @@
12466
12490
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12467
12491
  <xsl:choose>
12468
12492
  <xsl:when test="normalize-space() != ''">
12469
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12493
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12494
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12470
12495
  </xsl:when>
12471
12496
  <xsl:otherwise>
12472
12497
  <!-- _{filename}_attachments -->
@@ -1,13 +1,15 @@
1
1
  require "isodoc"
2
+ require "metanorma-generic"
3
+ require_relative "base_convert"
2
4
 
3
5
  module IsoDoc
4
6
  module IHO
5
7
  # A {Converter} implementation that generates PDF HTML output, and a
6
8
  # document schema encapsulation of the document for validation
7
- class PdfConvert < IsoDoc::XslfoPdfConvert
9
+ class PdfConvert < IsoDoc::Generic::PdfConvert
8
10
  def initialize(options)
9
- @libdir = File.dirname(__FILE__)
10
11
  super
12
+ @libdir = File.dirname(__FILE__)
11
13
  end
12
14
 
13
15
  def pdf_stylesheet(docxml)
@@ -17,6 +19,9 @@ module IsoDoc
17
19
  "iho.specification.xsl"
18
20
  end
19
21
  end
22
+
23
+ include BaseConvert
24
+ include Init
20
25
  end
21
26
  end
22
27
  end
@@ -7,10 +7,6 @@ module IsoDoc
7
7
  # A {Converter} implementation that generates Word output, and a document
8
8
  # schema encapsulation of the document for validation
9
9
  class WordConvert < IsoDoc::Generic::WordConvert
10
- def configuration
11
- Metanorma::IHO.configuration
12
- end
13
-
14
10
  def make_body1(body, _docxml)
15
11
  body.div class: "WordSection1" do |div1|
16
12
  div1.p style: "font-size:0pt;" do |p|
@@ -15,22 +15,6 @@ module Metanorma
15
15
  )
16
16
  end
17
17
 
18
- def fonts_manifest
19
- {
20
- "Arial" => nil,
21
- "Calibri" => nil,
22
- "Cambria Math" => nil,
23
- "Courier New" => nil,
24
- "Fira Code" => nil,
25
- "Source Sans Pro Light" => nil,
26
- "Source Serif Pro" => nil,
27
- "Source Code Pro Light" => nil,
28
- "Source Han Sans" => nil,
29
- "Source Han Sans Normal" => nil,
30
- "STIX Two Math" => nil,
31
- }
32
- end
33
-
34
18
  def version
35
19
  "Metanorma::IHO #{Metanorma::IHO::VERSION}"
36
20
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "1.0.1".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(">= 3.1.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.6.2"
30
+ spec.add_dependency "metanorma-generic", "~> 2.7.0"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
data/metanorma.yml CHANGED
@@ -65,3 +65,15 @@ termsdefs_titles:
65
65
  - Terms, definitions, symbols and abbreviated terms
66
66
  normref_titles:
67
67
  - References
68
+ fonts_manifest:
69
+ Arial:
70
+ Calibri:
71
+ Cambria Math:
72
+ Courier New:
73
+ Fira Code:
74
+ Source Sans Pro Light:
75
+ Source Serif Pro:
76
+ Source Code Pro Light:
77
+ Source Han Sans:
78
+ Source Han Sans Normal:
79
+ STIX Two Math:
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: 1.0.0
4
+ version: 1.0.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: 2024-08-05 00:00:00.000000000 Z
11
+ date: 2024-08-19 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.6.2
19
+ version: 2.7.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.6.2
26
+ version: 2.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement