metanorma-standoc 2.9.5 → 2.9.7
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/isodoc/html/htmlstyle.css +4 -1
- data/lib/metanorma/standoc/base.rb +8 -8
- data/lib/metanorma/standoc/basicdoc.rng +909 -464
- data/lib/metanorma/standoc/biblio-standoc.rng +87 -20
- data/lib/metanorma/standoc/biblio.rng +884 -325
- data/lib/metanorma/standoc/blocks.rb +1 -1
- data/lib/metanorma/standoc/cleanup.rb +4 -2
- data/lib/metanorma/standoc/cleanup_bibitem.rb +18 -6
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +9 -93
- data/lib/metanorma/standoc/cleanup_inline.rb +1 -1
- data/lib/metanorma/standoc/cleanup_maths.rb +51 -101
- data/lib/metanorma/standoc/cleanup_mathvariant.rb +88 -0
- data/lib/metanorma/standoc/cleanup_terms.rb +4 -1
- data/lib/metanorma/standoc/cleanup_terms_boilerplate.rb +106 -0
- data/lib/metanorma/standoc/cleanup_terms_designations.rb +1 -2
- data/lib/metanorma/standoc/cleanup_text.rb +11 -4
- data/lib/metanorma/standoc/cleanup_xref.rb +1 -1
- data/lib/metanorma/standoc/converter.rb +2 -0
- data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +1 -1
- data/lib/metanorma/standoc/init.rb +23 -4
- data/lib/metanorma/standoc/inline.rb +27 -14
- data/lib/metanorma/standoc/isodoc.rng +1031 -912
- data/lib/metanorma/standoc/localbib.rb +1 -1
- data/lib/metanorma/standoc/macros.rb +1 -1
- data/lib/metanorma/standoc/macros_inline.rb +11 -9
- data/lib/metanorma/standoc/macros_plantuml.rb +1 -1
- data/lib/metanorma/standoc/ref.rb +1 -1
- data/lib/metanorma/standoc/ref_queue.rb +1 -1
- data/lib/metanorma/standoc/ref_utility.rb +7 -6
- data/lib/metanorma/standoc/reqt.rng +94 -72
- data/lib/metanorma/standoc/section.rb +2 -2
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +2 -2
- data/lib/metanorma/standoc/utils.rb +4 -2
- data/lib/metanorma/standoc/version.rb +1 -1
- metadata +4 -2
@@ -23,7 +23,7 @@ module Metanorma
|
|
23
23
|
|
24
24
|
def init_file_bibdb_config(defn, key)
|
25
25
|
/=/.match?(defn) or defn = "file=#{defn}"
|
26
|
-
values = defn.split(",").map { |item| item.split
|
26
|
+
values = defn.split(",").map { |item| item.split /(?<!\s)\s*=\s*/ }.to_h
|
27
27
|
values["key"] = key
|
28
28
|
values["format"] ||= "bibtex" # all we currently suppoort
|
29
29
|
values
|
@@ -22,7 +22,7 @@ module Metanorma
|
|
22
22
|
on_context :example, :sourcecode
|
23
23
|
|
24
24
|
def init_indent(line)
|
25
|
-
/^(?<prefix>[ \t]*)(?<suffix>.*)$/ =~ line
|
25
|
+
/^(?<prefix>[ \t]*)(?![ \t])(?<suffix>.*)$/ =~ line
|
26
26
|
prefix = prefix.gsub("\t", "\u00a0\u00a0\u00a0\u00a0")
|
27
27
|
.tr(" ", "\u00a0")
|
28
28
|
prefix + suffix
|
@@ -160,28 +160,30 @@ module Metanorma
|
|
160
160
|
str.sub(/^(["'])(.+)\1$/, "\\2")
|
161
161
|
end
|
162
162
|
|
163
|
-
def format(attrs)
|
163
|
+
def format(attrs, number)
|
164
164
|
# a="," => "a=,"
|
165
|
-
quoted_csv_split(attrs || "", ",").map do |x|
|
166
|
-
m = /^(.+?)=(.+)?$/.match(x) or next
|
165
|
+
out = quoted_csv_split(attrs || "", ",").map do |x|
|
166
|
+
m = /^(.+?)=(.+)?$/.match(HTMLEntities.new.decode(x)) or next
|
167
167
|
"#{m[1]}='#{m[2]}'"
|
168
|
-
end
|
168
|
+
end
|
169
|
+
/^\+/.match?(number.strip) and out << "number_sign='plus'"
|
170
|
+
out.join(",")
|
169
171
|
end
|
170
172
|
|
171
173
|
def number(text)
|
172
174
|
n = BigDecimal(text)
|
173
175
|
trailing_zeroes = 0
|
174
176
|
m = /\.[1-9]*(0+)/.match(text) and trailing_zeroes += m[1].size
|
175
|
-
n.to_s("E").sub("e", "0" * trailing_zeroes + "e")
|
177
|
+
n.to_s("E").sub("e", "0" * trailing_zeroes + "e") # rubocop:disable Style/StringConcatenation
|
176
178
|
end
|
177
179
|
|
178
180
|
def process(parent, target, attrs)
|
179
181
|
out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
|
180
|
-
fmt = format(out)
|
181
|
-
fmt.empty? and fmt = "
|
182
|
-
fmt = %(
|
182
|
+
fmt = format(out, target)
|
183
|
+
fmt.empty? and fmt = "default"
|
184
|
+
fmt = %( number-format="#{fmt}")
|
183
185
|
<<~OUTPUT
|
184
|
-
<stem type="MathML"><math xmlns='#{MATHML_NS}'><mn
|
186
|
+
<stem type="MathML"#{fmt}><math xmlns='#{MATHML_NS}'><mn>#{number(target)}</mn></math></stem>
|
185
187
|
OUTPUT
|
186
188
|
end
|
187
189
|
end
|
@@ -71,7 +71,7 @@ module Metanorma
|
|
71
71
|
|
72
72
|
def self.prep_source(reader)
|
73
73
|
src = reader.source
|
74
|
-
reader.lines.first.sub(
|
74
|
+
reader.lines.first.sub(/(?<!\s)\s+$/, "").match /^@startuml($| )/ or
|
75
75
|
src = "@startuml\n#{src}\n@enduml\n"
|
76
76
|
%r{@enduml\s*$}m.match?(src) or
|
77
77
|
raise "@startuml without matching @enduml in PlantUML!"
|
@@ -5,7 +5,7 @@ module Metanorma
|
|
5
5
|
module Standoc
|
6
6
|
module Refs
|
7
7
|
def iso_publisher(bib, code)
|
8
|
-
code.sub(/ .*$/, "").split("/").each do |abbrev|
|
8
|
+
code.sub(/(?<! ) .*$/, "").split("/").each do |abbrev|
|
9
9
|
bib.contributor do |c|
|
10
10
|
c.role type: "publisher"
|
11
11
|
c.organization do |org|
|
@@ -228,7 +228,7 @@ module Metanorma
|
|
228
228
|
@iev_globalname = global_ievcache_name
|
229
229
|
@iev_localname = local_ievcache_name(node.attr("local-cache") ||
|
230
230
|
node.attr("local-cache-only"))
|
231
|
-
if
|
231
|
+
if @flush_caches
|
232
232
|
FileUtils.rm_f @iev_globalname unless @iev_globalname.nil?
|
233
233
|
FileUtils.rm_f @iev_localname unless @iev_localname.nil?
|
234
234
|
end
|
@@ -20,7 +20,7 @@ module Metanorma
|
|
20
20
|
def norm_year(year)
|
21
21
|
/^&\#821[12];$/.match(year) and return "--"
|
22
22
|
/^\d\d\d\d-\d\d\d\d$/.match(year) and return year
|
23
|
-
year&.sub(
|
23
|
+
year&.sub(/^([0-9]+)-.*$/, "\\1")
|
24
24
|
end
|
25
25
|
|
26
26
|
def conditional_date(bib, match, noyr)
|
@@ -46,7 +46,7 @@ module Metanorma
|
|
46
46
|
@bibdb&.docid_type(code) || [nil, code]
|
47
47
|
end
|
48
48
|
code1.sub!(/^nofetch\((.+)\)$/, "\\1")
|
49
|
-
bib.docidentifier **attr_code(type:
|
49
|
+
bib.docidentifier **attr_code(type:) do |d|
|
50
50
|
d << code1
|
51
51
|
end
|
52
52
|
end
|
@@ -59,7 +59,7 @@ module Metanorma
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def mn_code(code)
|
62
|
-
code.sub(/^\(/, "[").sub(
|
62
|
+
code.sub(/^\(/, "[").sub(/^([^)]+)\).*$/, "\\1]")
|
63
63
|
.sub(/^dropid\((.+)\)$/, "\\1")
|
64
64
|
.sub(/^hidden\((.+)\)$/, "\\1")
|
65
65
|
.sub(/^nofetch\((.+)\)$/, "\\1")
|
@@ -67,7 +67,8 @@ module Metanorma
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def analyse_ref_localfile(ret)
|
70
|
-
m = /^local-file\((?:(?<source>[^,]+),\s*)?(?<id
|
70
|
+
m = /^local-file\((?:(?<source>[^,)]+),\s*)?(?<id>[^)]+)\)$/
|
71
|
+
.match(ret[:id])
|
71
72
|
m or return ret
|
72
73
|
ret.merge(id: m[:id], localfile: m[:source] || "default")
|
73
74
|
end
|
@@ -88,7 +89,7 @@ module Metanorma
|
|
88
89
|
end
|
89
90
|
|
90
91
|
def analyse_ref_repo_path(ret)
|
91
|
-
m = /^(?<type>repo|path|attachment):\((?<key>[^,]+),?(?<id>[^)]*)\)$/
|
92
|
+
m = /^(?<type>repo|path|attachment):\((?<key>[^,)]+),?(?<id>[^)]*)\)$/
|
92
93
|
.match(ret[:id]) or return ret
|
93
94
|
id = if m[:id].empty?
|
94
95
|
if m[:type] == "attachment"
|
@@ -96,7 +97,7 @@ module Metanorma
|
|
96
97
|
else m[:key].sub(%r{^[^/]+/}, "")
|
97
98
|
end
|
98
99
|
else m[:id] end
|
99
|
-
ret.merge(id
|
100
|
+
ret.merge(id:, type: m[:type], key: m[:key], nofetch: true)
|
100
101
|
end
|
101
102
|
|
102
103
|
def analyse_ref_numeric(ret)
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
2
|
+
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<!--
|
4
4
|
Presupposes isodoc.rnc, is included in it
|
5
5
|
include "isodoc.rnc" { }
|
6
|
+
|
7
|
+
This is the Metanorma default provisions model; it is overridden by other provisions models,
|
8
|
+
such as Modspec
|
6
9
|
-->
|
7
10
|
<define name="requirement">
|
11
|
+
<a:documentation>Specification of an attribute of a subject that is required.
|
12
|
+
NOTE: A requirement can contain other requirements</a:documentation>
|
8
13
|
<element name="requirement">
|
9
14
|
<ref name="RequirementType"/>
|
10
15
|
</element>
|
11
16
|
</define>
|
12
17
|
<define name="recommendation">
|
18
|
+
<a:documentation>Specification of an attribute of a subject that is recommended</a:documentation>
|
13
19
|
<element name="recommendation">
|
14
20
|
<ref name="RequirementType"/>
|
15
21
|
</element>
|
16
22
|
</define>
|
17
23
|
<define name="permission">
|
24
|
+
<a:documentation>Specification of an attribute of a subject that is permitted</a:documentation>
|
18
25
|
<element name="permission">
|
19
26
|
<ref name="RequirementType"/>
|
20
27
|
</element>
|
@@ -22,80 +29,101 @@
|
|
22
29
|
<define name="RequirementType">
|
23
30
|
<optional>
|
24
31
|
<attribute name="obligation">
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
<optional>
|
29
|
-
<attribute name="unnumbered">
|
30
|
-
<data type="boolean"/>
|
31
|
-
</attribute>
|
32
|
-
</optional>
|
33
|
-
<optional>
|
34
|
-
<attribute name="number"/>
|
35
|
-
</optional>
|
36
|
-
<optional>
|
37
|
-
<attribute name="subsequence"/>
|
38
|
-
</optional>
|
39
|
-
<optional>
|
40
|
-
<attribute name="keep-with-next">
|
41
|
-
<data type="boolean"/>
|
42
|
-
</attribute>
|
43
|
-
</optional>
|
44
|
-
<optional>
|
45
|
-
<attribute name="keep-lines-together">
|
46
|
-
<data type="boolean"/>
|
32
|
+
<a:documentation>An attribute that may be used to override the obligation represented in
|
33
|
+
the tag name of the top level containers</a:documentation>
|
34
|
+
<ref name="ReqtObligationType"/>
|
47
35
|
</attribute>
|
48
36
|
</optional>
|
49
37
|
<attribute name="id">
|
50
38
|
<data type="ID"/>
|
51
39
|
</attribute>
|
40
|
+
<ref name="NumberingAttributes"/>
|
41
|
+
<ref name="BlockAttributes"/>
|
52
42
|
<optional>
|
53
|
-
<attribute name="filename"
|
54
|
-
|
55
|
-
|
56
|
-
<attribute name="model"/>
|
43
|
+
<attribute name="filename">
|
44
|
+
<a:documentation>File name of the requirement model when exported</a:documentation>
|
45
|
+
</attribute>
|
57
46
|
</optional>
|
58
47
|
<optional>
|
59
|
-
<attribute name="
|
48
|
+
<attribute name="model">
|
49
|
+
<a:documentation>Model of requirements realised by this requirement, e.g. "ogc" for Modspec</a:documentation>
|
50
|
+
</attribute>
|
60
51
|
</optional>
|
61
52
|
<optional>
|
62
|
-
<attribute name="
|
53
|
+
<attribute name="type">
|
54
|
+
<a:documentation>Type of requirement; does not override labelling, unlike `class`</a:documentation>
|
55
|
+
</attribute>
|
63
56
|
</optional>
|
64
57
|
<optional>
|
65
|
-
<attribute name="
|
66
|
-
<
|
58
|
+
<attribute name="class">
|
59
|
+
<a:documentation>Class of provision, used to sequence and label that class separately.
|
60
|
+
By default, provisions are sequenced and labelled as requirements, recommendations, or
|
61
|
+
permissions, by obligation; the class overrides that</a:documentation>
|
67
62
|
</attribute>
|
68
63
|
</optional>
|
69
64
|
<optional>
|
70
|
-
<ref name="reqtitle"
|
65
|
+
<ref name="reqtitle">
|
66
|
+
<a:documentation>Human-readable title of the requirement</a:documentation>
|
67
|
+
</ref>
|
71
68
|
</optional>
|
72
69
|
<optional>
|
73
|
-
<ref name="
|
70
|
+
<ref name="reqtlabel">
|
71
|
+
<a:documentation>Formal identifier with which the requirement is referenced</a:documentation>
|
72
|
+
</ref>
|
74
73
|
</optional>
|
75
74
|
<zeroOrMore>
|
76
|
-
<ref name="subject"
|
75
|
+
<ref name="subject">
|
76
|
+
<a:documentation>The party subject to the obligation stated in the requirement</a:documentation>
|
77
|
+
</ref>
|
77
78
|
</zeroOrMore>
|
78
79
|
<zeroOrMore>
|
79
|
-
<ref name="reqinherit"
|
80
|
+
<ref name="reqinherit">
|
81
|
+
<a:documentation>Reference to the identifier of another requirement, of which this requirement
|
82
|
+
is a subclass, and from which it inherits attributes</a:documentation>
|
83
|
+
</ref>
|
80
84
|
</zeroOrMore>
|
81
85
|
<zeroOrMore>
|
82
|
-
<ref name="classification"
|
86
|
+
<ref name="classification">
|
87
|
+
<a:documentation>Key/Value pairs of metadata used to describe the requirement.
|
88
|
+
A key can be associated with multiple values</a:documentation>
|
89
|
+
</ref>
|
83
90
|
</zeroOrMore>
|
84
91
|
<zeroOrMore>
|
85
92
|
<choice>
|
86
|
-
<ref name="measurementtarget"
|
87
|
-
|
88
|
-
|
89
|
-
<ref name="
|
90
|
-
|
91
|
-
|
93
|
+
<ref name="measurementtarget">
|
94
|
+
<a:documentation>Quantitative statement of metrics that the requirement realises</a:documentation>
|
95
|
+
</ref>
|
96
|
+
<ref name="specification">
|
97
|
+
<a:documentation>Formal specification of the requirement. Expected to be machine-readable</a:documentation>
|
98
|
+
</ref>
|
99
|
+
<ref name="verification">
|
100
|
+
<a:documentation>Processes or code used to verify that the requirement is being complied
|
101
|
+
with. Can be a test (including test code), or a compliance statement</a:documentation>
|
102
|
+
</ref>
|
103
|
+
<ref name="import">
|
104
|
+
<a:documentation>A reference to source code or a statement of prerequisites which is defined elsewhere</a:documentation>
|
105
|
+
</ref>
|
106
|
+
<ref name="description">
|
107
|
+
<a:documentation>Descriptive statement of the content of the requirement. Is expected to
|
108
|
+
be human-readable, and to contain formatting markup following Metanorma
|
109
|
+
conventions. Is expected to be discursive, and be resumed after
|
110
|
+
interruption by other sub-containers</a:documentation>
|
111
|
+
</ref>
|
112
|
+
<ref name="component">
|
113
|
+
<a:documentation>Provisions nested within this provision, which cannot be referenced autonomously and have
|
114
|
+
subclasses specific to the parent provision. Not expressed with provision metadata</a:documentation>
|
115
|
+
</ref>
|
92
116
|
</choice>
|
93
117
|
</zeroOrMore>
|
94
118
|
<optional>
|
95
|
-
<ref name="reqt_references"
|
119
|
+
<ref name="reqt_references">
|
120
|
+
<a:documentation>A list of references for the requirement, following the Relaton model</a:documentation>
|
121
|
+
</ref>
|
96
122
|
</optional>
|
97
123
|
<zeroOrMore>
|
98
124
|
<choice>
|
125
|
+
<a:documentation>Provisions nested within this provision, which are self-standing and do not have
|
126
|
+
subclasses specific to the parent provision</a:documentation>
|
99
127
|
<ref name="requirement"/>
|
100
128
|
<ref name="recommendation"/>
|
101
129
|
<ref name="permission"/>
|
@@ -104,10 +132,10 @@
|
|
104
132
|
</define>
|
105
133
|
<define name="reqtitle">
|
106
134
|
<element name="title">
|
107
|
-
<ref name="
|
135
|
+
<ref name="LocalizedMarkedUpString"/>
|
108
136
|
</element>
|
109
137
|
</define>
|
110
|
-
<define name="
|
138
|
+
<define name="reqtlabel">
|
111
139
|
<element name="identifier">
|
112
140
|
<oneOrMore>
|
113
141
|
<ref name="TextElement"/>
|
@@ -155,7 +183,9 @@
|
|
155
183
|
</define>
|
156
184
|
<define name="component">
|
157
185
|
<element name="component">
|
158
|
-
<attribute name="class"
|
186
|
+
<attribute name="class">
|
187
|
+
<a:documentation>Class of component</a:documentation>
|
188
|
+
</attribute>
|
159
189
|
<ref name="RequirementSubpart"/>
|
160
190
|
</element>
|
161
191
|
</define>
|
@@ -167,44 +197,36 @@
|
|
167
197
|
</element>
|
168
198
|
</define>
|
169
199
|
<define name="RequirementSubpart">
|
170
|
-
<
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
200
|
+
<a:documentation>A subcontainer can be either machine-readable or human-readable, or a
|
201
|
+
mixture of the two.
|
202
|
+
A machine-readable component can be included as source code with
|
203
|
+
nomination of the language</a:documentation>
|
204
|
+
<optional>
|
205
|
+
<attribute name="type">
|
206
|
+
<a:documentation>Type of sub-container.
|
207
|
+
For example a `verification[@type = "unit-test"]` contains a unit test of a single
|
208
|
+
feature, and is to be treated differently from
|
209
|
+
`verification[@type = "comprehensive"]`, which represents a comprehensive test suite</a:documentation>
|
176
210
|
</attribute>
|
177
211
|
</optional>
|
178
212
|
<optional>
|
179
|
-
<attribute name="
|
180
|
-
<
|
181
|
-
|
182
|
-
</optional>
|
183
|
-
<optional>
|
184
|
-
<attribute name="keep-lines-together">
|
213
|
+
<attribute name="exclude">
|
214
|
+
<a:documentation>Indicates that the current sub-container is only intended to be
|
215
|
+
machine-readable, and is not to be rendered as document output</a:documentation>
|
185
216
|
<data type="boolean"/>
|
186
217
|
</attribute>
|
187
218
|
</optional>
|
188
|
-
<
|
189
|
-
<attribute name="tag"/>
|
190
|
-
</optional>
|
191
|
-
<optional>
|
192
|
-
<attribute name="multilingual-rendering">
|
193
|
-
<ref name="MultilingualRenderingType"/>
|
194
|
-
</attribute>
|
195
|
-
</optional>
|
219
|
+
<ref name="BlockAttributes"/>
|
196
220
|
<oneOrMore>
|
197
221
|
<choice>
|
222
|
+
<a:documentation>Content of subpart: blocks, rather than provisions</a:documentation>
|
198
223
|
<ref name="BasicBlock"/>
|
199
224
|
<ref name="component"/>
|
200
225
|
</choice>
|
201
226
|
</oneOrMore>
|
202
227
|
</define>
|
203
|
-
<define name="
|
204
|
-
<
|
205
|
-
|
206
|
-
<value>recommendation</value>
|
207
|
-
<value>permission</value>
|
208
|
-
</choice>
|
228
|
+
<define name="ReqtObligationType">
|
229
|
+
<a:documentation>Values are "requirement", "recommendation", "permission"; multiple values can be comma-delimited</a:documentation>
|
230
|
+
<text/>
|
209
231
|
</define>
|
210
232
|
</grammar>
|
@@ -14,8 +14,8 @@ module Metanorma
|
|
14
14
|
node.attr("heading")&.downcase ||
|
15
15
|
node.title
|
16
16
|
.gsub(%r{<index>.*?</index>}m, "")
|
17
|
-
.gsub(%r{<fn[
|
18
|
-
.gsub(/<[
|
17
|
+
.gsub(%r{<fn[^<>]*>.*?</fn>}m, "")
|
18
|
+
.gsub(/<[^<>]+>/, "")
|
19
19
|
.strip.downcase.sub(/\.$/, "")
|
20
20
|
end
|
21
21
|
|
@@ -4,7 +4,7 @@ module Metanorma
|
|
4
4
|
module Standoc
|
5
5
|
# Intelligent term lookup xml modifier
|
6
6
|
class TermLookupCleanup
|
7
|
-
AUTO_GEN_ID_REGEXP = /\A_
|
7
|
+
AUTO_GEN_ID_REGEXP = /\A_/
|
8
8
|
|
9
9
|
attr_reader :xmldoc, :lookup, :log
|
10
10
|
|
@@ -130,7 +130,7 @@ module Metanorma
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def remove_missing_ref_msg1(_node, target, ret)
|
133
|
-
target2 = "_#{target.downcase.
|
133
|
+
target2 = "_#{target.downcase.tr('-', '_')}"
|
134
134
|
if @terms_tags[target] || @terms_tags[target2]
|
135
135
|
ret.strip!
|
136
136
|
ret += ". Did you mean to point to a subterm?"
|
@@ -37,7 +37,8 @@ module Metanorma
|
|
37
37
|
%("\\1#{eql}\\3"))
|
38
38
|
Metanorma::Utils::csv_split(text, delim)
|
39
39
|
.map do |x|
|
40
|
-
c.encode(x.sub(/^(["'])(.+)\1$/, "\\2"),
|
40
|
+
c.encode(x.sub(/^(["'])(.+)\1$/, "\\2"),
|
41
|
+
:basic, :hexadecimal)
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
@@ -100,8 +101,9 @@ module Metanorma
|
|
100
101
|
# wrapped in <sections>
|
101
102
|
def adoc2xml(text, flavour)
|
102
103
|
Nokogiri::XML(text).root and return text
|
104
|
+
f = @flush_caches ? ":flush-caches:\n" : ""
|
103
105
|
c = Asciidoctor.convert("= X\nA\n:semantic-metadata-headless: true\n" \
|
104
|
-
":novalid:\n\n#{text}\n",
|
106
|
+
":no-isobib:\n#{f}:novalid:\n\n#{text}\n",
|
105
107
|
backend: flavour, header_footer: true)
|
106
108
|
Nokogiri::XML(c).at("//xmlns:sections")
|
107
109
|
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.9.
|
4
|
+
version: 2.9.7
|
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-
|
11
|
+
date: 2024-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -528,6 +528,7 @@ files:
|
|
528
528
|
- lib/metanorma/standoc/cleanup_image.rb
|
529
529
|
- lib/metanorma/standoc/cleanup_inline.rb
|
530
530
|
- lib/metanorma/standoc/cleanup_maths.rb
|
531
|
+
- lib/metanorma/standoc/cleanup_mathvariant.rb
|
531
532
|
- lib/metanorma/standoc/cleanup_ref.rb
|
532
533
|
- lib/metanorma/standoc/cleanup_reqt.rb
|
533
534
|
- lib/metanorma/standoc/cleanup_section.rb
|
@@ -535,6 +536,7 @@ files:
|
|
535
536
|
- lib/metanorma/standoc/cleanup_symbols.rb
|
536
537
|
- lib/metanorma/standoc/cleanup_table.rb
|
537
538
|
- lib/metanorma/standoc/cleanup_terms.rb
|
539
|
+
- lib/metanorma/standoc/cleanup_terms_boilerplate.rb
|
538
540
|
- lib/metanorma/standoc/cleanup_terms_designations.rb
|
539
541
|
- lib/metanorma/standoc/cleanup_text.rb
|
540
542
|
- lib/metanorma/standoc/cleanup_toc.rb
|