metanorma-iho 1.2.6 → 1.2.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.
@@ -17,8 +17,8 @@ module IsoDoc
17
17
  def i18n_init(lang, script, locale, i18nyaml = nil)
18
18
  @i18n = I18n.new(
19
19
  lang, script, locale: locale,
20
- i18nyaml: i18nyaml ||
21
- Metanorma::Iho.configuration.i18nyaml || @i18nyaml
20
+ i18nyaml: [i18nyaml,
21
+ Metanorma::Iho.configuration.i18nyaml, @i18nyaml]
22
22
  )
23
23
  end
24
24
 
@@ -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
@@ -37,3 +37,5 @@ module Metanorma
37
37
  end
38
38
  end
39
39
  end
40
+
41
+ require_relative "log"
@@ -19,8 +19,7 @@ module Metanorma
19
19
 
20
20
  def metadata_ext(node, ext)
21
21
  unless node.attr("workgroup")
22
- @log.add("AsciiDoc Input", nil,
23
- "Missing workgroup attribute for document")
22
+ @log.add("IHO_1", nil)
24
23
  end
25
24
  super
26
25
  metadata_commentperiod(node, ext)
@@ -46,7 +45,7 @@ module Metanorma
46
45
  end
47
46
 
48
47
  def title_main(node, xml)
49
- title = node.attr("title") || node.attr("doctitle")
48
+ title = node.attr("title") or return
50
49
  add_title_xml(xml, title, "en", "title-main")
51
50
  end
52
51
 
@@ -57,6 +56,7 @@ module Metanorma
57
56
  %i(appendix annex part supplement).each do |w|
58
57
  typed_title(m, xml, w)
59
58
  end
59
+ title_fallback(node, xml)
60
60
  end
61
61
 
62
62
  def typed_title(metadata, xml, type)
@@ -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,17 @@
1
+ module Metanorma
2
+ module Iho
3
+ class Converter
4
+ IHO_LOG_MESSAGES = {
5
+ # rubocop:disable Naming/VariableNumber
6
+ "IHO_1": { category: "AsciiDoc Input",
7
+ error: "Missing workgroup attribute for document",
8
+ severity: 2 },
9
+ }.freeze
10
+ # rubocop:enable Naming/VariableNumber
11
+
12
+ def log_messages
13
+ super.merge(IHO_LOG_MESSAGES)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.2.6".freeze
3
+ VERSION = "1.2.8".freeze
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  template:
2
- standard: "{{ authoritative_identifier | first }} edition_{{ edition }} : {{ title }}, {{ creatornames }}, {{role}}, {{ publisher }} ({{ uri }}) ."
2
+ standard: "{{ authoritative_identifier | first }} {{ edition | downcase }} : {{ title }}$$$ {{ creatornames }}$$$ {{role}}$$$ {{ publisher }} ({{ uri }})"
3
3
  misc: standard
4
4
  nametemplate:
5
5
  one: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} {{initials[0]}}{% endif %}"
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 3.1.0"
30
+ spec.add_dependency "metanorma-generic", "~> 3.2.0"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -40,5 +40,5 @@ spec.add_development_dependency "rubocop-performance"
40
40
  spec.add_development_dependency "sassc-embedded", "~> 1"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
- spec.add_development_dependency "canon"
43
+ spec.add_development_dependency "canon", "= 0.1.3"
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
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-generic
@@ -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: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -182,16 +182,16 @@ dependencies:
182
182
  name: canon
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: '0'
187
+ version: 0.1.3
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - '='
193
193
  - !ruby/object:Gem::Version
194
- version: '0'
194
+ version: 0.1.3
195
195
  description: |
196
196
  metanorma-iho lets you write IHO in AsciiDoc syntax.
197
197
 
@@ -247,6 +247,7 @@ files:
247
247
  - lib/metanorma/iho/front.rb
248
248
  - lib/metanorma/iho/iho.rng
249
249
  - lib/metanorma/iho/isodoc.rng
250
+ - lib/metanorma/iho/log.rb
250
251
  - lib/metanorma/iho/processor.rb
251
252
  - lib/metanorma/iho/relaton-iho.rng
252
253
  - lib/metanorma/iho/reqt.rng