metanorma-standoc 2.3.6 → 2.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/base.rb +3 -3
- data/lib/metanorma/standoc/biblio.rng +1 -1
- data/lib/metanorma/standoc/cleanup_maths.rb +3 -3
- data/lib/metanorma/standoc/cleanup_xref.rb +1 -1
- data/lib/metanorma/standoc/isodoc.rng +1 -1
- data/lib/metanorma/standoc/ref_utility.rb +7 -1
- data/lib/metanorma/standoc/section.rb +4 -3
- data/lib/metanorma/standoc/validate.rb +2 -2
- data/lib/metanorma/standoc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f54e594bb241986927a3c362a30508b6f385453ab08ee08e30f89d1b0c710f8
|
4
|
+
data.tar.gz: 3ac6df79b17e62573129bb9a616461190c87bbdabb6245da0b929989d5444958
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5ea80a8c2535e048d56c6d3a173911f8df25be446b6c2ac178f4e6d817cae771112484a71d5a9dd9d48ad2ec3a324dd72aab3180dd695523f6d3e5fd53b446
|
7
|
+
data.tar.gz: 4e4029d20750e43e5d5119d41cbdca127323bc5a9e0d140637ed8fe8e5117faf41058ee3c44d448b0754c3c79aecc45dd67bf376bb34deec36c58c42332668c6
|
@@ -144,8 +144,7 @@ module Metanorma
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def insert_xml_cr(doc)
|
147
|
-
doc
|
148
|
-
.gsub(%r{(</(clause|table|figure|p|bibitem|ul|ol|dl|dt|dd|li|example|
|
147
|
+
doc.gsub(%r{(</(clause|table|figure|p|bibitem|ul|ol|dl|dt|dd|li|example|
|
149
148
|
sourcecode|formula|quote|references|annex|appendix|title|
|
150
149
|
name|note|thead|tbody|tfoot|th|td|form|requirement|
|
151
150
|
recommendation|permission|imagemap|svgmap|preferred|
|
@@ -153,7 +152,8 @@ module Metanorma
|
|
153
152
|
graphical-symbol|expression|abbreviation-type|subject|
|
154
153
|
pronunciation|grammar|term|terms|termnote|termexample|
|
155
154
|
termsource|origin|termref|modification)>)}x, "\\1\n")
|
156
|
-
.gsub(%r{(<(title|name))}
|
155
|
+
.gsub(%r{(<(title|name))}, "\n\\1")
|
156
|
+
.gsub(%r{(<sourcecode[^>]*>)\s+(<name[^>]*>[^<]+</name>)\s+}, "\\1\\2")
|
157
157
|
end
|
158
158
|
|
159
159
|
def version
|
@@ -1316,7 +1316,7 @@
|
|
1316
1316
|
<value>commentaryOf</value>
|
1317
1317
|
<value>hasCommentary</value>
|
1318
1318
|
<value>related</value>
|
1319
|
-
<value>
|
1319
|
+
<value>hasComplement</value>
|
1320
1320
|
<value>complementOf</value>
|
1321
1321
|
<value>obsoletes</value>
|
1322
1322
|
<value>obsoletedBy</value>
|
@@ -77,10 +77,10 @@ module Metanorma
|
|
77
77
|
UNITSML_NS = "https://schema.unitsml.org/unitsml/1.0".freeze
|
78
78
|
|
79
79
|
def add_misc_container(xmldoc)
|
80
|
-
unless ins = xmldoc.at("//
|
80
|
+
unless ins = xmldoc.at("//metanorma-extension")
|
81
81
|
a = xmldoc.at("//termdocsource") || xmldoc.at("//bibdata")
|
82
|
-
a.next = "<
|
83
|
-
ins = xmldoc.at("//
|
82
|
+
a.next = "<metanorma-extension/>"
|
83
|
+
ins = xmldoc.at("//metanorma-extension")
|
84
84
|
end
|
85
85
|
ins
|
86
86
|
end
|
@@ -109,7 +109,7 @@ module Metanorma
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def anchor_alias(xmldoc)
|
112
|
-
t = xmldoc.at("//
|
112
|
+
t = xmldoc.at("//metanorma-extension/table[@id = " \
|
113
113
|
"'_misccontainer_anchor_aliases']") or return
|
114
114
|
key = ""
|
115
115
|
t.xpath("./tbody/tr").each do |tr|
|
@@ -25,7 +25,7 @@ module Metanorma
|
|
25
25
|
|
26
26
|
def conditional_date(bib, match, noyr)
|
27
27
|
if match.names.include?("year") && !match[:year].nil?
|
28
|
-
bib.date(
|
28
|
+
bib.date(type: "published") do |d|
|
29
29
|
(noyr and d.on "--") or set_date_range(d, norm_year(match[:year]))
|
30
30
|
end
|
31
31
|
end
|
@@ -152,6 +152,12 @@ module Metanorma
|
|
152
152
|
ref.gsub(/&amp;/, "&")
|
153
153
|
.gsub(/>\n/, "> \n")
|
154
154
|
end
|
155
|
+
|
156
|
+
def skip_docid
|
157
|
+
<<~XPATH.strip.freeze
|
158
|
+
@type = 'DOI' or @type = 'doi' or @type = 'ISSN' or @type = 'issn' or @type = 'ISBN' or @type = 'isbn' or starts-with(@type, 'ISSN.') or starts-with(@type, 'ISBN.') or starts-with(@type, 'issn.') or starts-with(@type, 'isbn.')
|
159
|
+
XPATH
|
160
|
+
end
|
155
161
|
end
|
156
162
|
end
|
157
163
|
end
|
@@ -53,8 +53,8 @@ module Metanorma
|
|
53
53
|
end
|
54
54
|
|
55
55
|
PREFACE_CLAUSE_NAMES =
|
56
|
-
%w(abstract foreword introduction
|
57
|
-
acknowledgements).freeze
|
56
|
+
%w(abstract foreword introduction metanorma-extension
|
57
|
+
misc-container acknowledgements).freeze
|
58
58
|
|
59
59
|
MAIN_CLAUSE_NAMES =
|
60
60
|
["normative references", "terms and definitions", "scope",
|
@@ -108,7 +108,8 @@ module Metanorma
|
|
108
108
|
a = section_attributes(node)
|
109
109
|
noko do |xml|
|
110
110
|
case sectiontype(node)
|
111
|
-
when "misc-container"
|
111
|
+
when "misc-container", "metanorma-extension"
|
112
|
+
misccontainer_parse(a, xml, node)
|
112
113
|
when "introduction" then introduction_parse(a, xml, node)
|
113
114
|
when "foreword" then foreword_parse(a, xml, node)
|
114
115
|
when "scope" then scope_parse(a, xml, node)
|
@@ -23,7 +23,7 @@ module Metanorma
|
|
23
23
|
@iev = init_iev or return
|
24
24
|
xmldoc.xpath("//term").each do |t|
|
25
25
|
t.xpath(".//termsource").each do |src|
|
26
|
-
(/^IEC
|
26
|
+
(/^IEC[ ]60050-/.match(src.at("./origin/@citeas")&.text) &&
|
27
27
|
loc = src.xpath(SOURCELOCALITY)&.text) or next
|
28
28
|
iev_validate1(t, loc, xmldoc)
|
29
29
|
end
|
@@ -182,7 +182,7 @@ module Metanorma
|
|
182
182
|
WILDCARD_ATTRS =
|
183
183
|
"//*[@format] | //stem | //bibdata//description | " \
|
184
184
|
"//formattedref | //bibdata//note | //bibdata/abstract | " \
|
185
|
-
"//bibitem/abstract | //bibitem/note | //
|
185
|
+
"//bibitem/abstract | //bibitem/note | //metanorma-extension".freeze
|
186
186
|
|
187
187
|
# RelaxNG cannot cope well with wildcard attributes. So we strip
|
188
188
|
# any attributes from FormattedString instances (which can contain
|
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.3.
|
4
|
+
version: 2.3.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:
|
11
|
+
date: 2023-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|