metanorma-nist 0.2.2 → 0.2.3

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: '058ea96daf6a2940d6a1b2b2ddb8464f13a62389c006cfcf423dfa57d5d33c11'
4
- data.tar.gz: 47dd1e6208cdf299e9b2146dfe92f0003a66e7b0ca6f169c50dd9a1792627c48
3
+ metadata.gz: d9b324dd09a8d49e7d0f962d8f526c39770127b56a4dc9b2eedd3e34f5003eec
4
+ data.tar.gz: c41f9cf011e6042a7658a173340d0ec8b83375c3d924a6485c2e382f57e49efb
5
5
  SHA512:
6
- metadata.gz: 423c8ba7e534b31b3176e22234937d58a3ae2599e45f0bb476822c05752d4fd9b407df989bba48c19be262c28fcb80fe67df4e107b8632f50fb80ffc9803b8b8
7
- data.tar.gz: 9ed5d3661a6804ac4c75a58a2b17effe96115e066d7179bc376a539f097e6249383c1baeed5c26ad4bfddac500142e78741abf8c8030de1ecb69f11c339301a0
6
+ metadata.gz: 8f87e8f12899a69732ed0830a76166ad2d1147717d5430949631f5c246cd14557ab5add686da89cea525abd7370b7ad0b32b3b955cc834f118c6b44c90dfe5ad
7
+ data.tar.gz: 750b3102e74993362d5225d23bbf874c30ddf4941810ca4e0faf4dc67577975e721195c1a889b83ab849bc25e32fd4a5a75e7ba634f61e34115cab51ac6b3a49
@@ -194,6 +194,14 @@
194
194
  <data type="boolean"/>
195
195
  </attribute>
196
196
  </optional>
197
+ <optional>
198
+ <attribute name="subsequence"/>
199
+ </optional>
200
+ <optional>
201
+ <attribute name="inequality">
202
+ <data type="boolean"/>
203
+ </attribute>
204
+ </optional>
197
205
  <ref name="stem"/>
198
206
  <optional>
199
207
  <ref name="dl"/>
@@ -247,6 +255,9 @@
247
255
  <data type="boolean"/>
248
256
  </attribute>
249
257
  </optional>
258
+ <optional>
259
+ <attribute name="subsequence"/>
260
+ </optional>
250
261
  <optional>
251
262
  <attribute name="lang"/>
252
263
  </optional>
@@ -291,9 +302,15 @@
291
302
  <data type="boolean"/>
292
303
  </attribute>
293
304
  </optional>
305
+ <optional>
306
+ <attribute name="subsequence"/>
307
+ </optional>
294
308
  <optional>
295
309
  <attribute name="alt"/>
296
310
  </optional>
311
+ <optional>
312
+ <attribute name="summary"/>
313
+ </optional>
297
314
  <optional>
298
315
  <attribute name="uri">
299
316
  <data type="anyURI"/>
@@ -423,6 +440,9 @@
423
440
  <data type="boolean"/>
424
441
  </attribute>
425
442
  </optional>
443
+ <optional>
444
+ <attribute name="subsequence"/>
445
+ </optional>
426
446
  <oneOrMore>
427
447
  <choice>
428
448
  <ref name="formula"/>
@@ -486,6 +506,9 @@
486
506
  <data type="boolean"/>
487
507
  </attribute>
488
508
  </optional>
509
+ <optional>
510
+ <attribute name="subsequence"/>
511
+ </optional>
489
512
  <optional>
490
513
  <ref name="source"/>
491
514
  </optional>
@@ -497,6 +520,8 @@
497
520
  </optional>
498
521
  <choice>
499
522
  <ref name="image"/>
523
+ <ref name="video"/>
524
+ <ref name="audio"/>
500
525
  <ref name="pre"/>
501
526
  <zeroOrMore>
502
527
  <ref name="figure"/>
@@ -792,7 +817,7 @@
792
817
  </element>
793
818
  </define>
794
819
  <define name="video">
795
- <element name="image">
820
+ <element name="video">
796
821
  <attribute name="id">
797
822
  <data type="ID"/>
798
823
  </attribute>
@@ -833,7 +858,7 @@
833
858
  </element>
834
859
  </define>
835
860
  <define name="audio">
836
- <element name="image">
861
+ <element name="audio">
837
862
  <attribute name="id">
838
863
  <data type="ID"/>
839
864
  </attribute>
@@ -165,9 +165,16 @@ module Asciidoctor
165
165
  end
166
166
 
167
167
  # if numeric citation, order by appearance. if alphanumeric, sort alphabetically
