metanorma-nist 1.0.2 → 1.0.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: 91f46b9b2842b8f2a8bd192bf8ed5355bfa1eb408e30e4e8f1f6e6e453e8dda0
4
- data.tar.gz: d4cfc4b2e1e8975d7d6f2ec7d19dcd749997641edae4654fc71ef14511eaa2d5
3
+ metadata.gz: 2fe0b9d18da4d89a09e1c33a6299d1b7f222b00768421ac8a35d6cabae0fa2dd
4
+ data.tar.gz: 2dd93732ce0b519a0b6b11c75f52295cfa3f0dde1d21eb2916dc0c6c35d66cda
5
5
  SHA512:
6
- metadata.gz: 0ddeda4c7bfb7a394608b2871f6afb8f8c269b4d223e7284586c9846b48bace911e5a86de5e7565206e3313620c5ba0ade85219de1280177a6ce4a9cfe09de5e
7
- data.tar.gz: 2b1599c76ec2800b385afeda329b7331090964c32e762c5fe302b49866234c30270638bbbf6d368cbc165501461dd751bbd19ee2b1d0e57f274f383ecf381ec1
6
+ metadata.gz: d5e2dd3571dc44341fa1d4858221e0b1bb8d2107fd0f77a9bd30f28e73784a5a16b6387259d0302fff066798f034bbde36cebc336f4fafcb8918d737f809d97c
7
+ data.tar.gz: de51bd7ceed4f8869c0d9bcdb3c5ad8b860090ffb1ed450ab0e3dc996df6f9ffa655b644ef90b1c2d5c1ecf13bb5a4fe4eb898ec29b64208d4c1e89ab51862c3
@@ -109,6 +109,7 @@ module Asciidoctor
109
109
  word_converter(node).convert filename unless node.attr("nodoc")
110
110
  pdf_converter(node).convert filename unless node.attr("nodoc")
111
111
  end
112
+ @log.write(@filename + ".err") unless @novalid
112
113
  @files_to_delete.each { |f| FileUtils.rm f }
113
114
  ret
114
115
  end
@@ -154,7 +155,7 @@ module Asciidoctor
154
155
  a = section_attributes(node)
155
156
  noko do |xml|
156
157
  case sectiontype(node)
157
- #when "normative references" then norm_ref_parse(a, xml, node)
158
+ #when "normative references" then norm_ref_parse(a, xml, node)
158
159
  when "terms and definitions"
159
160
  if node.attr("style") == "appendix" && node.level == 1
160
161
  @term_def = true
@@ -163,7 +164,7 @@ module Asciidoctor
163
164
  else
164
165
  clause_parse(a, xml, node)
165
166
  end
166
- when "acknowledgements"
167
+ when "acknowledgements"
167
168
  acknowledgements_parse(a, xml, node)
168
169
  else
169
170
  if @term_def
@@ -220,7 +221,7 @@ module Asciidoctor
220
221
  "\\1[NIST \\2 ")
221
222
  super
222
223
  end
223
-
224
+
224
225
  def fetch_ref(xml, code, year, **opts)
225
226
  code.sub!(Regexp.new("^(#{NIST_PREFIX_REFS}) "), "NIST \\1 ")
226
227
  super
@@ -645,6 +645,11 @@
645
645
  <optional>
646
646
  <attribute name="script"/>
647
647
  </optional>
648
+ <optional>
649
+ <attribute name="inline-header">
650
+ <data type="boolean"/>
651
+ </attribute>
652
+ </optional>
648
653
  <optional>
649
654
  <attribute name="obligation">
650
655
  <choice>
@@ -21,26 +21,26 @@ module Asciidoctor
21
21
  def doctype_validate(xmldoc)
22
22
  doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
23
23
  %w(standard).include? doctype or
24
- warn "Document Attributes: #{doctype} is not a recognised document type"
24
+ @log.add("Document Attributes", nil, "#{doctype} is not a recognised document type")
25
25
  end
26
26
 
27
27
  def stage_validate(xmldoc)
28
28
  stage = xmldoc&.at("//bibdata/status/stage")&.text
29
29
  %w(draft-internal draft-wip draft-prelim draft-public draft-approval
30
30
  final final-review).include? stage or
31
- warn "Document Attributes: #{stage} is not a recognised stage"
31
+ @log.add("Document Attributes", nil, "#{stage} is not a recognised stage")
32
32
  end
33
33
 
