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 +4 -4
- data/Gemfile +0 -1
- data/lib/metanorma/iho/cleanup.rb +8 -3
- data/lib/metanorma/iho/converter.rb +17 -0
- data/lib/metanorma/iho/front.rb +10 -0
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e47e28ea024b8de6f8c7ffa8494f820dc0b085de8e8583fc68b05868dcd6ff8
|
|
4
|
+
data.tar.gz: 34bf90352d30b8799e28fc1a2f36b68d38cc1bb178622a4c5d97a2e50572bf15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2c5c07e3394a6753824be091cc09cd81a77d1b0e89a58177d1394e2f3c158a0189dbbbb252eff00124db1ea37008f058a4abaf83e66c1c859b963ef9006f6c6
|
|
7
|
+
data.tar.gz: 3c07104021dabcca471db89fde4ce63a4efb891160b3ded2369a53cd8b78730dd0902e1e5fb942b2dd101bc07ac4341a3878dc80e7e14d33779f2ff23836d44e
|
data/Gemfile
CHANGED
|
@@ -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"] = "
|
|
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
|
-
|
|
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
|
data/lib/metanorma/iho/front.rb
CHANGED
|
@@ -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.
|
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.
|
|
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-
|
|
11
|
+
date: 2026-11-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: metanorma-generic
|