metanorma-csa 2.7.3 → 2.7.4.pre.alpha.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: 1337956f4900ce8051cb6e09b8a1e89bf9411a1d26d2c7d7ada475654adc04ba
4
- data.tar.gz: 6013e487bba644a01d64ad805c71abc6e5f4a93d151d8f913b11fe8abf40d7eb
3
+ metadata.gz: 2f72d6ebbef5b1d962fda7a33dd96f28024af88c4d8ae637007cdcbe9bdd2766
4
+ data.tar.gz: f098590075c6aeb49dc1e769fb62435b24a0e01fc98ff6003348015fb6ff0a05
5
5
  SHA512:
6
- metadata.gz: 64b4f7362641fa0ef8dbc693d84f9667f1dbbb3fde4ebd0a999ead6d3578dda4ba200e4b268d176ddd6ec078f5567a879d793a9c7d42a0298c047af58520707a
7
- data.tar.gz: 493bc165e16d1b60d71f18bf7de4ee4e015df9aad081785a2122dbf0f56dac841a55c7d7af87374eb7874d6ac425922f2cb9c6d55bc421d9afb3aa8011bea163
6
+ metadata.gz: 5a0df16d54cc4e86d13af796805618959c5fca37204a8ab1343a0ec91498886fb9d2f51471b5b30a24bb995ca9396f68b906c502068e61691d10e3c0ed576abd
7
+ data.tar.gz: 2bd269fa36829be5d7ae832c5c8e299615d74f25be8b04200b528f44779f8923c344f2218abbd211af6b30c18c89b976b80b555f0a3917c26bec4051dd378fad
data/Gemfile CHANGED
@@ -6,4 +6,21 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
6
6
 
7
7
  gemspec
8
8
 
9
+ # Canonical line: the relaton 3.x prerelease monogem over the current
10
+ # gem mains (the released generic/standoc line caps relaton at 2.x).
11
+ gem "metanorma", github: "metanorma/metanorma", branch: "main"
12
+ gem "metanorma-generic", github: "metanorma/metanorma-generic", branch: "main"
13
+ gem "metanorma-standoc", github: "metanorma/metanorma-standoc", branch: "main"
14
+ gem "metanorma-core", github: "metanorma/metanorma-core", branch: "main"
15
+ gem "metanorma-document", github: "metanorma/metanorma-document", branch: "main"
16
+ gem "isodoc", github: "metanorma/isodoc", branch: "main"
17
+ gem "metanorma-mirror", github: "metanorma/metanorma-mirror", branch: "main"
18
+ gem "metanorma-plugin-lutaml", github: "metanorma/metanorma-plugin-lutaml", branch: "main"
19
+ gem "relaton", "~> 3.0.0.pre.alpha"
20
+ gem "relaton-render", "~> 3.0.0.pre.alpha"
21
+ gem "pubid", "~> 2.0.0.pre.alpha"
22
+ gem "lutaml-model", "0.8.114" # relaton 3.x declares singular_tolerance (needs 0.8.113+)
23
+ gem "sassc-embedded", "~> 1.80"
24
+ gem "rake", ">= 13.0"
25
+
9
26
  eval_gemfile("Gemfile.devel") rescue nil
data/Gemfile.devel ADDED
@@ -0,0 +1,3 @@
1
+ # Development-time gem overrides. The restructure-wave branch pins that
2
+ # used to live here are merged; add temporary cross-PR pins below and
3
+ # remove them when the branches land.
data/README.adoc CHANGED
@@ -6,6 +6,9 @@ image:https://github.com/metanorma/metanorma-csa/workflows/rake/badge.svg["Build
6
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-csa.svg["Pull Requests", link="https://github.com/metanorma/metanorma-csa/pulls"]
7
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-csa/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-csa/releases"]
8
8
 
9
+ *NOTE: This gem is no longer supported. The Cloud Security Alliance is now supported by Metanorma
10
+ as a taste, rather than as a separate flavour: see https://github.com/metanorma/metanorma-taste[]*
11
+
9
12
  == Functionality
10
13
 
11
14
  This gem processes https://www.metanorma.com/[Metanorma documents] following
@@ -1411,6 +1411,7 @@
1411
1411
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="update_xml_step1"/>
1412
1412
  <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]" mode="update_xml_step1"/>
1413
1413
  <xsl:template match="mn:section-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
1414
+ <xsl:template match="mn:floating-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
1414
1415
  <!-- <xsl:template match="mn:preferred[following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
1415
1416
  <xsl:template match="mn:preferred" mode="update_xml_step1"/>
1416
1417
  <!-- <xsl:template match="mn:admitted[following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
