metanorma-iho 1.4.2 → 1.4.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 824725320798b47f87cd40d24f23c15cd4ab90be26fc64f57bad206e64582b37
4
- data.tar.gz: c44ebe0729cc65fae4f5fdc44cf7fc96e7803f0f2d86d2ba882dfc3428a3240a
3
+ metadata.gz: 7e47e28ea024b8de6f8c7ffa8494f820dc0b085de8e8583fc68b05868dcd6ff8
4
+ data.tar.gz: 34bf90352d30b8799e28fc1a2f36b68d38cc1bb178622a4c5d97a2e50572bf15
5
5
  SHA512:
6
- metadata.gz: 6f2bbdc06b70a035b7934587c0e5d970803a20da9e975561cbe435b93a3a2525183276ae2daf39c59c5eb6817bc4896a4092b64ed4025da049b08844490ee96e
7
- data.tar.gz: 24be541a07bbad79baee00bdc2bbabe6db706473e119693508bbc4f9f125c0c6f16ef4aa0790f8a8468c2143fcfcb1793cf2fb2a74a4976e93a671e300577a4f
6
+ metadata.gz: b2c5c07e3394a6753824be091cc09cd81a77d1b0e89a58177d1394e2f3c158a0189dbbbb252eff00124db1ea37008f058a4abaf83e66c1c859b963ef9006f6c6
7
+ data.tar.gz: 3c07104021dabcca471db89fde4ce63a4efb891160b3ded2369a53cd8b78730dd0902e1e5fb942b2dd101bc07ac4341a3878dc80e7e14d33779f2ff23836d44e
data/Gemfile CHANGED
@@ -5,7 +5,6 @@ gemspec
5
5
 
6
6
  # canonical line: relaton 3 finals over the α engine line
7
7
  gem "pubid", "~> 2.0"
8
- gem "relaton-cli", "~> 3.0"
9
8
  gem "isodoc", "~> 3.7.9"
10
9
  gem "isodoc-i18n", github: "metanorma/isodoc-i18n", branch: "main"
11
10
  gem "metanorma-standoc", "~> 3.5.7"
@@ -10,16 +10,21 @@ module Metanorma
10
10
 
11
11
  def bibdata_docidentifier_i18n(isoxml)
12
12
  id, parts = bibdata_docidentifier_i18n_prep(isoxml)
13
- parts.empty? and return
13
+ (parts.empty? || id.nil?) and return
14
14
  id_alt = id.dup
15
15
  id.next = id_alt
16
- id_alt["type"] = "IHO-parent-document"
16
+ id["type"] and id_alt["type"] = "#{id["type"]}-parent-document"
17
17
  id_alt.delete("primary")
18
18
  bibdata_docidentifier_enhance(id, parts)
19
19
  end
20
20
 
21
21
  def bibdata_docidentifier_i18n_prep(isoxml)
22
- id = isoxml.at("//bibdata/docidentifier[@type = 'IHO']")
22
+ # Mutate the identifier the document actually carries
23
+ # (metanorma-iho#577): a document compiled under a taste carries
24
+ # that taste's organisation type on its primary docidentifier,
25
+ # so a hardcoded type string is not a legal match key.
26
+ id = isoxml.at("//bibdata/docidentifier[@primary = 'true']") ||
27
+ isoxml.at("//bibdata/docidentifier")
23
28
  parts = %w(appendixid annexid part supplementid)
24
29
  .each_with_object({}) do |w, m|
25
30
  dn = isoxml.at("//bibdata/ext/structuredidentifier/#{w}") and
@@ -15,6 +15,23 @@ module Metanorma
15
15
  Metanorma::Iho.configuration
16
16
  end
17
17
 
18
+ # A taste registers its own vocabulary through its metanorma.yml,
19
+ # handed to the converter as the :customize: document attribute
20
+ # (metanorma-iho#578). The generic implementation files it under
21
+ # the generic flavour's configuration, which nothing on this
22
+ # flavour's path reads: file it under this flavour's
23
+ # configuration instead, and re-register this flavour's
24
+ # processor. The taste's doctype vocabulary extends the base's
25
+ # rather than replacing it: a document of the base vocabulary
26
+ # stays legal under a taste that declares its own.
27
+ def read_config_file(path_to_config_file)
28
+ base_doctypes = configuration.doctypes || {}
29
+ configuration.set_default_values_from_yaml_file(path_to_config_file)
30
+ taste_doctypes = configuration.doctypes and
31
+ configuration.doctypes = base_doctypes.merge(taste_doctypes)
32
+ Metanorma::Registry.instance.register(Metanorma::Iho::Processor)
33
+ end
34
+
18
35
  # IHO M-3 (2026) development-stage vocabulary (metanorma-iho#553):
19
36
  # a `:status:` value may be the stage slug or its M-3 abbreviation;
20
37
  # both normalize to the slug with the abbreviation carried on the
@@ -17,6 +17,16 @@ module Metanorma
17
17
  end
18
18
  end
19
19
 
20
+ # The :urn: document attribute carries the document's URN; bibdata
21
+ # keeps it as a typed uri (metanorma-iho#579). Generating the URN
22
+ # through pubid belongs to the consuming taste; this is the
23
+ # generic attribute-to-bibdata propagation, inert when the
24
+ # attribute is absent.
25
+ def metadata_source(node, xml)
26
+ super
27
+ add_noko_elem(xml, "uri", node.attr("urn"), type: "urn")
28
+ end
29
+
20
30
  def metadata_ext(node, ext)
21
31
  # Compile probes run the converter on bare internal documents
22
32
  # without user attributes; only warn on real document headers.
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.4.2".freeze
3
+ VERSION = "1.4.3".freeze
4
4
  end
5
5
  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.4.2
4
+ version: 1.4.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: 2026-11-06 00:00:00.000000000 Z
11
+ date: 2026-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic