metanorma-iec 2.7.6 → 2.7.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.
@@ -869,7 +869,7 @@ depending on whether the items exist as independent documents, or are parts of a
869
869
  </zeroOrMore>
870
870
  </element>
871
871
  </define>
872
- <define name="BibItemType" combine="choice">
872
+ <define name="BibItemType">
873
873
  <a:documentation>Type of bibliographic item.
874
874
  The value list complies with the types provided in ISO 690:2021.
875
875
  NOTE: These values represent a strict superset to BibTeX
@@ -33,12 +33,10 @@ module Metanorma
33
33
  %w(international-standard technical-specification technical-report
34
34
  publicly-available-specification international-workshop-agreement
35
35
  guide interpretation-sheet).include? @doctype or
36
- @log.add("Document Attributes", nil,
37
- "#{@doctype} is not a recognised document type")
36
+ @log.add("IEC_2", nil, params: [@doctype])
38
37
  if function = xmldoc.at("//bibdata/ext/function")&.text
39
38
  %w(emc quality-assurance safety environment).include? function or
40
- @log.add("Document Attributes", nil,
41
- "#{function} is not a recognised document function")
39
+ @log.add("IEC_3", nil, params: [function])
42
40
  end
43
41
  end
44
42
 
@@ -180,3 +178,5 @@ module Metanorma
180
178
  end
181
179
  end
182
180
  end
181
+
182
+ require_relative "log"
@@ -153,8 +153,7 @@ module Metanorma
153
153
  def report_illegal_stage(stage, substage)
154
154
  out = stage || ""
155
155
  /[A-Z]/.match?(out) or out += ".#{substage}"
156
- err = "Illegal document stage: #{out}"
157
- @log.add("Document Attributes", nil, err)
156
+ @log.add("IEC_1", nil, params: [out])
158
157
  end
159
158
 
160
159
  def metadata_ext(node, xml)
@@ -311,17 +311,28 @@ and is intended to be referenced by a callout within the source code</a:document
311
311
  </ref>
312
312
  </optional>
313
313
  <choice>
314
- <a:documentation>Content of the figure</a:documentation>
315
- <ref name="image"/>
314
+ <a:documentation>Content of the figure </a:documentation>
315
+ <ref name="image">
316
+ <a:documentation>by default the content of a figure is a media file</a:documentation>
317
+ </ref>
316
318
  <ref name="video"/>
317
319
  <ref name="audio"/>
318
- <ref name="pre"/>
320
+ <ref name="pre">
321
+ <a:documentation>figures can contain ASCII art</a:documentation>
322
+ </ref>
319
323
  <oneOrMore>
320
- <ref name="paragraph-with-footnote"/>
324
+ <ref name="paragraph-with-footnote">
325
+ <a:documentation>figures can contain discursive art</a:documentation>
326
+ </ref>
321
327
  </oneOrMore>
322
328
  <zeroOrMore>
323
- <ref name="figure"/>
329
+ <ref name="figure">
330
+ <a:documentation>subfigures, nested directly within a figure</a:documentation>
331
+ </ref>
324
332
  </zeroOrMore>
333
+ <ref name="table">
334
+ <a:documentation>Table is understood in this context to be a tabular arrangement of subfigures</a:documentation>
335
+ </ref>
325
336
  </choice>
326
337
  <zeroOrMore>
327
338
  <ref name="fn">
@@ -354,17 +365,28 @@ and is intended to be referenced by a callout within the source code</a:document
354
365
  </ref>
355
366
  </optional>
356
367
  <choice>
357
- <a:documentation>Content of the figure</a:documentation>
358
- <ref name="image-no-id"/>
368
+ <a:documentation>Content of the figure </a:documentation>
369
+ <ref name="image-no-id">
370
+ <a:documentation>by default the content of a figure is a media file</a:documentation>
371
+ </ref>
359
372
  <ref name="video-no-id"/>
360
373
  <ref name="audio-no-id"/>