@@ -1425,10 +1426,10 @@
1425
1426
 
1426
1427
  <xsl:template match="mn:term[@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
1427
1428
 
1428
- <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title]]" mode="update_xml_step1">
1429
+ <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]]" mode="update_xml_step1">
1429
1430
  <xsl:copy>
1430
1431
  <xsl:apply-templates select="@*" mode="update_xml_step1"/>
1431
- <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title]/@depth"/>
1432
+ <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]/@depth"/>
1432
1433
  <xsl:apply-templates select="node()" mode="update_xml_step1"/>
1433
1434
  </xsl:copy>
1434
1435
  </xsl:template>
@@ -2526,6 +2527,12 @@
2526
2527
  <xsl:template name="refine_sourcecode-style">
2527
2528
  </xsl:template> <!-- refine_sourcecode-style -->
2528
2529
 
2530
+ <xsl:attribute-set name="sourcecode-number-style">
2531
+ </xsl:attribute-set>
2532
+
2533
+ <xsl:template name="refine_sourcecode-number-style">
2534
+ </xsl:template>
2535
+
2529
2536
  <xsl:attribute-set name="sourcecode-name-style">
2530
2537
  <xsl:attribute name="font-size">11pt</xsl:attribute>
2531
2538
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -3913,6 +3920,12 @@
3913
3920
  <xsl:template name="refine_term-name-style">
3914
3921
  </xsl:template>
3915
3922
 
3923
+ <xsl:attribute-set name="preferred-style">
3924
+ </xsl:attribute-set> <!-- preferred-style -->
3925
+
3926
+ <xsl:template name="refine_preferred-style">
3927
+ </xsl:template>
3928
+
3916
3929
  <xsl:attribute-set name="preferred-block-style">
3917
3930
  </xsl:attribute-set> <!-- preferred-block-style -->
3918
3931
 
@@ -4558,6 +4571,12 @@
4558
4571
  <xsl:call-template name="setBordersTableArray"/>
4559
4572
  </xsl:template> <!-- refine_table-style -->
4560
4573
 
4574
+ <xsl:attribute-set name="table-number-style">
4575
+ </xsl:attribute-set>
4576
+
4577
+ <xsl:template name="refine_table-number-style">
4578
+ </xsl:template>
4579
+
4561
4580
  <xsl:attribute-set name="table-name-style">
4562
4581
  <xsl:attribute name="role">Caption</xsl:attribute>
4563
4582
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
@@ -4992,7 +5011,7 @@
4992
5011
 
4993
5012
  </fo:block>
4994
5013
 
4995
- <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
5014
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
4996
5015
  <xsl:if test="$continued = 'true'">
4997
5016
 
4998
5017
  <!-- to prevent the error 'THead element may contain only TR elements' -->
@@ -8125,6 +8144,12 @@
8125
8144
  <xsl:template name="refine_figure-style">
8126
8145
  </xsl:template>
8127
8146
 
8147
+ <xsl:attribute-set name="figure-number-style">
8148
+ </xsl:attribute-set>
8149
+
8150
+ <xsl:template name="refine_figure-number-style">
8151
+ </xsl:template>
8152
+
8128
8153
  <xsl:attribute-set name="figure-name-style">
8129
8154
  <xsl:attribute name="role">Caption</xsl:attribute>
8130
8155
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -12946,10 +12971,17 @@
12946
12971
  </xsl:choose>
12947
12972
  </xsl:template>
12948
12973
 
12974
+ <xsl:attribute-set name="clause-style">
12975
+
12976
+ </xsl:attribute-set>
12977
+
12978
+ <xsl:template name="refine_clause-style">
12979
+ </xsl:template>
12980
+
12949
12981
  <!-- main sections -->
12950
12982
  <xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
12951
12983
  <xsl:call-template name="setNamedDestination"/>
12952
- <fo:block>
12984
+ <fo:block role="Sect">
12953
12985
  <xsl:call-template name="setId"/>
12954
12986
 
12955
12987
  <xsl:call-template name="sections_element_style"/>
@@ -13077,6 +13109,10 @@
13077
13109
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
13078
13110
  </xsl:template>
13079
13111
 
13112
+ <!-- for case when update_xml_step1 (common.updatexml.xsl) doesn't apply when $table_if = 'true' -->
13113
+ <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]"/>
13114
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
13115
+
13080
13116
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
13081
13117
  <xsl:template name="insert_basic_link">
13082
13118
  <xsl:param name="element"/>
@@ -11,16 +11,6 @@ module IsoDoc
11
11
  Metanorma::Csa.configuration
12
12
  end
13
13
 
