metanorma-csa 1.8.9 → 1.8.13
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 +21 -4
- data/lib/asciidoctor/csa/converter.rb +33 -31
- data/lib/asciidoctor/csa/isodoc.rng +241 -61
- data/lib/asciidoctor/csa/reqt.rng +23 -2
- data/lib/isodoc/csa/base_convert.rb +1 -1
- data/lib/isodoc/csa/csa.standard.xsl +328 -40
- data/lib/isodoc/csa/html/wordstyle.css +12 -1
- data/lib/isodoc/csa/html/wordstyle.scss +12 -1
- data/lib/isodoc/csa/word_convert.rb +4 -5
- data/lib/metanorma/csa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0278402202df1d54400e2484353f2b72e6cc1cb1460b667d612e33ed59866bd8'
|
4
|
+
data.tar.gz: 5b0dc26b3f6ca9a6ebcefae0aab24c489d2cd44375b460fa7de256f49df33241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1777e7470a39065734ebdba76f5b393516e368af17d023028caa91e91f968bff5228fb895ae9838b6eaeb9c27457fadd25a396331074d70043efd58959913051
|
7
|
+
data.tar.gz: f5d341dc22ac44eb35c04ffa55f7bdab25963543eb1f1851e3602563296f573e7793268b10e7a5bc9d70be5ad6e4b61f272e894a78b625a0e1a43324c2a39d87
|
@@ -624,6 +624,9 @@
|
|
624
624
|
<choice>
|
625
625
|
<ref name="PureTextElement"/>
|
626
626
|
<ref name="stem"/>
|
627
|
+
<ref name="eref"/>
|
628
|
+
<ref name="xref"/>
|
629
|
+
<ref name="hyperlink"/>
|
627
630
|
</choice>
|
628
631
|
</zeroOrMore>
|
629
632
|
</element>
|
@@ -634,6 +637,9 @@
|
|
634
637
|
<choice>
|
635
638
|
<ref name="PureTextElement"/>
|
636
639
|
<ref name="stem"/>
|
640
|
+
<ref name="eref"/>
|
641
|
+
<ref name="xref"/>
|
642
|
+
<ref name="hyperlink"/>
|
637
643
|
</choice>
|
638
644
|
</zeroOrMore>
|
639
645
|
</element>
|
@@ -641,7 +647,12 @@
|
|
641
647
|
<define name="tt">
|
642
648
|
<element name="tt">
|
643
649
|
<zeroOrMore>
|
644
|
-
<
|
650
|
+
<choice>
|
651
|
+
<ref name="PureTextElement"/>
|
652
|
+
<ref name="eref"/>
|
653
|
+
<ref name="xref"/>
|
654
|
+
<ref name="hyperlink"/>
|
655
|
+
</choice>
|
645
656
|
</zeroOrMore>
|
646
657
|
</element>
|
647
658
|
</define>
|
@@ -822,7 +833,9 @@
|
|
822
833
|
<attribute name="alt"/>
|
823
834
|
</optional>
|
824
835
|
<ref name="CitationType"/>
|
825
|
-
<
|
836
|
+
<oneOrMore>
|
837
|
+
<ref name="PureTextElement"/>
|
838
|
+
</oneOrMore>
|
826
839
|
</define>
|
827
840
|
<define name="hyperlink">
|
828
841
|
<element name="link">
|
@@ -835,7 +848,9 @@
|
|
835
848
|
<optional>
|
836
849
|
<attribute name="alt"/>
|
837
850
|
</optional>
|
838
|
-
<
|
851
|
+
<oneOrMore>
|
852
|
+
<ref name="PureTextElement"/>
|
853
|
+
</oneOrMore>
|
839
854
|
</element>
|
840
855
|
</define>
|
841
856
|
<define name="xref">
|
@@ -849,7 +864,9 @@
|
|
849
864
|
<optional>
|
850
865
|
<attribute name="alt"/>
|
851
866
|
</optional>
|
852
|
-
<
|
867
|
+
<oneOrMore>
|
868
|
+
<ref name="PureTextElement"/>
|
869
|
+
</oneOrMore>
|
853
870
|
</element>
|
854
871
|
</define>
|
855
872
|
<define name="fn">
|
@@ -1,19 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
3
|
+
require "asciidoctor"
|
4
|
+
require "metanorma-generic"
|
5
|
+
require "isodoc/csa/html_convert"
|
6
|
+
require "isodoc/csa/pdf_convert"
|
7
|
+
require "isodoc/csa/word_convert"
|
8
|
+
require "isodoc/csa/presentation_xml_convert"
|
9
|
+
require "metanorma/csa"
|
10
|
+
require "fileutils"
|
11
11
|
|
12
12
|
module Asciidoctor
|
13
13
|
module Csa
|
14
14
|
class Converter < ::Asciidoctor::Generic::Converter
|
15
|
-
XML_ROOT_TAG = "csa-standard"
|
16
|
-
XML_NAMESPACE = "https://www.metanorma.org/ns/csa"
|
15
|
+
XML_ROOT_TAG = "csa-standard"
|
16
|
+
XML_NAMESPACE = "https://www.metanorma.org/ns/csa"
|
17
17
|
|
18
18
|
register_for "csa"
|
19
19
|
|
@@ -21,46 +21,47 @@ module Asciidoctor
|
|
21
21
|
Metanorma::Csa.configuration
|
22
22
|
end
|
23
23
|
|
24
|
-
def personal_role(node,
|
24
|
+
def personal_role(node, contrib, suffix)
|
25
25
|
role = node.attr("role#{suffix}")&.downcase || "full author"
|
26
|
-
|
26
|
+
contrib.role **{ type: role == "editor" ? "editor" : "author" } do |r|
|
27
27
|
r.description role.strip.gsub(/\s/, "-")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
def metadata_committee(node, xml)
|
32
32
|
return unless node.attr("technical-committee")
|
33
|
+
|
33
34
|
xml.editorialgroup do |a|
|
34
35
|
a.committee node.attr("technical-committee"),
|
35
|
-
|
36
|
+
**attr_code(type: node.attr("technical-committee-type"))
|
36
37
|
i = 2
|
37
|
-
while node.attr("technical-committee_#{i}")
|
38
|
+
while node.attr("technical-committee_#{i}")
|
38
39
|
a.committee node.attr("technical-committee_#{i}"),
|
39
|
-
|
40
|
+
**attr_code(type: node.attr("technical-committee-type_#{i}"))
|
40
41
|
i += 1
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
45
|
-
def title_validate(
|
46
|
+
def title_validate(_root)
|
46
47
|
nil
|
47
48
|
end
|
48
49
|
|
49
50
|
def outputs(node, ret)
|
50
|
-
File.open(@filename
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
|
52
|
+
presentation_xml_converter(node).convert("#{@filename}.xml")
|
53
|
+
html_converter(node).convert("#{@filename}.presentation.xml",
|
54
|
+
nil, false, "#{@filename}.html")
|
55
|
+
doc_converter(node).convert("#{@filename}.presentation.xml",
|
56
|
+
nil, false, "#{@filename}.doc")
|
57
|
+
pdf_converter(node)&.convert("#{@filename}.presentation.xml",
|
58
|
+
nil, false, "#{@filename}.pdf")
|
58
59
|
end
|
59
60
|
|
60
|
-
def sections_cleanup(
|
61
|
+
def sections_cleanup(xml)
|
61
62
|
super
|
62
|
-
|
63
|
-
h.delete(
|
63
|
+
xml.xpath("//*[@inline-header]").each do |h|
|
64
|
+
h.delete("inline-header")
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
@@ -74,13 +75,13 @@ module Asciidoctor
|
|
74
75
|
r["type"] == "author" or next
|
75
76
|
role = r.at("./description").text
|
76
77
|
%w{full-author contributor staff reviewer}.include?(role) or
|
77
|
-
|
78
|
-
|
78
|
+
@log.add("Document Attributes", nil,
|
79
|
+
"#{role} is not a recognised role")
|
79
80
|
end
|
80
81
|
end
|
81
82
|
|
82
|
-
def style(
|
83
|
-
|
83
|
+
def style(_node, _text)
|
84
|
+
nil
|
84
85
|
end
|
85
86
|
|
86
87
|
def html_converter(node)
|
@@ -89,6 +90,7 @@ module Asciidoctor
|
|
89
90
|
|
90
91
|
def pdf_converter(node)
|
91
92
|
return if node.attr("no-pdf")
|
93
|
+
|
92
94
|
IsoDoc::Csa::PdfConvert.new(html_extract_attributes(node))
|
93
95
|
end
|
94
96
|
|