metanorma-cc 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: facd0c9522de467534082219cf82fc6c1bcc871defebf31aaf01b6349d144097
4
- data.tar.gz: c15ab9ee72453f2ae9ee1143f94c45d878a3758c581d268eabcc382d59eeb180
3
+ metadata.gz: 666df502f026573721a3c2207bf91d92f4b1da3e2a1e5efe6414f428bbda79bc
4
+ data.tar.gz: e64eb03f34664c9d0a843b926b3c215b69e0e61fa6cd0d58c34f93db5092caa8
5
5
  SHA512:
6
- metadata.gz: 1fcc4a4554181abcabc75f6b4a1e7ef55507f199fc2ff7dc95bbcb04296300b9ddc931d2c84c493f923dd1e9772ede691a68ee829b679e3f947ae036897b945c
7
- data.tar.gz: cfebbfd36efc24ca4ef056368bb96c08b5fe5beec55e4e8393891130a2585dd355b6d3455b229eff8a816ccb6fae65cf4fe11aea4edc10475df9d4d2aa403fe0
6
+ metadata.gz: 1f9cc2d751b5a75d0031e0d4d8c52c7854f679c802dc0d091ec6f377e38030a36825eff425742adf1bb368d1915a61e434c162e22ae374a548c39e39f19f714e
7
+ data.tar.gz: 89039c710247e68dcd23cd7c49153734e5d3acc8f96ee2d87e3e939dcc187c37e5c0e32333b0018f273f2cf7b5e5a96344e134d3b7bfc63a0c46dc4e29b37c3c
@@ -2445,13 +2445,35 @@
2445
2445
  </xsl:for-each>
2446
2446
  </xsl:element>
2447
2447
 
2448
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2448
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2449
2449
 
2450
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2450
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2451
2451
 
2452
2452
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2453
2453
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2454
2454
 
2455
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2456
+ <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']">
2457
+ <xsl:sort select="@displayorder" data-type="number"/>
2458
+ <xsl:choose>
2459
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2460
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2461
+ <xsl:attribute name="main_page_sequence"/>
2462
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2463
+ </xsl:element>
2464
+ </xsl:when>
2465
+ <xsl:otherwise> <!-- bibliography -->
2466
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2467
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2468
+ <xsl:attribute name="main_page_sequence"/>
2469
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2470
+ </xsl:element>
2471
+ </xsl:element>
2472
+ </xsl:otherwise>
2473
+ </xsl:choose>
2474
+ </xsl:for-each>
2475
+ </xsl:template>
2476
+
2455
2477
  <xsl:template name="insertAnnexInSeparatePageSequences">
2456
2478
  <xsl:for-each select="/*/*[local-name()='annex']">
2457
2479
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -11265,10 +11287,12 @@
11265
11287
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11266
11288
  <xsl:copy>
11267
11289
  <xsl:copy-of select="@*"/>
11268
- <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11269
- <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11270
- <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11271
- <xsl:value-of select="."/>
11290
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11291
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11292
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11293
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11294
+ <xsl:value-of select="normalize-space(.)"/>
11295
+ </xsl:if>
11272
11296
  </xsl:if>
11273
11297
  </xsl:copy>
11274
11298
  </xsl:template>
@@ -12143,7 +12167,8 @@
12143
12167
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12144
12168
  <xsl:choose>
12145
12169
  <xsl:when test="normalize-space() != ''">
12146
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12170
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12171
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12147
12172
  </xsl:when>
12148
12173
  <xsl:otherwise>
12149
12174
  <!-- _{filename}_attachments -->
@@ -222,6 +222,46 @@ h6:hover > a.anchor,
222
222
  .inline-header:hover > a.anchor {
223
223
  visibility: visible; }
224
224
 