14
- def title(isoxml, _out)
15
- main = isoxml.at(ns("//bibdata/title[@language='en']"))
16
- &.children&.to_xml
17
- set(:doctitle, main)
18
- end
19
-
20
- def subtitle(_isoxml, _out)
21
- nil
22
- end
23
-
24
14
  def author(isoxml, _out)
25
15
  set(:tc, "XXXX")
26
16
  tc = isoxml.at(ns("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Technical committee']/name"))
@@ -0,0 +1,7 @@
1
+ module Metanorma
2
+ module Csa
3
+ class Cleanup < Metanorma::Generic::Cleanup
4
+ extend Forwardable
5
+ end
6
+ end
7
+ end
@@ -43,6 +43,18 @@ module Metanorma
43
43
  nil, false, "#{@filename}.pdf")
44
44
  end
45
45
 
46
+ CSA_LOG_MESSAGES = {
47
+ # rubocop:disable Naming/VariableNumber
48
+ "CSA_1": { category: "Document Attributes",
49
+ error: "%s is not a recognised role",
50
+ severity: 2 },
51
+ # rubocop:enable Naming/VariableNumber
52
+ }.freeze
53
+
54
+ def log_messages
55
+ super.merge(CSA_LOG_MESSAGES)
56
+ end
57
+
46
58
  def sections_cleanup(xml)
47
59
  super
48
60
  xml.xpath("//*[@inline-header]").each do |h|
@@ -50,21 +62,6 @@ module Metanorma
50
62
  end
51
63
  end
52
64
 
53
- def bibdata_validate(doc)
54
- super
55
- role_validate(doc)
56
- end
57
-
58
- def role_validate(doc)
59
- doc&.xpath("//bibdata/contributor/role[description]")&.each do |r|
60
- r["type"] == "author" or next
61
- role = r.at("./description").text
62
- %w{full-author contributor staff reviewer}.include?(role) or
63
- @log.add("Document Attributes", nil,
64
- "#{role} is not a recognised role")
65
- end
66
- end
67
-
68
65
  def style(_node, _text)
69
66
  nil
70
67
  end
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <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">
3
- <!-- VERSION v2.1.2 -->
3
+ <!-- VERSION v2.1.3 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -455,14 +455,7 @@ normative or informative references, some split references into sections organiz
455
455
  </ref>
456
456
  </zeroOrMore>
457
457
  <zeroOrMore>
458
- <ref name="doc_bibitem">
459
- <a:documentation>Bibliographic item cited in the document</a:documentation>
460
- </ref>
461
- <zeroOrMore>
462
- <ref name="note">
463
- <a:documentation>Annotation of the bibliographic item</a:documentation>
464
- </ref>
465
- </zeroOrMore>
458
+ <ref name="ReferenceEntry"/>
466
459
  </zeroOrMore>
467
460
  <zeroOrMore>
468
461
  <ref name="references">
@@ -604,18 +597,21 @@ gives an explicit page orientation</a:documentation>
604
597
  </element>
605
598
  </optional>
606
599
  </define>
607
- </include>
608
- <!-- end overrides -->
609
- <define name="FnAttributes" combine="interleave">
610
- <ref name="RequiredId"/>
611
- <optional>
612
- <attribute name="hiddenref">
613
- <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
600
+ <define name="FnAttributes">
601
+ <ref name="RequiredId"/>
602
+ <optional>
603
+ <attribute name="hiddenref">
604
+ <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
614
605
  This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
615
- <data type="boolean"/>
606
+ <data type="boolean"/>
607
+ </attribute>
608
+ </optional>
609
+ <attribute name="reference">
610
+ <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
616
611
  </attribute>
617
- </optional>
618
- </define>
612
+ </define>
613
+ </include>
614
+ <!-- end overrides -->
619
615
  <define name="TdAttributes" combine="interleave">
620
616
  <ref name="RequiredId"/>
621
617
  <optional>
@@ -853,6 +849,17 @@ titlecase, or lowercase</a:documentation>
853
849
  <value>informative</value>
854
850
  </choice>
855
851
  </define>
852
+ <define name="ReferenceEntry">
853
+ <a:documentation>Entry in bibliography</a:documentation>
854
+ <ref name="doc_bibitem">
855
+ <a:documentation>Bibliographic item cited in the document</a:documentation>
856
+ </ref>
857
+ <zeroOrMore>
858
+ <ref name="note">
859
+ <a:documentation>Annotation of the bibliographic item</a:documentation>
860
+ </ref>
861
+ </zeroOrMore>
862
+ </define>
856
863
  <define name="doc_bibitem">
857
864
  <a:documentation>Standardisation document representation of bibliographic entry</a:documentation>
858
865
  <element name="bibitem">