361
- <ref name="pre-no-id"/>
374
+ <ref name="pre-no-id">
375
+ <a:documentation>figures can contain ASCII art</a:documentation>
376
+ </ref>
362
377
  <oneOrMore>
363
- <ref name="paragraph-with-footnote-no-id"/>
378
+ <ref name="paragraph-with-footnote-no-id">
379
+ <a:documentation>figures can contain discursive art</a:documentation>
380
+ </ref>
364
381
  </oneOrMore>
365
382
  <zeroOrMore>
366
- <ref name="figure-no-id"/>
383
+ <ref name="figure-no-id">
384
+ <a:documentation>subfigures, nested directly within a figure</a:documentation>
385
+ </ref>
367
386
  </zeroOrMore>
387
+ <ref name="table-no-id">
388
+ <a:documentation>Table is understood in this context to be a tabular arrangement of subfigures</a:documentation>
389
+ </ref>
368
390
  </choice>
369
391
  <zeroOrMore>
370
392
  <ref name="fn">
@@ -876,6 +898,9 @@ titlecase, or lowercase</a:documentation>
876
898
  <data type="boolean"/>
877
899
  </attribute>
878
900
  </optional>
901
+ <ref name="LocalizedStringAttributes">
902
+ <a:documentation>Specify language of bibitem, can be used to render it with language-specific bibliographic style</a:documentation>
903
+ </ref>
879
904
  <ref name="ReducedBibliographicItem"/>
880
905
  </element>
881
906
  </define>
@@ -0,0 +1,23 @@
1
+ module Metanorma
2
+ module Iec
3
+ class Converter
4
+ IEC_LOG_MESSAGES = {
5
+ # rubocop:disable Naming/VariableNumber
6
+ "IEC_1": { category: "Document Attributes",
7
+ error: "Illegal document stage: %s",
8
+ severity: 2 },
9
+ "IEC_2": { category: "Document Attributes",
10
+ error: "%s is not a recognised document type",
11
+ severity: 2 },
12
+ "IEC_3": { category: "Document Attributes",
13
+ error: "%s is not a recognised document function",
14
+ severity: 2 },
15
+ }.freeze
16
+ # rubocop:enable Naming/VariableNumber
17
+
18
+ def log_messages
19
+ super.merge(IEC_LOG_MESSAGES)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.7.6".freeze
3
+ VERSION = "2.7.8".freeze
4
4
  end
5
5
  end
6
6
 
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
31
31
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
32
32
 
33
- spec.add_dependency "metanorma-iso", "~> 3.1.0"
33
+ spec.add_dependency "metanorma-iso", "~> 3.2.0"
34
34
  spec.add_dependency "pubid"
35
35
 
36
36
  spec.add_development_dependency "debug"
@@ -45,6 +45,6 @@ spec.add_development_dependency "rubocop-performance"
45
45
  spec.add_development_dependency "sassc-embedded", "~> 1"
46
46
  spec.add_development_dependency "simplecov", "~> 0.15"
47
47
  spec.add_development_dependency "timecop", "~> 0.9"
48
- spec.add_development_dependency "canon"
48
+ spec.add_development_dependency "canon", "= 0.1.3"
49
49
  # spec.metadata["rubygems_mfa_required"] = "true"
50
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.6
4
+ version: 2.7.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: 2025-09-29 00:00:00.000000000 Z
11
+ date: 2025-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
19
+ version: 3.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.0
26
+ version: 3.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pubid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -210,16 +210,16 @@ dependencies:
210
210
  name: canon
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: 0.1.3
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: 0.1.3
223
223
  description: |
224
224
  metanorma-iec lets you write IEC standards in AsciiDoc syntax.
225
225
 
@@ -275,6 +275,7 @@ files:
275
275
  - lib/metanorma/iec/iec.rng
276
276
  - lib/metanorma/iec/isodoc.rng
277
277
  - lib/metanorma/iec/isostandard.rng
278
+ - lib/metanorma/iec/log.rb
278
279
  - lib/metanorma/iec/processor.rb
279
280
  - lib/metanorma/iec/relaton-iec.rng
280
281
  - lib/metanorma/iec/reqt.rng