metanorma-standoc 2.8.3 → 2.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/base.rb +15 -112
- data/lib/metanorma/standoc/cleanup_image.rb +1 -2
- data/lib/metanorma/standoc/cleanup_xref.rb +5 -10
- data/lib/metanorma/standoc/converter.rb +5 -0
- data/lib/metanorma/standoc/init.rb +114 -0
- data/lib/metanorma/standoc/inline.rb +1 -1
- data/lib/metanorma/standoc/macros_embed.rb +30 -7
- data/lib/metanorma/standoc/macros_inline.rb +1 -1
- data/lib/metanorma/standoc/ref_queue.rb +1 -2
- data/lib/metanorma/standoc/validate.rb +2 -2
- data/lib/metanorma/standoc/validate_section.rb +3 -3
- data/lib/metanorma/standoc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c543029f3b14b657d9688b9fd220df2a476c0d34a50eafd89bc7a94342a59fe0
|
4
|
+
data.tar.gz: 6c84b411e9fd00947893827f821a63f6877b3fab227873611fe76e6793776bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb65532e33f4114c5a268094f26053338b5dc56911f1801d3a78b4f61b6f1e9ed5d5689d2a6cf22a02d2c06266fb1758a809edf078c353933222c4fd64eba552
|
7
|
+
data.tar.gz: 9b2b1c7bd047da5dc81128e00f04da4b4f9e735699e542568665577167889ad9b671bad82fa72b4147f85a3263aa7a6e2923b1b444fe33f97e48f62c0bd9e0d8
|
@@ -8,6 +8,7 @@ require "fileutils"
|
|
8
8
|
require "metanorma-utils"
|
9
9
|
require_relative "render"
|
10
10
|
require_relative "localbib"
|
11
|
+
require_relative "init"
|
11
12
|
require "mn-requirements"
|
12
13
|
|
13
14
|
module Metanorma
|
@@ -27,116 +28,6 @@ module Metanorma
|
|
27
28
|
self.class::XML_NAMESPACE
|
28
29
|
end
|
29
30
|
|
30
|
-
def init(node)
|
31
|
-
init_vars
|
32
|
-
init_misc(node)
|
33
|
-
init_processing(node)
|
34
|
-
init_reqt(node)
|
35
|
-
init_toc(node)
|
36
|
-
init_output(node) # feeds init_biblio
|
37
|
-
init_i18n(node)
|
38
|
-
init_biblio(node)
|
39
|
-
@metadata_attrs = metadata_attrs(node)
|
40
|
-
end
|
41
|
-
|
42
|
-
def init_vars
|
43
|
-
@log = Metanorma::Utils::Log.new # for error reporting downstream
|
44
|
-
@fn_number ||= 0
|
45
|
-
@refids = Set.new
|
46
|
-
@anchor_alias = {}
|
47
|
-
@anchors = {}
|
48
|
-
@internal_eref_namespaces = []
|
49
|
-
@seen_headers = []
|
50
|
-
@seen_headers_canonical = []
|
51
|
-
@embed_hdr = []
|
52
|
-
@reqt_model = nil
|
53
|
-
@preface = true
|
54
|
-
end
|
55
|
-
|
56
|
-
def init_misc(node)
|
57
|
-
@doctype = doctype(node)
|
58
|
-
@draft = node.attributes.has_key?("draft")
|
59
|
-
@index_terms = node.attr("index-terms")
|
60
|
-
@boilerplateauthority = node.attr("boilerplate-authority")
|
61
|
-
@embed_hdr = node.attr("embed_hdr")
|
62
|
-
@embed_id = node.attr("embed_id")
|
63
|
-
@document_scheme = node.attr("document-scheme")
|
64
|
-
@xrefstyle = node.attr("xrefstyle")
|
65
|
-
@source_linenums = node.attr("source-linenums-option") == "true"
|
66
|
-
end
|
67
|
-
|
68
|
-
def init_processing(node)
|
69
|
-
@novalid = node.attr("novalid")
|
70
|
-
@smartquotes = node.attr("smartquotes") != "false"
|
71
|
-
@keepasciimath = node.attr("mn-keep-asciimath") &&
|
72
|
-
node.attr("mn-keep-asciimath") != "false"
|
73
|
-
@sourcecode_markup_start = node.attr("sourcecode-markup-start") || "{{{"
|
74
|
-
@sourcecode_markup_end = node.attr("sourcecode-markup-end") || "}}}"
|
75
|
-
@datauriimage = node.attr("data-uri-image") != "false"
|
76
|
-
@blockunnumbered = (node.attr("block-unnumbered") || "").split(",")
|
77
|
-
.map(&:strip)
|
78
|
-
end
|
79
|
-
|
80
|
-
def init_reqt(node)
|
81
|
-
@default_requirement_model = node.attr("requirements-model") ||
|
82
|
-
default_requirement_model
|
83
|
-
@reqt_models = requirements_processor
|
84
|
-
.new({ default: @default_requirement_model })
|
85
|
-
end
|
86
|
-
|
87
|
-
def init_toc(node)
|
88
|
-
@htmltoclevels = node.attr("toclevels-html") ||
|
89
|
-
node.attr("htmltoclevels") ||
|
90
|
-
node.attr("toclevels") || toc_default[:html_levels]
|
91
|
-
@doctoclevels = node.attr("toclevels-doc") ||
|
92
|
-
node.attr("doctoclevels") || node.attr("toclevels") ||
|
93
|
-
toc_default[:word_levels]
|
94
|
-
@pdftoclevels = node.attr("toclevels-pdf") ||
|
95
|
-
node.attr("toclevels") || toc_default[:pdf_levels]
|
96
|
-
@toclevels = node.attr("toclevels") || toc_default[:html_levels]
|
97
|
-
@tocfigures = node.attr("toc-figures")
|
98
|
-
@toctables = node.attr("toc-tables")
|
99
|
-
@tocrecommendations = node.attr("toc-recommendations")
|
100
|
-
end
|
101
|
-
|
102
|
-
def toc_default
|
103
|
-
{ word_levels: 2, html_levels: 2, pdf_levels: 2 }
|
104
|
-
end
|
105
|
-
|
106
|
-
def init_output(node)
|
107
|
-
@fontheader = default_fonts(node)
|
108
|
-
@files_to_delete = []
|
109
|
-
@filename = if node.attr("docfile")
|
110
|
-
File.basename(node.attr("docfile"))&.gsub(/\.adoc$/, "")
|
111
|
-
else ""
|
112
|
-
end
|
113
|
-
@localdir = Metanorma::Utils::localdir(node)
|
114
|
-
@output_dir = outputdir node
|
115
|
-
end
|
116
|
-
|
117
|
-
def init_i18n(node)
|
118
|
-
@lang = node.attr("language") || "en"
|
119
|
-
@script = node.attr("script") ||
|
120
|
-
Metanorma::Utils.default_script(node.attr("language"))
|
121
|
-
@locale = node.attr("locale")
|
122
|
-
@isodoc = isodoc(@lang, @script, @locale, node.attr("i18nyaml"))
|
123
|
-
@i18n = @isodoc.i18n
|
124
|
-
end
|
125
|
-
|
126
|
-
def init_biblio(node)
|
127
|
-
@no_isobib_cache = node.attr("no-isobib-cache")
|
128
|
-
@no_isobib = node.attr("no-isobib")
|
129
|
-
@bibdb = nil
|
130
|
-
init_bib_caches(node)
|
131
|
-
init_iev_caches(node)
|
132
|
-
@local_bibdb =
|
133
|
-
::Metanorma::Standoc::LocalBiblio.new(node, @localdir, self)
|
134
|
-
end
|
135
|
-
|
136
|
-
def requirements_processor
|
137
|
-
Metanorma::Requirements
|
138
|
-
end
|
139
|
-
|
140
31
|
def document(node)
|
141
32
|
ret = document1(node)
|
142
33
|
clean_exit
|
@@ -179,7 +70,8 @@ module Metanorma
|
|
179
70
|
end
|
180
71
|
|
181
72
|
def clean_exit
|
182
|
-
|
73
|
+
!@novalid && @local_log and
|
74
|
+
@log.write("#{@output_dir}#{@filename}.err.html")
|
183
75
|
@files_to_delete.each { |f| FileUtils.rm f }
|
184
76
|
end
|
185
77
|
|
@@ -233,7 +125,7 @@ module Metanorma
|
|
233
125
|
end
|
234
126
|
|
235
127
|
def metadata_attrs(node)
|
236
|
-
node.attributes.each_with_object([]) do |(k, v), ret|
|
128
|
+
out = node.attributes.each_with_object([]) do |(k, v), ret|
|
237
129
|
%w(presentation semantic).each do |t|
|
238
130
|
/^#{t}-metadata-/.match?(k) or next
|
239
131
|
k = k.sub(/^#{t}-metadata-/, "")
|
@@ -242,6 +134,17 @@ module Metanorma
|
|
242
134
|
end
|
243
135
|
end
|
244
136
|
end.join
|
137
|
+
out + document_scheme_metadata(node)
|
138
|
+
end
|
139
|
+
|
140
|
+
def document_scheme_metadata(node)
|
141
|
+
a = document_scheme(node) or return ""
|
142
|
+
"<presentation-metadata><name>document-scheme</name>" \
|
143
|
+
"<value>#{a}</value></presentation-metadata>"
|
144
|
+
end
|
145
|
+
|
146
|
+
def document_scheme(node)
|
147
|
+
node.attr("document-scheme")
|
245
148
|
end
|
246
149
|
|
247
150
|
private
|
@@ -4,7 +4,6 @@ module Metanorma
|
|
4
4
|
module Standoc
|
5
5
|
module Cleanup
|
6
6
|
def svgmap_cleanup(xmldoc)
|
7
|
-
svg_uniqueids(xmldoc)
|
8
7
|
svgmap_moveattrs(xmldoc)
|
9
8
|
svgmap_populate(xmldoc)
|
10
9
|
Vectory::SvgMapping.new(xmldoc, @localdir).call
|
@@ -82,7 +81,7 @@ module Metanorma
|
|
82
81
|
types = MIME::Types.type_for(path) or return false
|
83
82
|
types.first == "image/svg+xml" or return false
|
84
83
|
svg = File.read(path, encoding: "utf-8") or return false
|
85
|
-
img.
|
84
|
+
img.children = (Nokogiri::XML(svg).root)
|
86
85
|
true
|
87
86
|
end
|
88
87
|
|
@@ -76,9 +76,8 @@ module Metanorma
|
|
76
76
|
def extract_localities_update_text(match)
|
77
77
|
ret = match[:text]
|
78
78
|
re = to_regex(LOCALITY_REGEX_VALUE_ONLY_STR)
|
79
|
-
|
79
|
+
re.match?(ret) && match[:punct] == ";" and
|
80
80
|
ret.sub!(%r{^(#{CONN_REGEX_STR})}o, "\\1#{match[:locality]}=")
|
81
|
-
end
|
82
81
|
ret
|
83
82
|
end
|
84
83
|
|
@@ -93,15 +92,13 @@ module Metanorma
|
|
93
92
|
end
|
94
93
|
|
95
94
|
def fill_in_eref_connectives(elem)
|
96
|
-
|
97
|
-
|
95
|
+
elem.xpath("./localityStack").size < 2 and return
|
98
96
|
elem.xpath("./localityStack[not(@connective)]").each do |l|
|
99
97
|
n = l.next_element
|
100
98
|
l["connective"] = if n && n.name == "localityStack" &&
|
101
99
|
n["connective"] == "to"
|
102
100
|
"from"
|
103
|
-
else "and"
|
104
|
-
end
|
101
|
+
else "and" end
|
105
102
|
end
|
106
103
|
end
|
107
104
|
|
@@ -193,9 +190,8 @@ module Metanorma
|
|
193
190
|
def xref_parse_compound_locations(locations)
|
194
191
|
l = locations.map { |y| y.split("!", 2) }
|
195
192
|
l.map.with_index do |y, i|
|
196
|
-
|
193
|
+
y.size == 1 and
|
197
194
|
y.unshift(l.dig(i + 1, 0) == "to" ? "from" : "and")
|
198
|
-
end
|
199
195
|
y
|
200
196
|
end
|
201
197
|
end
|
@@ -209,8 +205,7 @@ module Metanorma
|
|
209
205
|
def xref_cleanup1(xmldoc)
|
210
206
|
xmldoc.xpath("//xref").each do |x|
|
211
207
|
%r{:(?!//)}.match?(x["target"]) and xref_to_internal_eref(x)
|
212
|
-
|
213
|
-
|
208
|
+
x.name == "xref" or next
|
214
209
|
if refid? x["target"]
|
215
210
|
xref_to_eref(x, "eref")
|
216
211
|
elsif @anchor_alias[x["target"]] then xref_alias(x)
|
@@ -21,6 +21,7 @@ module Metanorma
|
|
21
21
|
# schema encapsulation of the document for validation
|
22
22
|
class Converter
|
23
23
|
Asciidoctor::Extensions.register do
|
24
|
+
preprocessor Metanorma::Standoc::ResolveIncludePreprocessor
|
24
25
|
preprocessor Metanorma::Plugin::Lutaml::LutamlPreprocessor
|
25
26
|
preprocessor Metanorma::Plugin::Lutaml::LutamlUmlAttributesTablePreprocessor
|
26
27
|
preprocessor Metanorma::Plugin::Lutaml::LutamlUmlDatamodelDescriptionPreprocessor
|
@@ -100,6 +101,10 @@ module Metanorma
|
|
100
101
|
outfilesuffix ".xml"
|
101
102
|
@libdir = File.dirname(self.class::_file || __FILE__)
|
102
103
|
@c = HTMLEntities.new
|
104
|
+
unless opts && @log = opts[:document]&.options&.dig(:log)
|
105
|
+
@log = Metanorma::Utils::Log.new
|
106
|
+
@local_log = true
|
107
|
+
end
|
103
108
|
end
|
104
109
|
|
105
110
|
class << self
|
@@ -0,0 +1,114 @@
|
|
1
|
+
module Metanorma
|
2
|
+
module Standoc
|
3
|
+
module Base
|
4
|
+
def init(node)
|
5
|
+
init_vars
|
6
|
+
init_misc(node)
|
7
|
+
init_processing(node)
|
8
|
+
init_reqt(node)
|
9
|
+
init_toc(node)
|
10
|
+
init_output(node) # feeds init_biblio
|
11
|
+
init_i18n(node)
|
12
|
+
init_biblio(node)
|
13
|
+
@metadata_attrs = metadata_attrs(node)
|
14
|
+
end
|
15
|
+
|
16
|
+
def init_vars
|
17
|
+
@fn_number ||= 0
|
18
|
+
@refids = Set.new
|
19
|
+
@anchor_alias = {}
|
20
|
+
@anchors = {}
|
21
|
+
@internal_eref_namespaces = []
|
22
|
+
@seen_headers = []
|
23
|
+
@seen_headers_canonical = []
|
24
|
+
@embed_hdr = []
|
25
|
+
@reqt_model = nil
|
26
|
+
@preface = true
|
27
|
+
end
|
28
|
+
|
29
|
+
def init_misc(node)
|
30
|
+
@doctype = doctype(node)
|
31
|
+
@draft = node.attributes.has_key?("draft")
|
32
|
+
@index_terms = node.attr("index-terms")
|
33
|
+
@boilerplateauthority = node.attr("boilerplate-authority")
|
34
|
+
@embed_hdr = node.attr("embed_hdr")
|
35
|
+
@embed_id = node.attr("embed_id")
|
36
|
+
@document_scheme = node.attr("document-scheme")
|
37
|
+
@xrefstyle = node.attr("xrefstyle")
|
38
|
+
@source_linenums = node.attr("source-linenums-option") == "true"
|
39
|
+
end
|
40
|
+
|
41
|
+
def init_processing(node)
|
42
|
+
@novalid = node.attr("novalid")
|
43
|
+
@smartquotes = node.attr("smartquotes") != "false"
|
44
|
+
@keepasciimath = node.attr("mn-keep-asciimath") &&
|
45
|
+
node.attr("mn-keep-asciimath") != "false"
|
46
|
+
@sourcecode_markup_start = node.attr("sourcecode-markup-start") || "{{{"
|
47
|
+
@sourcecode_markup_end = node.attr("sourcecode-markup-end") || "}}}"
|
48
|
+
@datauriimage = node.attr("data-uri-image") != "false"
|
49
|
+
@blockunnumbered = (node.attr("block-unnumbered") || "").split(",")
|
50
|
+
.map(&:strip)
|
51
|
+
end
|
52
|
+
|
53
|
+
def init_reqt(node)
|
54
|
+
@default_requirement_model = node.attr("requirements-model") ||
|
55
|
+
default_requirement_model
|
56
|
+
@reqt_models = requirements_processor
|
57
|
+
.new({ default: @default_requirement_model })
|
58
|
+
end
|
59
|
+
|
60
|
+
def init_toc(node)
|
61
|
+
@htmltoclevels = node.attr("toclevels-html") ||
|
62
|
+
node.attr("htmltoclevels") ||
|
63
|
+
node.attr("toclevels") || toc_default[:html_levels]
|
64
|
+
@doctoclevels = node.attr("toclevels-doc") ||
|
65
|
+
node.attr("doctoclevels") || node.attr("toclevels") ||
|
66
|
+
toc_default[:word_levels]
|
67
|
+
@pdftoclevels = node.attr("toclevels-pdf") ||
|
68
|
+
node.attr("toclevels") || toc_default[:pdf_levels]
|
69
|
+
@toclevels = node.attr("toclevels") || toc_default[:html_levels]
|
70
|
+
@tocfigures = node.attr("toc-figures")
|
71
|
+
@toctables = node.attr("toc-tables")
|
72
|
+
@tocrecommendations = node.attr("toc-recommendations")
|
73
|
+
end
|
74
|
+
|
75
|
+
def toc_default
|
76
|
+
{ word_levels: 2, html_levels: 2, pdf_levels: 2 }
|
77
|
+
end
|
78
|
+
|
79
|
+
def init_output(node)
|
80
|
+
@fontheader = default_fonts(node)
|
81
|
+
@files_to_delete = []
|
82
|
+
@filename = if node.attr("docfile")
|
83
|
+
File.basename(node.attr("docfile"))&.gsub(/\.adoc$/, "")
|
84
|
+
else ""
|
85
|
+
end
|
86
|
+
@localdir = Metanorma::Utils::localdir(node)
|
87
|
+
@output_dir = outputdir node
|
88
|
+
end
|
89
|
+
|
90
|
+
def init_i18n(node)
|
91
|
+
@lang = node.attr("language") || "en"
|
92
|
+
@script = node.attr("script") ||
|
93
|
+
Metanorma::Utils.default_script(node.attr("language"))
|
94
|
+
@locale = node.attr("locale")
|
95
|
+
@isodoc = isodoc(@lang, @script, @locale, node.attr("i18nyaml"))
|
96
|
+
@i18n = @isodoc.i18n
|
97
|
+
end
|
98
|
+
|
99
|
+
def init_biblio(node)
|
100
|
+
@no_isobib_cache = node.attr("no-isobib-cache")
|
101
|
+
@no_isobib = node.attr("no-isobib")
|
102
|
+
@bibdb = nil
|
103
|
+
init_bib_caches(node)
|
104
|
+
init_iev_caches(node)
|
105
|
+
@local_bibdb =
|
106
|
+
::Metanorma::Standoc::LocalBiblio.new(node, @localdir, self)
|
107
|
+
end
|
108
|
+
|
109
|
+
def requirements_processor
|
110
|
+
Metanorma::Requirements
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -30,7 +30,7 @@ module Metanorma
|
|
30
30
|
results = Plurimath::Math.parse(lxm_input, "latex")
|
31
31
|
.to_mathml(display_style: block)
|
32
32
|
if results.nil?
|
33
|
-
@log.add("
|
33
|
+
@log.add("Maths", nil,
|
34
34
|
"latexmlmath failed to process equation:\n#{lxm_input}",
|
35
35
|
severity: 1)
|
36
36
|
return
|
@@ -2,14 +2,37 @@ require "pathname"
|
|
2
2
|
|
3
3
|
module Asciidoctor
|
4
4
|
class PreprocessorNoIfdefsReader < PreprocessorReader
|
5
|
-
|
5
|
+
private
|
6
|
+
|
7
|
+
def preprocess_conditional_directive(_keyword, _target, _delimiter, _text)
|
6
8
|
false # decline to resolve idefs
|
7
9
|
end
|
10
|
+
|
11
|
+
def resolve_include_path(expanded_target, attrlist, parsed_attrs)
|
12
|
+
inc_path, target_type, relpath = super
|
13
|
+
if inc_path && !%i(file uri).include?(target_type)
|
14
|
+
# include has been skipped because of error
|
15
|
+
n = peek_line(true)
|
16
|
+
/^Unresolved directive in/.match?(n) and
|
17
|
+
@document.converter.log
|
18
|
+
&.add("Include", nil,
|
19
|
+
HTMLEntities.new.encode(n, :basic), severity: 0)
|
20
|
+
end
|
21
|
+
[inc_path, target_type, relpath]
|
22
|
+
end
|
8
23
|
end
|
9
24
|
end
|
10
25
|
|
11
26
|
module Metanorma
|
12
27
|
module Standoc
|
28
|
+
# resolve all includes before doing any further preprocessing
|
29
|
+
class ResolveIncludePreprocessor < Asciidoctor::Extensions::Preprocessor
|
30
|
+
def process(doc, reader)
|
31
|
+
r = ::Asciidoctor::PreprocessorNoIfdefsReader.new doc, reader.lines
|
32
|
+
::Asciidoctor::PreprocessorNoIfdefsReader.new doc, r.readlines
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
13
36
|
class EmbedIncludeProcessor < Asciidoctor::Extensions::Preprocessor
|
14
37
|
def process(doc, reader)
|
15
38
|
reader.eof? and return reader
|
@@ -44,12 +67,12 @@ module Metanorma
|
|
44
67
|
reader = ::Asciidoctor::PreprocessorReader.new doc
|
45
68
|
b = Pathname.new doc.base_dir
|
46
69
|
ret.reverse.each do |l|
|
47
|
-
if l[:file]
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
else reader.unshift_lines l[:lines]
|
52
|
-
end
|
70
|
+
# if l[:file]
|
71
|
+
# new = Pathname.new(l[:path]).relative_path_from(b).to_s
|
72
|
+
# reader.push_include l[:lines], new, l[:path]
|
73
|
+
reader.unshift_lines l[:lines]
|
74
|
+
# else reader.unshift_lines l[:lines]
|
75
|
+
# end
|
53
76
|
end
|
54
77
|
reader
|
55
78
|
end
|
@@ -27,7 +27,7 @@ module Metanorma
|
|
27
27
|
attrs.size > 1 && attrs.size < 5 and return true
|
28
28
|
e = "invalid index \"#{target}\" cross-reference: wrong number of " \
|
29
29
|
"attributes in `index:#{target}[#{attrs.values.join(',')}]`"
|
30
|
-
parent.converter.log.add("
|
30
|
+
parent.converter.log.add("Crossreferences", parent, e, severity: 0)
|
31
31
|
false
|
32
32
|
end
|
33
33
|
|
@@ -213,8 +213,7 @@ module Metanorma
|
|
213
213
|
end
|
214
214
|
|
215
215
|
def init_bib_caches(node)
|
216
|
-
|
217
|
-
|
216
|
+
@no_isobib and return
|
218
217
|
global = !@no_isobib_cache && !node.attr("local-cache-only")
|
219
218
|
local = node.attr("local-cache") || node.attr("local-cache-only")
|
220
219
|
local = nil if @no_isobib_cache
|
@@ -53,7 +53,7 @@ module Metanorma
|
|
53
53
|
orig = ""
|
54
54
|
a and orig += "\n\tAsciimath original: #{@c.decode(a.children.to_xml)}"
|
55
55
|
l and orig += "\n\tLatexmath original: #{@c.decode(l.children.to_xml)}"
|
56
|
-
@log.add("
|
56
|
+
@log.add("Maths", elem,
|
57
57
|
"Invalid MathML: #{math}\n #{error}#{orig}", severity: 0)
|
58
58
|
end
|
59
59
|
|
@@ -83,7 +83,7 @@ module Metanorma
|
|
83
83
|
outer.name == "figure" && inner.name == "figure" and return
|
84
84
|
err =
|
85
85
|
"There is an instance of #{inner.name} nested within #{outer.name}"
|
86
|
-
@log.add("
|
86
|
+
@log.add("Style", inner, err)
|
87
87
|
nested_asset_xref_report(outer, inner, doc)
|
88
88
|
end
|
89
89
|
|
@@ -21,14 +21,14 @@ module Metanorma
|
|
21
21
|
if callouts.size != annotations.size && !annotations.empty?
|
22
22
|
err = "mismatch of callouts (#{callouts.size}) and annotations " \
|
23
23
|
"(#{annotations.size})"
|
24
|
-
@log.add("
|
24
|
+
@log.add("Crossreferences", elem, err, severity: 0)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
def style_warning(node, msg, text = nil)
|
29
29
|
w = msg
|
30
30
|
w += ": #{text}" if text
|
31
|
-
@log.add("
|
31
|
+
@log.add("Style", node, w)
|
32
32
|
end
|
33
33
|
|
34
34
|
def asset_title_style(root)
|
@@ -61,7 +61,7 @@ module Metanorma
|
|
61
61
|
docid = b.at("./docidentifier[@type = 'metanorma']") or next
|
62
62
|
/^\[\d+\]$/.match?(docid.text) or next
|
63
63
|
@log.add("Bibliography", b,
|
64
|
-
"Numeric reference in normative references", severity:
|
64
|
+
"Numeric reference in normative references", severity: 1)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-standoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -503,6 +503,7 @@ files:
|
|
503
503
|
- lib/metanorma/standoc/front.rb
|
504
504
|
- lib/metanorma/standoc/front_contributor.rb
|
505
505
|
- lib/metanorma/standoc/front_organisation.rb
|
506
|
+
- lib/metanorma/standoc/init.rb
|
506
507
|
- lib/metanorma/standoc/inline.rb
|
507
508
|
- lib/metanorma/standoc/isodoc-compile.rng
|
508
509
|
- lib/metanorma/standoc/isodoc.rng
|