@@ -0,0 +1,22 @@
1
+ require "nokogiri"
2
+ require "metanorma-generic"
3
+
4
+ module Metanorma
5
+ module Csa
6
+ class Validate < Metanorma::Generic::Validate
7
+ def bibdata_validate(doc)
8
+ super
9
+ role_validate(doc)
10
+ end
11
+
12
+ def role_validate(doc)
13
+ doc&.xpath("//bibdata/contributor/role[description]")&.each do |r|
14
+ r["type"] == "author" or next
15
+ role = r.at("./description").text
16
+ %w{full-author contributor staff reviewer}.include?(role) or
17
+ @log.add("CSA_1", nil, params: [role])
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.7.3".freeze
3
+ VERSION = "2.7.4.pre.alpha.1".freeze
4
4
  end
5
5
  end
data/lib/metanorma-csa.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "metanorma/csa/converter"
3
+ require_relative "metanorma/csa/cleanup"
4
+ require_relative "metanorma/csa/validate"
3
5
  require_relative "isodoc/csa/html_convert"
4
6
  require_relative "isodoc/csa/pdf_convert"
5
7
  require_relative "isodoc/csa/word_convert"
@@ -27,12 +27,11 @@ Gem::Specification.new do |spec|
27
27
  spec.bindir = "exe"
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
- spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
30
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 3.1.0"
32
+ spec.add_dependency "metanorma-generic", "~> 3.5"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
- spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
35
  spec.add_development_dependency "guard", "~> 2.14"
37
36
  spec.add_development_dependency "guard-rspec", "~> 4.7"
38
37
  spec.add_development_dependency "rake", "~> 13.0"
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.7.3
4
+ version: 2.7.4.pre.alpha.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: 2025-09-01 00:00:00.000000000 Z
11
+ date: 2026-10-22 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: 3.1.0
19
+ version: '3.5'
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: 3.1.0
26
+ version: '3.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: equivalent-xml
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.6'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.6'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: guard
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -209,12 +195,12 @@ files:
209
195
  - ".rubocop.yml"
210
196
  - CODE_OF_CONDUCT.md
211
197
  - Gemfile
198
+ - Gemfile.devel
212
199
  - LICENSE
213
200
  - README.adoc
214
201
  - lib/isodoc/csa/base_convert.rb
215
202
  - lib/isodoc/csa/csa.standard.xsl
216
203
  - lib/isodoc/csa/html/csa-logo-white.png
217
- - lib/isodoc/csa/html/csa.css
218
204
  - lib/isodoc/csa/html/csa.png
219
205
  - lib/isodoc/csa/html/csa.scss
220
206
  - lib/isodoc/csa/html/dots-w@2x.png
@@ -222,11 +208,9 @@ files:
222
208
  - lib/isodoc/csa/html/header.html
223
209
  - lib/isodoc/csa/html/html_csa_intro.html
224
210
  - lib/isodoc/csa/html/html_csa_titlepage.html
225
- - lib/isodoc/csa/html/htmlstyle.css
226
211
  - lib/isodoc/csa/html/htmlstyle.scss
227
212
  - lib/isodoc/csa/html/word_csa_intro.html
228
213
  - lib/isodoc/csa/html/word_csa_titlepage.html
229
- - lib/isodoc/csa/html/wordstyle.css
230
214
  - lib/isodoc/csa/html/wordstyle.scss
231
215
  - lib/isodoc/csa/html_convert.rb
232
216
  - lib/isodoc/csa/i18n-en.yaml
@@ -243,12 +227,14 @@ files:
243
227
  - lib/metanorma/csa/biblio-standoc.rng
244
228
  - lib/metanorma/csa/biblio.rng
245
229
  - lib/metanorma/csa/boilerplate.adoc
230
+ - lib/metanorma/csa/cleanup.rb
246
231
  - lib/metanorma/csa/converter.rb
247
232
  - lib/metanorma/csa/csa.rng
248
233
  - lib/metanorma/csa/isodoc.rng
249
234
  - lib/metanorma/csa/processor.rb
250
235
  - lib/metanorma/csa/relaton-csa.rng
251
236
  - lib/metanorma/csa/reqt.rng
237
+ - lib/metanorma/csa/validate.rb
252
238
  - lib/metanorma/csa/version.rb
253
239
  - metanorma-csa.gemspec
254
240
  - metanorma.yml
@@ -264,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
250
  requirements:
265
251
  - - ">="
266
252
  - !ruby/object:Gem::Version
267
- version: 3.1.0
253
+ version: 3.3.0
268
254
  required_rubygems_version: !ruby/object:Gem::Requirement
269
255
  requirements:
270
256
  - - ">="