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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7c637a8a2cab495ee675be427ab80dbfa3268f7630cc1161ca3f1b75c40688c
4
- data.tar.gz: db253ce3dde5b476d87a404d6de2d99606410262ad091edacea453c18476910c
3
+ metadata.gz: 7f54e594bb241986927a3c362a30508b6f385453ab08ee08e30f89d1b0c710f8
4
+ data.tar.gz: 3ac6df79b17e62573129bb9a616461190c87bbdabb6245da0b929989d5444958
5
5
  SHA512:
6
- metadata.gz: 1ba632dd7ca73b0c6314212c57d9a56ed2da84f52b4ab2cd32c46d53a1a994d096d2b6a43cdc4dd161f2ddfff19a2ac7d4c113e6181054631cb3494421ff02b0
7
- data.tar.gz: bc6cf925cc3bd5aa0777044a2568368600adcffe486e164d1ca7d0dd31370c729e45eafc62e0d3dd64d0238d618efdf9a2fc4405dddfe5af25d982f93de69966
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))}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
@@ -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>
@@ -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
@@ -109,7 +109,7 @@ module Metanorma
109
109
  end
110
110
 
111
111
  def anchor_alias(xmldoc)
112
- t = xmldoc.at("//misc-container/table[@id = " \
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|
@@ -1580,7 +1580,7 @@
1580
1580
  </element>
1581
1581
  </define>
1582
1582
  <define name="misccontainer">
1583
- <element name="misc-container">
1583
+ <element name="metanorma-extension">
1584
1584
  <oneOrMore>
1585
1585
  <ref name="AnyElement"/>
1586
1586
  </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
@@ -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.7".freeze
23
23
  end
24
24
  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.3.6
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: 2022-12-30 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor