metanorma-standoc 2.3.6 → 2.3.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7c637a8a2cab495ee675be427ab80dbfa3268f7630cc1161ca3f1b75c40688c
4
- data.tar.gz: db253ce3dde5b476d87a404d6de2d99606410262ad091edacea453c18476910c
3
+ metadata.gz: 00ae5b84e04807e4d13ce97c2be80f47fc46a0004c8a1630d59f041597627f9e
4
+ data.tar.gz: 1e67f2c42a5b84081e44a6ad63b0cce70d980cc8478014de53355cf4b74e5e24
5
5
  SHA512:
6
- metadata.gz: 1ba632dd7ca73b0c6314212c57d9a56ed2da84f52b4ab2cd32c46d53a1a994d096d2b6a43cdc4dd161f2ddfff19a2ac7d4c113e6181054631cb3494421ff02b0
7
- data.tar.gz: bc6cf925cc3bd5aa0777044a2568368600adcffe486e164d1ca7d0dd31370c729e45eafc62e0d3dd64d0238d618efdf9a2fc4405dddfe5af25d982f93de69966
6
+ metadata.gz: 65608377bcc5b0b06e6895f6d9ed842c956def5cf77e28e25d4db3ae554b062f0e798afa2a964a18265396c22243d6aeebea98e913b4c269ddf09c04e3f06f92
7
+ data.tar.gz: 01aff668829eb7d52cec2e94e9b9da8b06353b56847a615b543e6fa2cfefad4fe8e9a9cc0f72e266b74e4f7535671f23ed34b31da43b6cddffe14ba189165e4c
@@ -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))}x, "\n\\1")
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
@@ -522,7 +522,6 @@
522
522
  <value>tip</value>
523
523
  <value>important</value>
524
524
  <value>caution</value>
525
- <value>statement</value>
526
525
  </choice>
527
526
  </define>
528
527
  <define name="figure">
@@ -1316,7 +1316,7 @@
1316
1316
  <value>commentaryOf</value>
1317
1317
  <value>hasCommentary</value>
1318
1318
  <value>related</value>
1319
- <value>complements</value>
1319
+ <value>hasComplement</value>
1320
1320
  <value>complementOf</value>
1321
1321
  <value>obsoletes</value>
1322
1322
  <value>obsoletedBy</value>
@@ -91,11 +91,8 @@ module Metanorma
91
91
  end
92
92
 
93
93
  def admonition_name(node)
94
- name = node.attr("name")
95
- a = node.attr("type") and ["danger", "safety precautions"].each do |t|
96
- name = t if a.casecmp(t).zero?
97
- end
98
- name
94
+ ret = node.attr("type") || node.attr("name")
95
+ ret&.downcase
99
96
  end
100
97
 
101
98
  def admonition(node)
@@ -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("//misc-container")
80
+ unless ins = xmldoc.at("//metanorma-extension")
81
81
  a = xmldoc.at("//termdocsource") || xmldoc.at("//bibdata")
82
- a.next = "<misc-container/>"
83
- ins = xmldoc.at("//misc-container")
82
+ a.next = "<metanorma-extension/>"
83
+ ins = xmldoc.at("//metanorma-extension")
84
84
  end
85
85
  ins
86
86
  end
@@ -77,7 +77,8 @@ module Metanorma
77
77
  elem["citeas"] = ""
78
78
  xref_to_eref1(elem)
79
79
  end
80
- elem.delete("target").delete("style")
80
+ elem.delete("target")
81
+ elem.delete("style")
81
82
  extract_localities(elem)
82
83
  end
83
84
 
@@ -109,7 +110,7 @@ module Metanorma
109
110
  end
110
111
 
111
112
  def anchor_alias(xmldoc)
112
- t = xmldoc.at("//misc-container/table[@id = " \
113
+ t = xmldoc.at("//metanorma-extension/table[@id = " \
113
114
  "'_misccontainer_anchor_aliases']") or return
114
115
  key = ""
115
116
  t.xpath("./tbody/tr").each do |tr|
@@ -66,6 +66,7 @@
66
66
  <value>caution</value>
67
67
  <value>statement</value>
68
68
  <value>editorial</value>
69
+ <value>box</value>
69
70
  </choice>
70
71
  </define>
71
72
  <define name="index">
@@ -1580,7 +1581,7 @@
1580
1581
  </element>
1581
1582
  </define>
1582
1583
  <define name="misccontainer">
1583
- <element name="misc-container">
1584
+ <element name="metanorma-extension">
1584
1585
  <oneOrMore>
1585
1586
  <ref name="AnyElement"/>
1586
1587
  </oneOrMore>
@@ -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(**{ type: "published" }) do |d|
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;amp;/, "&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 misc-container
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" then misccontainer_parse(a, xml, node)
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 60050-/.match(src.at("./origin/@citeas")&.text) &&
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 | //misc-container".freeze
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
@@ -204,7 +204,7 @@ module Metanorma
204
204
  @doc_xrefs = doc.xpath("//xref/@target | //xref/@to")
205
205
  .each_with_object({}) do |x, m|
206
206
  m[x.text] = x
207
- @doc_ids[x] and next
207
+ @doc_ids[x.text] and next
208
208
  @log.add("Anchors", x.parent,
209
209
  "Crossreference target #{x} is undefined")
210
210
  end
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "2.3.6".freeze
22
+ VERSION = "2.3.8".freeze
23
23
  end
24
24
  end
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_dependency "latexmath"
42
42
  spec.add_dependency "mathml2asciimath"
43
43
  spec.add_dependency "pngcheck"
44
- spec.add_dependency "relaton-cli", "~> 1.14.0"
44
+ spec.add_dependency "relaton-cli", "~> 1.15.0"
45
45
  spec.add_dependency "relaton-iev", "~> 1.1.0"
46
46
  spec.add_dependency "unicode2latex", "~> 0.0.1"
47
47
 
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.6
4
+ version: 2.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-30 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 1.14.0
187
+ version: 1.15.0
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 1.14.0
194
+ version: 1.15.0
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: relaton-iev
197
197
  requirement: !ruby/object:Gem::Requirement