225
+ /* collapsible snippets: collapsible before hidable */
226
+ .hidable {
227
+ max-height: 0;
228
+ overflow: hidden;
229
+ transition: max-height 0.2s ease-out; }
230
+
231
+ .collapsible {
232
+ background-color: #777;
233
+ color: white;
234
+ cursor: pointer;
235
+ padding: 12px 0;
236
+ margin: 0;
237
+ width: 100%;
238
+ border: none;
239
+ text-align: left;
240
+ outline: none;
241
+ font-size: 15px; }
242
+
243
+ .active, .collapsible:hover {
244
+ background-color: #555; }
245
+
246
+ .collapsible:after {
247
+ content: '\25bc';
248
+ color: white;
249
+ font-weight: bold;
250
+ float: right;
251
+ margin-left: 12px;
252
+ margin-right: 12px; }
253
+
254
+ .active:after {
255
+ content: "\25b2"; }
256
+
257
+ /* collapsible: */
258
+ .collapsible + .hidable {
259
+ margin-top: 0; }
260
+
261
+ .collapsible:not(.active) + .hidable {
262
+ overflow: hidden;
263
+ padding: 0; }
264
+
225
265
  #standard-band {
226
266
  background-color: #0AC442; }
227
267
 
@@ -222,6 +222,46 @@ h6:hover > a.anchor,
222
222
  .inline-header:hover > a.anchor {
223
223
  visibility: visible; }
224
224
 
225
+ /* collapsible snippets: collapsible before hidable */
226
+ .hidable {
227
+ max-height: 0;
228
+ overflow: hidden;
229
+ transition: max-height 0.2s ease-out; }
230
+
231
+ .collapsible {
232
+ background-color: #777;
233
+ color: white;
234
+ cursor: pointer;
235
+ padding: 12px 0;
236
+ margin: 0;
237
+ width: 100%;
238
+ border: none;
239
+ text-align: left;
240
+ outline: none;
241
+ font-size: 15px; }
242
+
243
+ .active, .collapsible:hover {
244
+ background-color: #555; }
245
+
246
+ .collapsible:after {
247
+ content: '\25bc';
248
+ color: white;
249
+ font-weight: bold;
250
+ float: right;
251
+ margin-left: 12px;
252
+ margin-right: 12px; }
253
+
254
+ .active:after {
255
+ content: "\25b2"; }
256
+
257
+ /* collapsible: */
258
+ .collapsible + .hidable {
259
+ margin-top: 0; }
260
+
261
+ .collapsible:not(.active) + .hidable {
262
+ overflow: hidden;
263
+ padding: 0; }
264
+
225
265
  #standard-band {
226
266
  background-color: #0AC442; }
227
267
 
@@ -547,6 +587,46 @@ h6:hover > a.anchor,
547
587
  .inline-header:hover > a.anchor {
548
588
  visibility: visible; }
549
589
 
590
+ /* collapsible snippets: collapsible before hidable */
591
+ .hidable {
592
+ max-height: 0;
593
+ overflow: hidden;
594
+ transition: max-height 0.2s ease-out; }
595
+
596
+ .collapsible {
597
+ background-color: #777;
598
+ color: white;
599
+ cursor: pointer;
600
+ padding: 12px 0;
601
+ margin: 0;
602
+ width: 100%;
603
+ border: none;
604
+ text-align: left;
605
+ outline: none;
606
+ font-size: 15px; }
607
+
608
+ .active, .collapsible:hover {
609
+ background-color: #555; }
610
+
611
+ .collapsible:after {
612
+ content: '\25bc';
613
+ color: white;
614
+ font-weight: bold;
615
+ float: right;
616
+ margin-left: 12px;
617
+ margin-right: 12px; }
618
+
619
+ .active:after {
620
+ content: "\25b2"; }
621
+
622
+ /* collapsible: */
623
+ .collapsible + .hidable {
624
+ margin-top: 0; }
625
+
626
+ .collapsible:not(.active) + .hidable {
627
+ overflow: hidden;
628
+ padding: 0; }
629
+
550
630
  #standard-band {
551
631
  background-color: #0AC442; }
552
632
 
@@ -4,17 +4,14 @@ require "isodoc"
4
4
 
5
5
  module IsoDoc
6
6
  module CC
7
- # A {Converter} implementation that generates CSD output, and a document
8
- # schema encapsulation of the document for validation
9
- class PdfConvert < IsoDoc::XslfoPdfConvert
7
+ class PdfConvert < IsoDoc::Generic::PdfConvert
10
8
  def initialize(options)
11
9
  @libdir = File.dirname(__FILE__)
12
10
  super
13
11
  end
14
12
 
15
- def pdf_stylesheet(docxml)
16
- "cc.standard.xsl"
17
- end
13
+ include BaseConvert
14
+ include Init
18
15
  end
19
16
  end
20
17
  end
@@ -10,9 +10,6 @@ require_relative "validate_section"
10
10
  module Metanorma
11
11
  module CC
12
12
  class Converter < Metanorma::Generic::Converter
13
- XML_ROOT_TAG = "csd-standard".freeze
14
- XML_NAMESPACE = "https://www.metanorma.org/ns/csd".freeze
15
-
16
13
  register_for "cc"
17
14
 
18
15
  def configuration
@@ -3,6 +3,9 @@ require "metanorma/processor"
3
3
  module Metanorma
4
4
  module CC
5
5
  class Processor < Metanorma::Generic::Processor
6
+ def configuration
7
+ Metanorma::CC.configuration
8
+ end
6
9
 
7
10
  def initialize
8
11
  @short = [:csd, :cc]
@@ -18,16 +21,6 @@ module Metanorma
18
21
  )
19
22
  end
20
23
 
21
- def fonts_manifest
22
- {
23
- "Source Sans Pro" => nil,
24
- "Source Serif Pro" => nil,
25
- "Source Code Pro" => nil,
26
- "Source Han Sans" => nil,
27
- "STIX Two Math" => nil,
28
- }
29
- end
30
-
31
24
  def version
32
25
  "Metanorma::CC #{Metanorma::CC::VERSION}"
33
26
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.4.12".freeze
3
+ VERSION = "2.5.0".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(">= 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
@@ -21,6 +21,7 @@ word_smallerfontsize: "10.0pt"
21
21
  word_monospacefontsize: "10.0pt"
22
22
  word_footnotefontsize: "10.0pt"
23
23
  standardstylesheet: lib/isodoc/cc/html/cc.scss
24
+ pdf_stylesheet: lib/isodoc/cc/cc.standard.xsl
24
25
  header: lib/isodoc/cc/html/header.html
25
26
  wordcoverpage: lib/isodoc/cc/html/word_cc_titlepage.html
26
27
  wordintropage: lib/isodoc/cc/html/word_cc_intro.html
@@ -55,4 +56,10 @@ stage_abbreviations:
55
56
  cancelled:
56
57
  withdrawn:
57
58
  logo_path: ""
59
+ fonts_manifest:
60
+ Source Sans Pro:
61
+ Source Serif Pro:
62
+ Source Code Pro:
63
+ Source Han Sans:
64
+ STIX Two Math:
58
65
 
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.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