34
34
  def substage_validate(xmldoc)
35
35
  substage = xmldoc&.at("//bibdata/status/substage")&.text or return
36
36
  %w(active retired withdrawn).include? substage or
37
- warn "Document Attributes: #{substage} is not a recognised substage"
37
+ @log.add("Document Attributes", nil, "#{substage} is not a recognised substage")
38
38
  end
39
39
 
40
40
  def iteration_validate(xmldoc)
41
41
  iteration = xmldoc&.at("//bibdata/status/iteration")&.text or return
42
42
  %w(final).include? iteration.downcase or /^\d+$/.match(iteration) or
43
- warn "Document Attributes: #{iteration} is not a recognised iteration"
43
+ @log.add("Document Attributes", nil, "#{iteration} is not a recognised iteration")
44
44
  end
45
45
 
46
46
  def series_validate(xmldoc)
@@ -48,7 +48,7 @@ module Asciidoctor
48
48
  found = false
49
49
  SERIES.each { |_, v| found = true if v == series }
50
50
  found or
51
- warn "Document Attributes: #{series} is not a recognised series"
51
+ @log.add("Document Attributes", nil, "#{series} is not a recognised series")
52
52
  end
53
53
 
54
54
  def validate(doc)
@@ -60,8 +60,8 @@ module Asciidoctor
60
60
  def introduction_validate(doc)
61
61
  intro = doc.at("//sections/clause/title")
62
62
  intro&.text == "Introduction" or
63
- warn "First section of document body should be Introduction, "\
64
- "not #{intro&.text}"
63
+ @log.add("Style", intro, "First section of document body should be Introduction, "\
64
+ "not #{intro&.text}")
65
65
  end
66
66
 
67
67
  REF_SECTIONS_TO_VALIDATE = "//references[not(parent::clause)]/title | "\
@@ -80,8 +80,8 @@ module Asciidoctor
80
80
  return if names == ["References"]
81
81
  return if names == ["Bibliography"]
82
82
  return if names == ["References", "Bibliography"]
83
- warn "Reference clauses #{names.join(', ')} do not follow expected "\
84
- "pattern in NIST"
83
+ @log.add("Style", nil, "Reference clauses #{names.join(', ')} do not follow expected "\
84
+ "pattern in NIST")
85
85
  end
86
86
  end
87
87
  end
@@ -213,9 +213,6 @@ module IsoDoc
213
213
  clause_parse_title(node, div, node.at(ns("./title")), out) or
214
214
  div.h2 title, **{ class: "Section3" }
215
215
  end
216
- node.elements.reject do |e|
217
- %w(reference title bibitem note).include? e.name
218
- end.each { |e| parse(e, div) }
219
216
  biblio_list(node, div, true)
220
217
  end
221
218
  end
@@ -128,9 +128,6 @@ module IsoDoc
128
128
  f&.at(ns("./title"))&.children.each { |n| parse(n, h1) }
129
129
  end
130
130
  end
131
- f.elements.reject do |e|
132
- ["reference", "title", "bibitem"].include? e.name
133
- end.each { |e| parse(e, div) }
134
131
  biblio_list(f, div, false)
135
132
  end
136
133
  end
@@ -121,9 +121,6 @@ module IsoDoc
121
121
  f&.at(ns("./title"))&.children.each { |n| parse(n, h1) }
122
122
  end
123
123
  end
124
- f.elements.reject do |e|
125
- ["reference", "title", "bibitem"].include? e.name
126
- end.each { |e| parse(e, div) }
127
124
  biblio_list(f, div, false)
128
125
  end
129
126
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module NIST
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -42,5 +42,4 @@ Gem::Specification.new do |spec|
42
42
  spec.add_development_dependency "rubocop", "= 0.54.0"
43
43
  spec.add_development_dependency "simplecov", "~> 0.15"
44
44
  spec.add_development_dependency "timecop", "~> 0.9"
45
- spec.add_development_dependency "metanorma", "~> 0.3.0"
46
45
  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: 1.0.2
4
+ version: 1.0.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: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -220,20 +220,6 @@ dependencies:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0.9'
223
- - !ruby/object:Gem::Dependency
224
- name: metanorma
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - "~>"
228
- - !ruby/object:Gem::Version
229
- version: 0.3.0
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - "~>"
235
- - !ruby/object:Gem::Version
236
- version: 0.3.0
237
223
  description: 'Metanorma NIST gem.
238
224
 
239
225
  '