metanorma-csa 2.4.12 → 2.5.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: 16f333348982316e9e48357f5160eeeb6165df8d6a45c1cbe473e09545f831b8
4
- data.tar.gz: 5e84c06e9cf1d6725b18b961575549fb6f8a0cbe6fc13d31876cfd70b1d7065e
3
+ metadata.gz: d7c765f707e3838f49083d78a1c49a1821fdbcfe7e25a9f21306b0b6adbb4511
4
+ data.tar.gz: ffe390ab5accb247bd72220bc8b43898bdd5247dfffa1f3dbdebda9a716022c7
5
5
  SHA512:
6
- metadata.gz: 704c0a9144835e2b2afeeec424a4cc9edac06dfefb3590bfdf2533051ee48a024064812209ad48869dd2995d0ba0bee134e9febecb90aee36ff7d6530d5e1977
7
- data.tar.gz: d960839132b96fe45bba8e84c96897e0e10a07f6be954adf49719de64e947a71d5e1c3f4b6ec9183b00bddc2539d8151aecc4532b6bdb27b866bd40787987f8f
6
+ metadata.gz: 94f56e6d4e2471ea54ac1742cd8472e11e8378ce60b40e771e87c74ee55ec4ce99c435dd55a542e97b9d472704590fb9b52ffc973f4d5c7e62ffde55023cd651
7
+ data.tar.gz: 4836233b4f7243987e27045f8c7e965a005f85cd5ca7f0f280fe9a419d0254c6eddb1eb6234c4a9442e1d64fc7502e609336da56f1a3aae0f100a49f4ea4ae09
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require "isodoc"
4
2
 
5
3
  module IsoDoc
@@ -2460,13 +2460,35 @@
2460
2460
  </xsl:for-each>
2461
2461
  </xsl:element>
2462
2462
 
2463
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2463
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2464
2464
 
2465
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2465
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2466
2466
 
2467
2467
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2468
2468
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2469
2469
 
2470
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2471
+ <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']">
2472
+ <xsl:sort select="@displayorder" data-type="number"/>
2473
+ <xsl:choose>
2474
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2475
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2476
+ <xsl:attribute name="main_page_sequence"/>
2477
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2478
+ </xsl:element>
2479
+ </xsl:when>
2480
+ <xsl:otherwise> <!-- bibliography -->
2481
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2482
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2483
+ <xsl:attribute name="main_page_sequence"/>
2484
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2485
+ </xsl:element>
2486
+ </xsl:element>
2487
+ </xsl:otherwise>
2488
+ </xsl:choose>
2489
+ </xsl:for-each>
2490
+ </xsl:template>
2491
+
2470
2492
  <xsl:template name="insertAnnexInSeparatePageSequences">
2471
2493
  <xsl:for-each select="/*/*[local-name()='annex']">
2472
2494
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -11249,10 +11271,12 @@
11249
11271
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11250
11272
  <xsl:copy>
11251
11273
  <xsl:copy-of select="@*"/>
11252
- <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11253
- <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11254
- <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11255
- <xsl:value-of select="."/>
11274
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11275
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11276
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11277
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11278
+ <xsl:value-of select="normalize-space(.)"/>
11279
+ </xsl:if>
11256
11280
  </xsl:if>
11257
11281
  </xsl:copy>
11258
11282
  </xsl:template>
@@ -12127,7 +12151,8 @@
12127
12151
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12128
12152
  <xsl:choose>
12129
12153
  <xsl:when test="normalize-space() != ''">
12130
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12154
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12155
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12131
12156
  </xsl:when>
12132
12157
  <xsl:otherwise>
12133
12158
  <!-- _{filename}_attachments -->
@@ -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
 
@@ -1,22 +1,17 @@
1
- # frozen_string_literal: true
2
-
3
- require 'isodoc'
1
+ require_relative "base_convert"
2
+ require "isodoc"
3
+ require "metanorma-generic"
4
4
 
5
5
  module IsoDoc
6
6
  module Csa
7
- # A {Converter} implementation that generates CSA output, and a document
8
- # schema encapsulation of the document for validation
9
-
10
- class PdfConvert < IsoDoc::XslfoPdfConvert
7
+ class PdfConvert < IsoDoc::Generic::PdfConvert
11
8
  def initialize(options)
12
9
  @libdir = File.dirname(__FILE__)
13
10
  super
14
11
  end
15
12
 
16
- def pdf_stylesheet(docxml)
17
- "csa.standard.xsl"
18
- end
13
+ include BaseConvert
14
+ include Init
19
15
  end
20
16
  end
21
17
  end
22
-
@@ -20,15 +20,6 @@ module Metanorma
20
20
  )
21
21
  end
22
22
 
23
- def fonts_manifest
24
- {
25
- #"AzoSans" => nil,
26
- "Lato" => nil,
27
- "STIX Two Math" => nil,
28
- "Source Code Pro" => nil,
29
- }
30
- end
31
-
32
23
  def version
33
24
  "Metanorma::Csa #{Metanorma::Csa::VERSION}"
34
25
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.4.12".freeze
3
+ VERSION = "2.5.0".freeze
4
4
  end
5
5
  end
data/lib/metanorma-csa.rb CHANGED
@@ -1,12 +1,12 @@
1
- require 'asciidoctor' unless defined? Asciidoctor::Converter
2
- require_relative 'metanorma/csa/converter'
3
- require_relative 'isodoc/csa/html_convert'
4
- require_relative 'isodoc/csa/pdf_convert'
5
- require_relative 'isodoc/csa/word_convert'
6
- require_relative 'metanorma/csa/version'
1
+ require "asciidoctor" unless defined? Asciidoctor::Converter
2
+ require_relative "metanorma/csa/converter"
3
+ require_relative "isodoc/csa/html_convert"
4
+ require_relative "isodoc/csa/pdf_convert"
5
+ require_relative "isodoc/csa/word_convert"
6
+ require_relative "metanorma/csa/version"
7
7
  require "metanorma"
8
8
 
9
9
  if defined? Metanorma::Registry
10
- require_relative 'metanorma/csa'
10
+ require_relative "metanorma/csa"
11
11
  Metanorma::Registry.instance.register(Metanorma::Csa::Processor)
12
12
  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(">= 3.1.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.6.2"
32
+ spec.add_dependency "metanorma-generic", "~> 2.7.0"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
data/metanorma.yml CHANGED
@@ -26,6 +26,7 @@ header: lib/isodoc/csa/html/header.html
26
26
  wordcoverpage: lib/isodoc/csa/html/word_csa_titlepage.html
27
27
  wordintropage: lib/isodoc/csa/html/word_csa_intro.html
28
28
  wordstylesheet: lib/isodoc/csa/html/wordstyle.scss
29
+ pdf_stylesheet: lib/isodoc/csa/csa.standard.xsl
29
30
  boilerplate: lib/metanorma/csa/boilerplate.adoc
30
31
  webfont:
31
32
  - "https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700"
@@ -58,4 +59,7 @@ stage_abbreviations:
58
59
  published:
59
60
  withdrawn:
60
61
  logo_path: ""
61
-
62
+ fonts_manifest:
63
+ Lato:
64
+ STIX Two Math:
65
+ Source Code Pro:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.12
4
+ version: 2.5.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: 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