metanorma-csa 1.5.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/csa/basicdoc.rng +23 -0
- data/lib/asciidoctor/csa/boilerplate.xml +2 -0
- data/lib/asciidoctor/csa/converter.rb +14 -30
- data/lib/asciidoctor/csa/csa.rng +7 -0
- data/lib/asciidoctor/csa/isodoc.rng +137 -21
- data/lib/asciidoctor/csa/validate.rb +11 -0
- data/lib/isodoc/csa/base_convert.rb +0 -21
- data/lib/isodoc/csa/csa.standard.xsl +2113 -2799
- data/lib/isodoc/csa/html/csa.css +16 -4
- data/lib/isodoc/csa/html/csa.scss +18 -4
- data/lib/isodoc/csa/html/html_csa_titlepage.html +24 -0
- data/lib/isodoc/csa/html/word_csa_titlepage.html +19 -0
- data/lib/isodoc/csa/html_convert.rb +2 -0
- data/lib/isodoc/csa/i18n-en.yaml +2 -0
- data/lib/isodoc/csa/i18n.rb +10 -0
- data/lib/isodoc/csa/init.rb +24 -0
- data/lib/isodoc/csa/metadata.rb +30 -0
- data/lib/isodoc/csa/presentation_xml_convert.rb +10 -1
- data/lib/isodoc/csa/word_convert.rb +2 -0
- data/lib/isodoc/csa/xref.rb +6 -0
- data/lib/metanorma/csa/version.rb +1 -1
- data/metanorma-csa.gemspec +2 -2
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f6554bb3c5f2ab94940474101e4c14e70610c7fce4ac503125b1a79622533f3
|
4
|
+
data.tar.gz: 7c797d8ace953937dc1db93f74b79fbfb865d51ad4809b6626117d206dae4c25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dba96aed6028863827afbe8a50dd2a8e11dedb41aa750f8a5dc0e58f73ff37a736a9eb0218248e44dc5fe0138e16d2d7e0ac2dc2eb2625f8983e36145c2e9dd0
|
7
|
+
data.tar.gz: 3de7d046326e4a8398c48c4acd73d2d68660d841aee136a8950b52baec9078d05a7186a7c615a54b5365bb117cc3723dd40ce93e10f4bd9be0f1625f8b9f7cf3
|
@@ -402,6 +402,16 @@
|
|
402
402
|
</choice>
|
403
403
|
</attribute>
|
404
404
|
</optional>
|
405
|
+
<optional>
|
406
|
+
<attribute name="valign">
|
407
|
+
<choice>
|
408
|
+
<value>top</value>
|
409
|
+
<value>middle</value>
|
410
|
+
<value>bottom</value>
|
411
|
+
<value>baseline</value>
|
412
|
+
</choice>
|
413
|
+
</attribute>
|
414
|
+
</optional>
|
405
415
|
<choice>
|
406
416
|
<zeroOrMore>
|
407
417
|
<ref name="TextElement"/>
|
@@ -429,6 +439,16 @@
|
|
429
439
|
</choice>
|
430
440
|
</attribute>
|
431
441
|
</optional>
|
442
|
+
<optional>
|
443
|
+
<attribute name="valign">
|
444
|
+
<choice>
|
445
|
+
<value>top</value>
|
446
|
+
<value>middle</value>
|
447
|
+
<value>bottom</value>
|
448
|
+
<value>baseline</value>
|
449
|
+
</choice>
|
450
|
+
</attribute>
|
451
|
+
</optional>
|
432
452
|
<choice>
|
433
453
|
<zeroOrMore>
|
434
454
|
<ref name="TextElement"/>
|
@@ -998,6 +1018,9 @@
|
|
998
1018
|
<value>alphabet_upper</value>
|
999
1019
|
</choice>
|
1000
1020
|
</attribute>
|
1021
|
+
<optional>
|
1022
|
+
<attribute name="start"/>
|
1023
|
+
</optional>
|
1001
1024
|
<oneOrMore>
|
1002
1025
|
<ref name="li"/>
|
1003
1026
|
</oneOrMore>
|
@@ -7,6 +7,7 @@
|
|
7
7
|
|
8
8
|
{% if unpublished %}
|
9
9
|
<license-statement>
|
10
|
+
<clause>
|
10
11
|
<title>Warning for Drafts</title>
|
11
12
|
|
12
13
|
<p>This document is not a CSA Standard. It is distributed for review and
|
@@ -15,6 +16,7 @@
|
|
15
16
|
comments, notification of any relevant patent rights of which they are aware
|
16
17
|
and to provide supporting documentation.
|
17
18
|
</p>
|
19
|
+
</clause>
|
18
20
|
</license-statement>
|
19
21
|
{% endif %}
|
20
22
|
|
@@ -22,21 +22,14 @@ module Asciidoctor
|
|
22
22
|
|
23
23
|
register_for CSA_TYPE
|
24
24
|
|
25
|
-
def
|
26
|
-
|
27
|
-
c.role **{ type: "author" }
|
28
|
-
c.organization do |a|
|
29
|
-
a.name "Cloud Security Alliance"
|
30
|
-
end
|
31
|
-
end
|
25
|
+
def default_publisher
|
26
|
+
"Cloud Security Alliance"
|
32
27
|
end
|
33
28
|
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
a.name "Cloud Security Alliance"
|
39
|
-
end
|
29
|
+
def personal_role(node, c, suffix)
|
30
|
+
role = node.attr("role#{suffix}")&.downcase || "full author"
|
31
|
+
c.role **{ type: role == "editor" ? "editor" : "author" } do |r|
|
32
|
+
r.description role.strip.gsub(/\s/, "-")
|
40
33
|
end
|
41
34
|
end
|
42
35
|
|
@@ -58,7 +51,7 @@ module Asciidoctor
|
|
58
51
|
dn = node.attr('docnumber') or return
|
59
52
|
docstatus = node.attr('status')
|
60
53
|
if docstatus
|
61
|
-
abbr = IsoDoc::Csa::Metadata.new('en', 'Latn',
|
54
|
+
abbr = IsoDoc::Csa::Metadata.new('en', 'Latn', @i18n)
|
62
55
|
.stage_abbr(docstatus)
|
63
56
|
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
64
57
|
end
|
@@ -67,24 +60,12 @@ module Asciidoctor
|
|
67
60
|
xml.docnumber { |i| i << node.attr('docnumber') }
|
68
61
|
end
|
69
62
|
|
70
|
-
def metadata_copyright(node, xml)
|
71
|
-
from = node.attr('copyright-year') || Date.today.year
|
72
|
-
xml.copyright do |c|
|
73
|
-
c.from from
|
74
|
-
c.owner do |owner|
|
75
|
-
owner.organization do |o|
|
76
|
-
o.name 'Cloud Security Alliance'
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
63
|
def title_validate(root)
|
83
64
|
nil
|
84
65
|
end
|
85
66
|
|
86
67
|
def doctype(node)
|
87
|
-
d =
|
68
|
+
d = super
|
88
69
|
unless %w{guidance proposal standard report whitepaper charter policy
|
89
70
|
glossary case-study}.include? d
|
90
71
|
@log.add("Document Attributes", nil,
|
@@ -97,9 +78,12 @@ module Asciidoctor
|
|
97
78
|
def outputs(node, ret)
|
98
79
|
File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
|
99
80
|
presentation_xml_converter(node).convert(@filename + ".xml")
|
100
|
-
html_converter(node).convert(@filename + ".presentation.xml",
|
101
|
-
|
102
|
-
|
81
|
+
html_converter(node).convert(@filename + ".presentation.xml",
|
82
|
+
nil, false, "#{@filename}.html")
|
83
|
+
doc_converter(node).convert(@filename + ".presentation.xml",
|
84
|
+
nil, false, "#{@filename}.doc")
|
85
|
+
pdf_converter(node)&.convert(@filename + ".presentation.xml",
|
86
|
+
nil, false, "#{@filename}.pdf")
|
103
87
|
end
|
104
88
|
|
105
89
|
def validate(doc)
|
data/lib/asciidoctor/csa/csa.rng
CHANGED
@@ -95,6 +95,13 @@
|
|
95
95
|
</include>
|
96
96
|
<define name="csand-standard">
|
97
97
|
<element name="csa-standard">
|
98
|
+
<attribute name="version"/>
|
99
|
+
<attribute name="type">
|
100
|
+
<choice>
|
101
|
+
<value>semantic</value>
|
102
|
+
<value>presentation</value>
|
103
|
+
</choice>
|
104
|
+
</attribute>
|
98
105
|
<ref name="bibdata"/>
|
99
106
|
<zeroOrMore>
|
100
107
|
<ref name="termdocsource"/>
|
@@ -42,8 +42,11 @@
|
|
42
42
|
</define>
|
43
43
|
<define name="xref">
|
44
44
|
<element name="xref">
|
45
|
+
<!-- attribute target { xsd:IDREF }, -->
|
45
46
|
<attribute name="target">
|
46
|
-
<data type="
|
47
|
+
<data type="string">
|
48
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
49
|
+
</data>
|
47
50
|
</attribute>
|
48
51
|
<optional>
|
49
52
|
<attribute name="type">
|
@@ -61,6 +64,11 @@
|
|
61
64
|
</choice>
|
62
65
|
</attribute>
|
63
66
|
</optional>
|
67
|
+
<optional>
|
68
|
+
<attribute name="droploc">
|
69
|
+
<data type="boolean"/>
|
70
|
+
</attribute>
|
71
|
+
</optional>
|
64
72
|
<text/>
|
65
73
|
</element>
|
66
74
|
</define>
|
@@ -578,6 +586,8 @@
|
|
578
586
|
<ref name="ol"/>
|
579
587
|
<ref name="dl"/>
|
580
588
|
<ref name="formula"/>
|
589
|
+
<ref name="quote"/>
|
590
|
+
<ref name="sourcecode"/>
|
581
591
|
</choice>
|
582
592
|
</oneOrMore>
|
583
593
|
</element>
|
@@ -661,6 +671,16 @@
|
|
661
671
|
</choice>
|
662
672
|
</attribute>
|
663
673
|
</optional>
|
674
|
+
<optional>
|
675
|
+
<attribute name="valign">
|
676
|
+
<choice>
|
677
|
+
<value>top</value>
|
678
|
+
<value>middle</value>
|
679
|
+
<value>bottom</value>
|
680
|
+
<value>baseline</value>
|
681
|
+
</choice>
|
682
|
+
</attribute>
|
683
|
+
</optional>
|
664
684
|
<choice>
|
665
685
|
<zeroOrMore>
|
666
686
|
<choice>
|
@@ -697,6 +717,16 @@
|
|
697
717
|
</choice>
|
698
718
|
</attribute>
|
699
719
|
</optional>
|
720
|
+
<optional>
|
721
|
+
<attribute name="valign">
|
722
|
+
<choice>
|
723
|
+
<value>top</value>
|
724
|
+
<value>middle</value>
|
725
|
+
<value>bottom</value>
|
726
|
+
<value>baseline</value>
|
727
|
+
</choice>
|
728
|
+
</attribute>
|
729
|
+
</optional>
|
700
730
|
<choice>
|
701
731
|
<zeroOrMore>
|
702
732
|
<choice>
|
@@ -834,6 +864,13 @@
|
|
834
864
|
</define>
|
835
865
|
<define name="standard-document">
|
836
866
|
<element name="standard-document">
|
867
|
+
<attribute name="version"/>
|
868
|
+
<attribute name="type">
|
869
|
+
<choice>
|
870
|
+
<value>semantic</value>
|
871
|
+
<value>presentation</value>
|
872
|
+
</choice>
|
873
|
+
</attribute>
|
837
874
|
<ref name="bibdata"/>
|
838
875
|
<optional>
|
839
876
|
<ref name="boilerplate"/>
|
@@ -855,7 +892,7 @@
|
|
855
892
|
<oneOrMore>
|
856
893
|
<choice>
|
857
894
|
<ref name="content"/>
|
858
|
-
<ref name="
|
895
|
+
<ref name="abstract"/>
|
859
896
|
<ref name="foreword"/>
|
860
897
|
<ref name="introduction"/>
|
861
898
|
<ref name="acknowledgements"/>
|
@@ -922,6 +959,9 @@
|
|
922
959
|
<optional>
|
923
960
|
<attribute name="script"/>
|
924
961
|
</optional>
|
962
|
+
<optional>
|
963
|
+
<attribute name="type"/>
|
964
|
+
</optional>
|
925
965
|
<optional>
|
926
966
|
<attribute name="obligation">
|
927
967
|
<choice>
|
@@ -961,9 +1001,6 @@
|
|
961
1001
|
</define>
|
962
1002
|
<define name="content-subsection">
|
963
1003
|
<element name="clause">
|
964
|
-
<optional>
|
965
|
-
<attribute name="type"/>
|
966
|
-
</optional>
|
967
1004
|
<ref name="Content-Section"/>
|
968
1005
|
</element>
|
969
1006
|
</define>
|
@@ -992,6 +1029,9 @@
|
|
992
1029
|
</choice>
|
993
1030
|
</attribute>
|
994
1031
|
</optional>
|
1032
|
+
<optional>
|
1033
|
+
<attribute name="type"/>
|
1034
|
+
</optional>
|
995
1035
|
<optional>
|
996
1036
|
<ref name="section-title"/>
|
997
1037
|
</optional>
|
@@ -1011,9 +1051,6 @@
|
|
1011
1051
|
</define>
|
1012
1052
|
<define name="clause">
|
1013
1053
|
<element name="clause">
|
1014
|
-
<optional>
|
1015
|
-
<attribute name="type"/>
|
1016
|
-
</optional>
|
1017
1054
|
<ref name="Clause-Section"/>
|
1018
1055
|
</element>
|
1019
1056
|
</define>
|
@@ -1042,18 +1079,24 @@
|
|
1042
1079
|
</choice>
|
1043
1080
|
</attribute>
|
1044
1081
|
</optional>
|
1082
|
+
<optional>
|
1083
|
+
<attribute name="type"/>
|
1084
|
+
</optional>
|
1045
1085
|
<optional>
|
1046
1086
|
<ref name="section-title"/>
|
1047
1087
|
</optional>
|
1048
1088
|
<group>
|
1049
|
-
<
|
1050
|
-
<
|
1051
|
-
<
|
1052
|
-
|
1053
|
-
|
1054
|
-
<
|
1055
|
-
|
1056
|
-
|
1089
|
+
<choice>
|
1090
|
+
<group>
|
1091
|
+
<zeroOrMore>
|
1092
|
+
<ref name="BasicBlock"/>
|
1093
|
+
</zeroOrMore>
|
1094
|
+
<zeroOrMore>
|
1095
|
+
<ref name="note"/>
|
1096
|
+
</zeroOrMore>
|
1097
|
+
</group>
|
1098
|
+
<ref name="amend"/>
|
1099
|
+
</choice>
|
1057
1100
|
<zeroOrMore>
|
1058
1101
|
<choice>
|
1059
1102
|
<ref name="clause-subsection"/>
|
@@ -1180,6 +1223,9 @@
|
|
1180
1223
|
<optional>
|
1181
1224
|
<attribute name="script"/>
|
1182
1225
|
</optional>
|
1226
|
+
<optional>
|
1227
|
+
<attribute name="type"/>
|
1228
|
+
</optional>
|
1183
1229
|
<optional>
|
1184
1230
|
<attribute name="obligation">
|
1185
1231
|
<choice>
|
@@ -1447,11 +1493,6 @@
|
|
1447
1493
|
</optional>
|
1448
1494
|
</element>
|
1449
1495
|
</define>
|
1450
|
-
<define name="preface_abstract">
|
1451
|
-
<element name="abstract">
|
1452
|
-
<ref name="Basic-Section"/>
|
1453
|
-
</element>
|
1454
|
-
</define>
|
1455
1496
|
<define name="term-clause">
|
1456
1497
|
<element name="clause">
|
1457
1498
|
<optional>
|
@@ -1501,4 +1542,79 @@
|
|
1501
1542
|
<ref name="CitationType"/>
|
1502
1543
|
</element>
|
1503
1544
|
</define>
|
1545
|
+
<define name="amend">
|
1546
|
+
<element name="amend">
|
1547
|
+
<optional>
|
1548
|
+
<attribute name="id">
|
1549
|
+
<data type="ID"/>
|
1550
|
+
</attribute>
|
1551
|
+
</optional>
|
1552
|
+
<attribute name="change">
|
1553
|
+
<choice>
|
1554
|
+
<value>add</value>
|
1555
|
+
<value>modify</value>
|
1556
|
+
<value>delete</value>
|
1557
|
+
</choice>
|
1558
|
+
</attribute>
|
1559
|
+
<optional>
|
1560
|
+
<attribute name="path"/>
|
1561
|
+
</optional>
|
1562
|
+
<optional>
|
1563
|
+
<attribute name="path_end"/>
|
1564
|
+
</optional>
|
1565
|
+
<optional>
|
1566
|
+
<attribute name="title"/>
|
1567
|
+
</optional>
|
1568
|
+
<optional>
|
1569
|
+
<element name="location">
|
1570
|
+
<zeroOrMore>
|
1571
|
+
<ref name="locality"/>
|
1572
|
+
</zeroOrMore>
|
1573
|
+
</element>
|
1574
|
+
</optional>
|
1575
|
+
<zeroOrMore>
|
1576
|
+
<ref name="autonumber"/>
|
1577
|
+
</zeroOrMore>
|
1578
|
+
<optional>
|
1579
|
+
<element name="description">
|
1580
|
+
<zeroOrMore>
|
1581
|
+
<ref name="BasicBlock"/>
|
1582
|
+
</zeroOrMore>
|
1583
|
+
</element>
|
1584
|
+
</optional>
|
1585
|
+
<optional>
|
1586
|
+
<element name="newcontent">
|
1587
|
+
<zeroOrMore>
|
1588
|
+
<ref name="BasicBlock"/>
|
1589
|
+
</zeroOrMore>
|
1590
|
+
</element>
|
1591
|
+
</optional>
|
1592
|
+
<optional>
|
1593
|
+
<element name="description">
|
1594
|
+
<zeroOrMore>
|
1595
|
+
<ref name="BasicBlock"/>
|
1596
|
+
</zeroOrMore>
|
1597
|
+
</element>
|
1598
|
+
</optional>
|
1599
|
+
</element>
|
1600
|
+
</define>
|
1601
|
+
<define name="autonumber">
|
1602
|
+
<element name="autonumber">
|
1603
|
+
<attribute name="type">
|
1604
|
+
<choice>
|
1605
|
+
<value>requirement</value>
|
1606
|
+
<value>recommendation</value>
|
1607
|
+
<value>permission</value>
|
1608
|
+
<value>table</value>
|
1609
|
+
<value>figure</value>
|
1610
|
+
<value>admonition</value>
|
1611
|
+
<value>formula</value>
|
1612
|
+
<value>sourcecode</value>
|
1613
|
+
<value>example</value>
|
1614
|
+
<value>note</value>
|
1615
|
+
</choice>
|
1616
|
+
</attribute>
|
1617
|
+
<text/>
|
1618
|
+
</element>
|
1619
|
+
</define>
|
1504
1620
|
</grammar>
|
@@ -8,6 +8,7 @@ module Asciidoctor
|
|
8
8
|
|
9
9
|
def bibdata_validate(doc)
|
10
10
|
stage_validate(doc)
|
11
|
+
role_validate(doc)
|
11
12
|
end
|
12
13
|
|
13
14
|
def stage_validate(xmldoc)
|
@@ -17,6 +18,16 @@ module Asciidoctor
|
|
17
18
|
@log.add("Document Attributes", nil,
|
18
19
|
"#{stage} is not a recognised status")
|
19
20
|
end
|
21
|
+
|
22
|
+
def role_validate(doc)
|
23
|
+
doc&.xpath("//bibdata/contributor/role[description]")&.each do |r|
|
24
|
+
r["type"] == "author" or next
|
25
|
+
role = r.at("./description").text
|
26
|
+
%w{full-author contributor staff reviewer}.include?(role) or
|
27
|
+
@log.add("Document Attributes", nil,
|
28
|
+
"#{role} is not a recognised role")
|
29
|
+
end
|
30
|
+
end
|
20
31
|
end
|
21
32
|
end
|
22
33
|
end
|
@@ -1,31 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'isodoc'
|
4
|
-
require_relative 'metadata'
|
5
4
|
|
6
5
|
module IsoDoc
|
7
6
|
module Csa
|
8
7
|
module BaseConvert
|
9
|
-
def metadata_init(lang, script, labels)
|
10
|
-
@meta = Metadata.new(lang, script, labels)
|
11
|
-
end
|
12
|
-
|
13
|
-
def annex_name(annex, name, div)
|
14
|
-
div.h1 **{ class: "Annex" } do |t|
|
15
|
-
t << "#{@xrefs.anchor(annex['id'], :label)} "
|
16
|
-
t.br
|
17
|
-
t.b do |b|
|
18
|
-
name&.children&.each { |c2| parse(c2, b) }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def i18n_init(lang, script)
|
24
|
-
super
|
25
|
-
@annex_lbl = "Appendix"
|
26
|
-
@labels["annex"] = "Appendix"
|
27
|
-
end
|
28
|
-
|
29
8
|
def cleanup(docxml)
|
30
9
|
super
|
31
10
|
term_cleanup(docxml)
|