metanorma-cc 1.5.5 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +62 -0
- data/README.adoc +5 -6
- data/lib/asciidoctor/cc/basicdoc.rng +50 -3
- data/lib/asciidoctor/cc/cc.rng +1 -1
- data/lib/asciidoctor/cc/converter.rb +19 -26
- data/lib/asciidoctor/cc/isodoc.rng +36 -43
- data/lib/asciidoctor/cc/validate_section.rb +2 -1
- data/lib/isodoc/cc/base_convert.rb +2 -12
- data/lib/isodoc/cc/csd.standard.xsl +299 -68
- data/lib/isodoc/cc/html/_coverpage.css +4 -0
- data/lib/isodoc/cc/html/cc.css +20 -21
- data/lib/isodoc/cc/html/cc.scss +20 -21
- data/lib/isodoc/cc/html/htmlstyle.css +656 -648
- data/lib/isodoc/cc/html/htmlstyle.scss +3 -4
- data/lib/isodoc/cc/html/wordstyle.css +19 -19
- data/lib/isodoc/cc/html/wordstyle.scss +19 -19
- data/lib/isodoc/cc/html_convert.rb +2 -38
- data/lib/isodoc/cc/i18n.rb +3 -4
- data/lib/isodoc/cc/init.rb +2 -1
- data/lib/isodoc/cc/metadata.rb +6 -22
- data/lib/isodoc/cc/pdf_convert.rb +1 -0
- data/lib/isodoc/cc/presentation_xml_convert.rb +2 -1
- data/lib/isodoc/cc/word_convert.rb +2 -25
- data/lib/isodoc/cc/xref.rb +1 -1
- data/lib/metanorma/cc.rb +23 -20
- data/lib/metanorma/cc/processor.rb +11 -9
- data/lib/metanorma/cc/version.rb +1 -1
- data/metanorma-cc.gemspec +1 -2
- data/metanorma.yml +58 -0
- metadata +7 -24
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -56
- data/.github/workflows/windows.yml +0 -40
- data/lib/asciidoctor/cc/front.rb +0 -67
- data/lib/asciidoctor/cc/validate.rb +0 -29
data/lib/asciidoctor/cc/front.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
require "asciidoctor"
|
2
|
-
require "asciidoctor/standoc/converter"
|
3
|
-
require "fileutils"
|
4
|
-
|
5
|
-
module Asciidoctor
|
6
|
-
module CC
|
7
|
-
class Converter < Standoc::Converter
|
8
|
-
def default_publisher
|
9
|
-
"CalConnect"
|
10
|
-
end
|
11
|
-
|
12
|
-
def metadata_committee(node, xml)
|
13
|
-
return unless node.attr("technical-committee")
|
14
|
-
xml.editorialgroup do |a|
|
15
|
-
a.technical_committee node.attr("technical-committee"),
|
16
|
-
**attr_code(type: node.attr("technical-committee-type"))
|
17
|
-
i = 2
|
18
|
-
while node.attr("technical-committee_#{i}") do
|
19
|
-
a.technical_committee node.attr("technical-committee_#{i}"),
|
20
|
-
**attr_code(type: node.attr("technical-committee-type_#{i}"))
|
21
|
-
i += 1
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def metadata_status(node, xml)
|
27
|
-
status = node.attr("status")
|
28
|
-
unless status && ::Metanorma::CC::DOCSTATUS.keys.include?(status)
|
29
|
-
@log.add("Document Attributes", nil, "#{status} is not a legal status")
|
30
|
-
end
|
31
|
-
super
|
32
|
-
end
|
33
|
-
|
34
|
-
def prefix_id(node)
|
35
|
-
prefix = "CC"
|
36
|
-
typesuffix = ::Metanorma::CC::DOCSUFFIX[doctype(node)] || ""
|
37
|
-
prefix += "/#{typesuffix}" unless typesuffix.empty?
|
38
|
-
status = ::Metanorma::CC::DOCSTATUS[node.attr("status")] || ""
|
39
|
-
prefix += "/#{status}" unless status.empty?
|
40
|
-
prefix
|
41
|
-
end
|
42
|
-
|
43
|
-
def metadata_id(node, xml)
|
44
|
-
id = node.attr("docnumber") || "???"
|
45
|
-
prefix = prefix_id(node)
|
46
|
-
id = "#{prefix} #{id}"
|
47
|
-
year = node.attr("copyright-year")
|
48
|
-
id += ":#{year}" if year
|
49
|
-
xml.docidentifier id, **{type: "CalConnect"}
|
50
|
-
xml.docnumber node.attr("docnumber")
|
51
|
-
end
|
52
|
-
|
53
|
-
@log_doctype = false
|
54
|
-
|
55
|
-
def doctype(node)
|
56
|
-
d = super
|
57
|
-
unless ::Metanorma::CC::DOCSUFFIX.keys.include?(d) && !@log_doctype
|
58
|
-
@log.add("Document Attributes", nil,
|
59
|
-
"#{d} is not a legal document type: reverting to 'standard'")
|
60
|
-
@log_doctype = true
|
61
|
-
d = "standard"
|
62
|
-
end
|
63
|
-
d
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Asciidoctor
|
2
|
-
module CC
|
3
|
-
class Converter < Standoc::Converter
|
4
|
-
def content_validate(doc)
|
5
|
-
super
|
6
|
-
bibdata_validate(doc.root)
|
7
|
-
end
|
8
|
-
|
9
|
-
def bibdata_validate(doc)
|
10
|
-
doctype_validate(doc)
|
11
|
-
stage_validate(doc)
|
12
|
-
end
|
13
|
-
|
14
|
-
def doctype_validate(xmldoc)
|
15
|
-
doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
|
16
|
-
%w(directive guide specification standard report administrative amendment
|
17
|
-
technical-corrigendum advisory).include?(doctype) or
|
18
|
-
@log.add("Document Attributes", nil, "#{doctype} is not a recognised document type")
|
19
|
-
end
|
20
|
-
|
21
|
-
def stage_validate(xmldoc)
|
22
|
-
stage = xmldoc&.at("//bibdata/status/stage")&.text
|
23
|
-
%w(proposal working-draft committee-draft draft-standard final-draft
|
24
|
-
published withdrawn).include?(stage) or
|
25
|
-
@log.add("Document Attributes", nil, "#{stage} is not a recognised status")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|