168
+ # if identifier, zero-pad numeric component for NIST ids
168
169
  def sort_biblio_key(bib)
169
170
  if metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text&.gsub(%r{[\[\]]}, "")
170
171
  key = /^\[\d+\]$/.match(metaid) ? ( @citation_order[metaid] % "09%d" ) : metaid
172
+ elsif metaid = bib&.at("./docidentifier[@type = 'NIST']")&.text
173
+ key = metaid.sub(/-(\d+)/) {|m| sprintf "-%09d", ($1.to_i) }
174
+ else
175
+ metaid = bib&.at("./docidentifier[not(@type = 'DOI' or "\
176
+ "@type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN')]")&.text
177
+ key = metaid.sub(/-(\d+)/) {|m| sprintf "-%09d", ($1.to_i) }
171
178
  end
172
179
  title = bib&.at("./title[@type = 'main']")&.text ||
173
180
  bib&.at("./title")&.text || bib&.at("./formattedref")&.text
@@ -138,7 +138,7 @@ module Asciidoctor
138
138
  unless node.attr("nodoc") || !node.attr("docfile")
139
139
  filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
140
140
  gsub(%r{^.*/}, "")
141
- File.open(filename, "w") { |f| f.write(ret) }
141
+ File.open(filename, "w:UTF-8") { |f| f.write(ret) }
142
142
  html_converter(node).convert filename unless node.attr("nodoc")
143
143
  word_converter(node).convert filename unless node.attr("nodoc")
144
144
  pdf_converter(node).convert filename unless node.attr("nodoc")
@@ -24,7 +24,7 @@ CODEN: NSPUE2</p>
24
24
 
25
25
  <p>There may be references in this publication to other publications currently under development by NIST in accordance with its assigned statutory responsibilities. The information in this publication, including concepts and methodologies, may be used by Federal agencies even before the completion of such companion publications. Thus, until each publication is completed, current requirements, guidelines, and procedures, where they exist, remain operative. For planning and transition purposes, Federal agencies may wish to closely follow the development of these new publications by NIST.</p>
26
26
 
27
- <p>Organizations are encouraged to review all draft publications during public comment periods and provide feedback to NIST. Many NIST cybersecurity publications, other than the ones noted above, are available at <link target="https://csrc.nist.gov/publications"/>
27
+ <p>Organizations are encouraged to review all draft publications during public comment periods and provide feedback to NIST. Many NIST cybersecurity publications, other than the ones noted above, are available at <link target="https://csrc.nist.gov/publications" alt="NIST Computer Security Division publications"/>
28
28
  </clause>
29
29
  </legal-statement>
30
30
 
@@ -30,6 +30,9 @@
30
30
  <data type="boolean"/>
31
31
  </attribute>
32
32
  </optional>
33
+ <optional>
34
+ <attribute name="subsequence"/>
35
+ </optional>
33
36
  <attribute name="id">
34
37
  <data type="ID"/>
35
38
  </attribute>
@@ -169,7 +169,7 @@ module IsoDoc
169
169
  def term_cleanup(docxml)
170
170
  docxml.xpath("//table[@class = 'terms_dl']").each do |d|
171
171
  prev = d.previous_element
172
- next unless prev.name == "table" and prev["class"] == "terms_dl"
172
+ next unless prev and prev.name == "table" and prev["class"] == "terms_dl"
173
173
  d.children.each { |n| prev.add_child(n.remove) }
174
174
  d.remove
175
175
  end
@@ -241,8 +241,9 @@ module Iso690Render
241
241
 
242
242
  def self.extent1(type, from, to)
243
243
  ret = ""
244
- if type == "page"
245
- type = to ? "pp." : "p"
244
+ case type
245
+ when "page" then type = to ? "pp." : "p."
246
+ when "volume" then type = to ? "Vols." : "Vol."
246
247
  end
247
248
  ret += "#{type} "
248
249
  ret += from.text if from
@@ -267,7 +267,7 @@ module IsoDoc
267
267
  def term_cleanup(docxml)
268
268
  docxml.xpath("//table[@class = 'terms_dl']").each do |d|
269
269
  prev = d.previous_element
270
- next unless prev.name == "table" and prev["class"] == "terms_dl"
270
+ next unless prev and prev.name == "table" and prev["class"] == "terms_dl"
271
271
  d.children.each { |n| prev.add_child(n.remove) }
272
272
  d.remove
273
273
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module NIST
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-12 00:00:00.000000000 Z
11
+ date: 2019-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor