metanorma-generic 1.10.1 → 1.11.0
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 +1 -1
- data/lib/asciidoctor/generic/basicdoc.rng +21 -4
- data/lib/asciidoctor/generic/converter.rb +24 -20
- data/lib/asciidoctor/generic/isodoc.rng +518 -93
- data/lib/asciidoctor/generic/reqt.rng +38 -6
- data/lib/isodoc/generic/html/htmlstyle.scss +8 -0
- data/lib/isodoc/generic.rb +0 -1
- data/lib/metanorma/generic/processor.rb +0 -3
- data/lib/metanorma/generic/version.rb +1 -1
- data/lib/metanorma/generic.rb +21 -17
- data/metanorma-generic.gemspec +1 -2
- metadata +5 -20
- data/lib/isodoc/generic/pdf_convert.rb +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0f723b5f6592e4b954120f9dfbd3da6853cdf357a9361bb4e3514fc2a76a0e7
|
4
|
+
data.tar.gz: f4fa24394f18ed2826e038a83b90d9c67684c005e7be75eb9a35cd0b49a349bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f3a5df30ebbd0bc6de1a4099d8fe4cc2c90c8ddfed32d171ce2ad2de2ce8e0f37d23bc1d689519a6d791914e281d0c6de81b7d48c43e2870a68a49f0aaccf37
|
7
|
+
data.tar.gz: 7e4cb9673702cb3a1da9cbb4bd6f7acf6827cac3889f0a0fc2477ed6c35cd78ed4a4bfcd4aebf1d2138781898eba3b7a6d4b80affc1639ccb1b46699f214e9ba
|
data/.github/workflows/rake.yml
CHANGED
@@ -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">
|
@@ -19,11 +19,13 @@ module Asciidoctor
|
|
19
19
|
configuration.document_namespace || XML_NAMESPACE
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
def baselocation(loc)
|
23
23
|
return nil if loc.nil?
|
24
|
+
|
24
25
|
return loc
|
25
26
|
File.expand_path(File.join(File.dirname(
|
26
|
-
|
27
|
+
self.class::_file || __FILE__,
|
28
|
+
), "..", "..", "..", loc))
|
27
29
|
end
|
28
30
|
|
29
31
|
def docidentifier_cleanup(xmldoc)
|
@@ -36,7 +38,7 @@ module Asciidoctor
|
|
36
38
|
|
37
39
|
def doctype(node)
|
38
40
|
d = super
|
39
|
-
configuration.doctypes or return d == "article" ?
|
41
|
+
configuration.doctypes or return d == "article" ?
|
40
42
|
(configuration.default_doctype || "standard") : d
|
41
43
|
type = configuration.default_doctype ||
|
42
44
|
configuration.doctypes.keys.dig(0) || "standard"
|
@@ -49,18 +51,18 @@ module Asciidoctor
|
|
49
51
|
end
|
50
52
|
|
51
53
|
def read_config_file(path_to_config_file)
|
52
|
-
Metanorma::Generic.configuration
|
53
|
-
set_default_values_from_yaml_file(path_to_config_file)
|
54
|
+
Metanorma::Generic.configuration
|
55
|
+
.set_default_values_from_yaml_file(path_to_config_file)
|
54
56
|
end
|
55
57
|
|
56
58
|
def sectiontype_streamline(ret)
|
57
|
-
if configuration&.termsdefs_titles&.map(&:downcase)&.include?
|
59
|
+
if configuration&.termsdefs_titles&.map(&:downcase)&.include? ret
|
58
60
|
"terms and definitions"
|
59
|
-
elsif configuration&.symbols_titles&.map(&:downcase)&.include?
|
61
|
+
elsif configuration&.symbols_titles&.map(&:downcase)&.include? ret
|
60
62
|
"symbols and abbreviated terms"
|
61
|
-
elsif configuration&.normref_titles&.map(&:downcase)&.include?
|
63
|
+
elsif configuration&.normref_titles&.map(&:downcase)&.include? ret
|
62
64
|
"normative references"
|
63
|
-
elsif configuration&.bibliography_titles&.map(&:downcase)&.include?
|
65
|
+
elsif configuration&.bibliography_titles&.map(&:downcase)&.include? ret
|
64
66
|
"bibliography"
|
65
67
|
else
|
66
68
|
ret
|
@@ -73,15 +75,14 @@ module Asciidoctor
|
|
73
75
|
end
|
74
76
|
|
75
77
|
def outputs(node, ret)
|
76
|
-
File.open(@filename
|
77
|
-
presentation_xml_converter(node)&.convert(@filename
|
78
|
-
html_converter(node)&.convert(@filename
|
78
|
+
File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
|
79
|
+
presentation_xml_converter(node)&.convert("#{@filename}.xml")
|
80
|
+
html_converter(node)&.convert("#{@filename}.presentation.xml",
|
79
81
|
nil, false, "#{@filename}.html")
|
80
|
-
doc_converter(node)&.convert(@filename
|
82
|
+
doc_converter(node)&.convert("#{@filename}.presentation.xml",
|
81
83
|
nil, false, "#{@filename}.doc")
|
82
|
-
pdf_converter(node)&.convert(@filename
|
84
|
+
pdf_converter(node)&.convert("#{@filename}.presentation.xml",
|
83
85
|
nil, false, "#{@filename}.pdf")
|
84
|
-
|
85
86
|
end
|
86
87
|
|
87
88
|
def validate(doc)
|
@@ -106,7 +107,8 @@ module Asciidoctor
|
|
106
107
|
stages.empty? and return
|
107
108
|
stage = xmldoc&.at("//bibdata/status/stage")&.text
|
108
109
|
stages.include? stage or
|
109
|
-
@log.add("Document Attributes", nil,
|
110
|
+
@log.add("Document Attributes", nil,
|
111
|
+
"#{stage} is not a recognised status")
|
110
112
|
end
|
111
113
|
|
112
114
|
def committee_validate(xmldoc)
|
@@ -114,13 +116,14 @@ module Asciidoctor
|
|
114
116
|
committees.empty? and return
|
115
117
|
xmldoc.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
|
116
118
|
committees.include? c.text or
|
117
|
-
@log.add("Document Attributes", nil,
|
119
|
+
@log.add("Document Attributes", nil,
|
120
|
+
"#{c.text} is not a recognised committee")
|
118
121
|
end
|
119
122
|
end
|
120
123
|
|
121
|
-
def sections_cleanup(
|
124
|
+
def sections_cleanup(xml)
|
122
125
|
super
|
123
|
-
|
126
|
+
xml.xpath("//*[@inline-header]").each do |h|
|
124
127
|
h.delete("inline-header")
|
125
128
|
end
|
126
129
|
end
|
@@ -132,7 +135,8 @@ module Asciidoctor
|
|
132
135
|
end
|
133
136
|
|
134
137
|
def presentation_xml_converter(node)
|
135
|
-
IsoDoc::Generic::PresentationXMLConvert
|
138
|
+
IsoDoc::Generic::PresentationXMLConvert
|
139
|
+
.new(html_extract_attributes(node))
|
136
140
|
end
|
137
141
|
|
138
142
|
alias_method :pdf_converter, :html_converter
|