metanorma-generic 1.10.3 → 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/generic/basicdoc.rng +21 -4
- data/lib/asciidoctor/generic/converter.rb +24 -20
- data/lib/asciidoctor/generic/isodoc.rng +497 -88
- data/lib/asciidoctor/generic/reqt.rng +23 -2
- data/lib/isodoc/generic/base_convert.rb +4 -3
- data/lib/isodoc/generic/html/generic.scss +0 -1
- data/lib/isodoc/generic/html/htmlstyle.scss +12 -1
- data/lib/isodoc/generic/html/scripts.html +0 -1
- data/lib/metanorma/generic/version.rb +1 -1
- data/lib/metanorma/generic.rb +27 -35
- data/metanorma-generic.gemspec +2 -3
- metadata +10 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97de85e9d88318cf3718865280ca5e855bce23377442c9316d0dc9923227e63e
|
4
|
+
data.tar.gz: a46b6d97a7be1e38c57092d8789451d5a7851f2f0e617ab88dfe3ec16e6615ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e80f83a0195978fe797dede990db71f346540d7e11b5ee4b5f54bda2d2790127aaa7e665b77d906048334d9195bd4cb7b698259c64b331c0af0d0f55f5c7f74
|
7
|
+
data.tar.gz: 4cd866cb0d250759e77d89ef7b91a3ceb380e79f6e04e9ef74d0d0b76c94cfb15f09ad206b2a184540ade1fee7cc10163898389eb17caddc5f120321329f4316
|
@@ -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
|