metanorma-csd 1.3.15 → 1.3.16

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: 84ae0501c0278282d5c4fbefeabfc4e395570b277eb68aebac44bd75fe4750dd
4
- data.tar.gz: bd69beeef7d0da34d6c732946e369383b80fcf3540d9e7316373d39ab3dfbdca
3
+ metadata.gz: 8e97b0d1ef2901121fffd7fff111a20f956228cf43fabd7b9c0ae128abfafc9a
4
+ data.tar.gz: 7582ce91df455fc1b2b6746c71834edf2b2da563ea5b3cfafa89b674b888523e
5
5
  SHA512:
6
- metadata.gz: d3d39e017db7c701bd7aa91ab5a691c8da518d0e6dfd6b6ef8f71a72a78db20694f68871d9cfd6516fbc7f571795c7faf7063e879ccd6541245a9f7853264f91
7
- data.tar.gz: 4825bc55e1255e977336e41abd435a1ac2b4a655b25f9e1ca99e3113f04e94acb61acd8f4531f33f894f71bfbc4627b65bebe817cafd6dd48e805c2106680efc
6
+ metadata.gz: f58c72f802fa14ba50ee4c36057cb17756684b495640f8b6e41d90104e84a089193c92caeb238a88ac668c791113e6ac3c6d25f3324ffc4e7e4ce838f919bccc
7
+ data.tar.gz: 243ff39f1ca569e2d2a3e47cc0848fd65f48b584bb73be038cff2834359230637c83551a65a77ab01d1c3cae9a5562542f7ff12b08abf7f5fe8a10a53d9e67cb
@@ -35,6 +35,7 @@ module Asciidoctor
35
35
  word_converter(node).convert filename
36
36
  pdf_converter(node).convert filename
37
37
  end
38
+ @log.write(@filename + ".err") unless @novalid
38
39
  @files_to_delete.each { |f| FileUtils.rm f }
39
40
  ret
40
41
  end
@@ -43,7 +43,7 @@ module Asciidoctor
43
43
  def metadata_status(node, xml)
44
44
  status = node.attr("status")
45
45
  unless status && ::Metanorma::Csd::DOCSTATUS.keys.include?(status)
46
- warn "#{status} is not a legal status"
46
+ @log.add("Document Attributes", nil, "#{status} is not a legal status")
47
47
  end
48
48
  super
49
49
  end
@@ -70,7 +70,8 @@ module Asciidoctor
70
70
  def doctype(node)
71
71
  d = node.attr("doctype")
72
72
  unless ::Metanorma::Csd::DOCSUFFIX.keys.include?(d)
73
- warn "#{d} is not a legal document type: reverting to 'standard'"
73
+ @log.add("Document Attributes", nil,
74
+ "#{d} is not a legal document type: reverting to 'standard'")
74
75
  d = "standard"
75
76
  end
76
77
  d
@@ -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>
@@ -14,15 +14,15 @@ module Asciidoctor
14
14
  def doctype_validate(xmldoc)
15
15
  doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
16
16
  %w(directive guide specification standard report administrative amendment
17
- technical-corrigendum advisory).include? doctype or
18
- warn "Document Attributes: #{doctype} is not a recognised document type"
17
+ technical-corrigendum advisory).include?(doctype) or
18
+ @log.add("Document Attributes", nil, "#{doctype} is not a recognised document type")
19
19
  end
20
20
 
21
21
  def stage_validate(xmldoc)
22
22
  stage = xmldoc&.at("//bibdata/status/stage")&.text
23
23
  %w(proposal working-draft committee-draft draft-standard final-draft
24
- published withdrawn).include? stage or
25
- warn "Document Attributes: #{stage} is not a recognised status"
24
+ published withdrawn).include?(stage) or
25
+ @log.add("Document Attributes", nil, "#{stage} is not a recognised status")
26
26
  end
27
27
  end
28
28
  end
@@ -10,19 +10,19 @@ module Asciidoctor
10
10
  super
11
11
  end
12
12
 
13
- ONE_SYMBOLS_WARNING = "ISO style: only one Symbols and Abbreviated "\
13
+ ONE_SYMBOLS_WARNING = "Only one Symbols and Abbreviated "\
14
14
  "Terms section in the standard".freeze
15
15
 
16
- NON_DL_SYMBOLS_WARNING = "ISO style: Symbols and Abbreviated Terms can "\
16
+ NON_DL_SYMBOLS_WARNING = "Symbols and Abbreviated Terms can "\
17
17
  "only contain a definition list".freeze
18
18
 
19
19
  def symbols_validate(root)
20
20
  f = root.xpath("//definitions")
21
21
  f.empty? && return
22
- (f.size == 1) || warn(ONE_SYMBOLS_WARNING)
22
+ (f.size == 1) || @log.add("Style", f.first, ONE_SYMBOLS_WARNING)
23
23
  f.first.elements.each do |e|
24
24
  unless e.name == "dl"
25
- warn(NON_DL_SYMBOLS_WARNING)
25
+ @log.add("Style", f.first, NON_DL_SYMBOLS_WARNING)
26
26
  return
27
27
  end
28
28
  end
@@ -31,7 +31,7 @@ module Asciidoctor
31
31
  def seqcheck(names, msg, accepted)
32
32
  n = names.shift
33
33
  unless accepted.include? n
34
- warn "ISO style: #{msg}"
34
+ @log.add("Style", nil, msg)
35
35
  names = []
36
36
  end
37
37
  names
@@ -92,46 +92,46 @@ module Asciidoctor
92
92
  n = names.shift || return
93
93
  end
94
94
  unless n
95
- warn "ISO style: Document must contain at least one clause"
95
+ @log.add("Style", nil, "Document must contain at least one clause")
96
96
  return
97
97
  end
98
98
  n[:tag] == "clause" ||
99
- warn("ISO style: Document must contain clause after "\
99
+ @log.add("Style", nil, "Document must contain clause after "\
100
100
  "Terms and Definitions")
101
101
  n == { tag: "clause", title: "Scope" } &&
102
- warn("ISO style: Scope must occur before Terms and Definitions")
102
+ @log.add("Style", nil, "Scope must occur before Terms and Definitions")
103
103
  n = names.shift || return
104
104
  while n[:tag] == "clause"
105
105
  n[:title] == "Scope" &&
106
- warn("ISO style: Scope must occur before Terms and Definitions")
106
+ @log.add("Style", nil, "Scope must occur before Terms and Definitions")
107
107
  n = names.shift || return
108
108
  end
109
109
  unless n[:tag] == "annex" || n[:tag] == "references"
110
- warn "ISO style: Only annexes and references can follow clauses"
110
+ @log.add("Style", nil, "Only annexes and references can follow clauses")
111
111
  end
112
112
  while n[:tag] == "annex"
113
113
  n = names.shift
114
114
  if n.nil?
115
- warn("ISO style: Document must include (references) "\
115
+ @log.add("Style", nil, "Document must include (references) "\
116
116
  "Normative References")
117
117
  return
118
118
  end
119
119
  end
120
120
  n == { tag: "references", title: "Normative References" } ||
121
- warn("ISO style: Document must include (references) "\
121
+ @log.add("Style", nil, "Document must include (references) "\
122
122
  "Normative References")
123
123
  n = names.shift
124
124
  n == { tag: "references", title: "Bibliography" } ||
125
- warn("ISO style: Final section must be (references) Bibliography")
125
+ @log.add("Style", nil, "Final section must be (references) Bibliography")
126
126
  names.empty? ||
127
- warn("ISO style: There are sections after the final Bibliography")
127
+ @log.add("Style", nil, "There are sections after the final Bibliography")
128
128
  end
129
129
 
130
130
  def style_warning(node, msg, text = nil)
131
131
  return if @novalid
132
- w = "ISO style: WARNING (#{Standoc::Utils::current_location(node)}): #{msg}"
132
+ w = msg
133
133
  w += ": #{text}" if text
134
- warn w
134
+ @log.add("Style", node, w)
135
135
  end
136
136
  end
137
137
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csd
3
- VERSION = "1.3.15"
3
+ VERSION = "1.3.16"
4
4
  end
5
5
  end
@@ -40,5 +40,4 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "rubocop", "= 0.54.0"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
- spec.add_development_dependency "metanorma", "~> 0.3.0"
44
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.15
4
+ version: 1.3.16
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: metanorma-standoc
@@ -164,20 +164,6 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0.9'
167
- - !ruby/object:Gem::Dependency
168
- name: metanorma
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: 0.3.0
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: 0.3.0
181
167
  description: |
182
168
  metanorma-csd lets you write CSD in AsciiDoc syntax.
183
169