metanorma-iho 1.4.1.pre.alpha.3 → 1.4.2
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 +7 -9
- data/lib/isodoc/iho/iho.specification.xsl +17 -12
- data/lib/isodoc/iho/iho.standard.xsl +17 -12
- data/lib/metanorma/iho/citation_style.rb +1 -1
- data/lib/metanorma/iho/converter.rb +18 -0
- data/lib/metanorma/iho/front.rb +25 -0
- data/lib/metanorma/iho/html/renderer.rb +4 -1
- data/lib/metanorma/iho/m3_stages.rb +37 -0
- data/lib/metanorma/iho/version.rb +1 -1
- data/lib/metanorma/iho.rb +1 -0
- data/metanorma-iho.gemspec +1 -2
- data/metanorma.yml +2 -0
- metadata +7 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 824725320798b47f87cd40d24f23c15cd4ab90be26fc64f57bad206e64582b37
|
|
4
|
+
data.tar.gz: c44ebe0729cc65fae4f5fdc44cf7fc96e7803f0f2d86d2ba882dfc3428a3240a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f2bbdc06b70a035b7934587c0e5d970803a20da9e975561cbe435b93a3a2525183276ae2daf39c59c5eb6817bc4896a4092b64ed4025da049b08844490ee96e
|
|
7
|
+
data.tar.gz: 24be541a07bbad79baee00bdc2bbabe6db706473e119693508bbc4f9f125c0c6f16ef4aa0790f8a8468c2143fcfcb1793cf2fb2a74a4976e93a671e300577a4f
|
data/Gemfile
CHANGED
|
@@ -3,17 +3,15 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
|
|
|
3
3
|
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
-
# canonical
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
gem "
|
|
10
|
-
gem "relaton-cli", "~> 3.0.0.pre.alpha"
|
|
11
|
-
gem "isodoc", github: "metanorma/isodoc", branch: "main"
|
|
6
|
+
# canonical line: relaton 3 finals over the α engine line
|
|
7
|
+
gem "pubid", "~> 2.0"
|
|
8
|
+
gem "relaton-cli", "~> 3.0"
|
|
9
|
+
gem "isodoc", "~> 3.7.9"
|
|
12
10
|
gem "isodoc-i18n", github: "metanorma/isodoc-i18n", branch: "main"
|
|
13
|
-
gem "metanorma-standoc",
|
|
14
|
-
gem "metanorma-document",
|
|
11
|
+
gem "metanorma-standoc", "~> 3.5.7"
|
|
12
|
+
gem "metanorma-document", "~> 0.5.3"
|
|
15
13
|
gem "metanorma-core", github: "metanorma/metanorma-core", branch: "main"
|
|
16
14
|
gem "metanorma-iso", github: "metanorma/metanorma-iso", branch: "main"
|
|
17
15
|
gem "metanorma-generic", github: "metanorma/metanorma-generic", branch: "main"
|
|
18
|
-
gem "metanorma-utils",
|
|
16
|
+
gem "metanorma-utils", "~> 2.0"
|
|
19
17
|
gem "metanorma-plugin-lutaml", github: "metanorma/metanorma-plugin-lutaml", branch: "main"
|
|
@@ -43,18 +43,6 @@
|
|
|
43
43
|
</xsl:variable>
|
|
44
44
|
<xsl:variable name="variables" select="xalan:nodeset($variables_)"/>
|
|
45
45
|
|
|
46
|
-
<xsl:template name="getVariable">
|
|
47
|
-
<xsl:param name="variable"/>
|
|
48
|
-
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
49
|
-
<xsl:value-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]"/>
|
|
50
|
-
</xsl:template>
|
|
51
|
-
|
|
52
|
-
<xsl:template name="getVariableCopyOf">
|
|
53
|
-
<xsl:param name="variable"/>
|
|
54
|
-
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
55
|
-
<xsl:copy-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]/node()"/>
|
|
56
|
-
</xsl:template>
|
|
57
|
-
|
|
58
46
|
<!-- Example:
|
|
59
47
|
<item level="1" id="Foreword" display="true">Foreword</item>
|
|
60
48
|
<item id="term-script" display="false">3.2</item>
|
|
@@ -16542,6 +16530,23 @@
|
|
|
16542
16530
|
</xsl:choose>
|
|
16543
16531
|
</xsl:template>
|
|
16544
16532
|
|
|
16533
|
+
<xsl:template name="getVariable">
|
|
16534
|
+
<xsl:param name="variable"/>
|
|
16535
|
+
<!-- Note: need insert <xsl:variable name="setVariable" select="java:org.metanorma.fop.global.Variables.setVariable('num', $num)"/> before
|
|
16536
|
+
in the iteration <xsl:for-each select="xalan:nodeset($updated_xml)//mn:metanorma"> -->
|
|
16537
|
+
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
16538
|
+
<xsl:value-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]"/>
|
|
16539
|
+
</xsl:template>
|
|
16540
|
+
|
|
16541
|
+
<!-- get variable value with the internal elements(nodes), e.g. formatting -->
|
|
16542
|
+
<xsl:template name="getVariableCopyOf">
|
|
16543
|
+
<xsl:param name="variable"/>
|
|
16544
|
+
<!-- Note: need insert <xsl:variable name="setVariable" select="java:org.metanorma.fop.global.Variables.setVariable('num', $num)"/> before
|
|
16545
|
+
in the iteration <xsl:for-each select="xalan:nodeset($updated_xml)//mn:metanorma"> -->
|
|
16546
|
+
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
16547
|
+
<xsl:copy-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]/node()"/>
|
|
16548
|
+
</xsl:template>
|
|
16549
|
+
|
|
16545
16550
|
<!-- ============================================= -->
|
|
16546
16551
|
<!-- mode="print_as_xml", for debug purposes -->
|
|
16547
16552
|
<!-- ============================================= -->
|
|
@@ -43,18 +43,6 @@
|
|
|
43
43
|
</xsl:variable>
|
|
44
44
|
<xsl:variable name="variables" select="xalan:nodeset($variables_)"/>
|
|
45
45
|
|
|
46
|
-
<xsl:template name="getVariable">
|
|
47
|
-
<xsl:param name="variable"/>
|
|
48
|
-
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
49
|
-
<xsl:value-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]"/>
|
|
50
|
-
</xsl:template>
|
|
51
|
-
|
|
52
|
-
<xsl:template name="getVariableCopyOf">
|
|
53
|
-
<xsl:param name="variable"/>
|
|
54
|
-
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
55
|
-
<xsl:copy-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]/node()"/>
|
|
56
|
-
</xsl:template>
|
|
57
|
-
|
|
58
46
|
<!-- Example:
|
|
59
47
|
<item level="1" id="Foreword" display="true">Foreword</item>
|
|
60
48
|
<item id="term-script" display="false">3.2</item>
|
|
@@ -16542,6 +16530,23 @@
|
|
|
16542
16530
|
</xsl:choose>
|
|
16543
16531
|
</xsl:template>
|
|
16544
16532
|
|
|
16533
|
+
<xsl:template name="getVariable">
|
|
16534
|
+
<xsl:param name="variable"/>
|
|
16535
|
+
<!-- Note: need insert <xsl:variable name="setVariable" select="java:org.metanorma.fop.global.Variables.setVariable('num', $num)"/> before
|
|
16536
|
+
in the iteration <xsl:for-each select="xalan:nodeset($updated_xml)//mn:metanorma"> -->
|
|
16537
|
+
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
16538
|
+
<xsl:value-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]"/>
|
|
16539
|
+
</xsl:template>
|
|
16540
|
+
|
|
16541
|
+
<!-- get variable value with the internal elements(nodes), e.g. formatting -->
|
|
16542
|
+
<xsl:template name="getVariableCopyOf">
|
|
16543
|
+
<xsl:param name="variable"/>
|
|
16544
|
+
<!-- Note: need insert <xsl:variable name="setVariable" select="java:org.metanorma.fop.global.Variables.setVariable('num', $num)"/> before
|
|
16545
|
+
in the iteration <xsl:for-each select="xalan:nodeset($updated_xml)//mn:metanorma"> -->
|
|
16546
|
+
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
16547
|
+
<xsl:copy-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]/node()"/>
|
|
16548
|
+
</xsl:template>
|
|
16549
|
+
|
|
16545
16550
|
<!-- ============================================= -->
|
|
16546
16551
|
<!-- mode="print_as_xml", for debug purposes -->
|
|
16547
16552
|
<!-- ============================================= -->
|
|
@@ -15,6 +15,24 @@ module Metanorma
|
|
|
15
15
|
Metanorma::Iho.configuration
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
# IHO M-3 (2026) development-stage vocabulary (metanorma-iho#553):
|
|
19
|
+
# a `:status:` value may be the stage slug or its M-3 abbreviation;
|
|
20
|
+
# both normalize to the slug with the abbreviation carried on the
|
|
21
|
+
# stage element. Values outside the M-3 vocabulary pass through
|
|
22
|
+
# unchanged (in-force, draft, ...).
|
|
23
|
+
def metadata_status(node, xml)
|
|
24
|
+
return super unless node.attr("status")
|
|
25
|
+
|
|
26
|
+
stage, abbr = M3Stages.normalize(node.attr("status"))
|
|
27
|
+
abbr ||= node.attr("docstage-abbrev")
|
|
28
|
+
xml.status do |s|
|
|
29
|
+
add_noko_elem(s, "stage", stage, abbreviation: abbr)
|
|
30
|
+
add_noko_elem(s, "substage", node.attr("docsubstage") ||
|
|
31
|
+
node.attr("substage"))
|
|
32
|
+
add_noko_elem(s, "iteration", node.attr("iteration"))
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
18
36
|
def presentation_xml_converter(node)
|
|
19
37
|
IsoDoc::Iho::PresentationXMLConvert
|
|
20
38
|
.new(html_extract_attributes(node)
|
data/lib/metanorma/iho/front.rb
CHANGED
|
@@ -24,9 +24,34 @@ module Metanorma
|
|
|
24
24
|
@log.add("IHO_1", nil)
|
|
25
25
|
end
|
|
26
26
|
super
|
|
27
|
+
metadata_committee(node, ext)
|
|
27
28
|
metadata_commentperiod(node, ext)
|
|
28
29
|
end
|
|
29
30
|
|
|
31
|
+
# IHO S-4 documents carry their editorial group as plain attributes:
|
|
32
|
+
# :committee:/:workgroup: (with _2, _3… suffixes for additional
|
|
33
|
+
# groups). Emitted into bibdata <ext><editorialgroup>, the shape
|
|
34
|
+
# relaton's IHO hash parser normalizes
|
|
35
|
+
# (relaton/iho/hash_parser_v1#editorialgroup_hash_to_bib). The
|
|
36
|
+
# emission was dropped in d1af149 as an IEC-motivated ride-along
|
|
37
|
+
# (metanorma-iec#191); IHO genuinely uses it.
|
|
38
|
+
def metadata_committee(node, xml)
|
|
39
|
+
node.attr("workgroup") or return
|
|
40
|
+
i = 1
|
|
41
|
+
while node.attr("workgroup#{i == 1 ? "" : "_#{i}"}")
|
|
42
|
+
sfx = i == 1 ? "" : "_#{i}"
|
|
43
|
+
xml.editorialgroup do |a|
|
|
44
|
+
a.committee do |n|
|
|
45
|
+
n.abbreviation node.attr("committee#{sfx}").to_s.upcase
|
|
46
|
+
end
|
|
47
|
+
a.workgroup do |n|
|
|
48
|
+
n.abbreviation node.attr("workgroup#{sfx}").upcase
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
i += 1
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
30
55
|
def metadata_commentperiod(node, xml)
|
|
31
56
|
from = node.attr("comment-from") or return
|
|
32
57
|
xml.commentperiod do |c|
|
|
@@ -78,7 +78,10 @@ module Metanorma
|
|
|
78
78
|
text = Array(element.value).join.strip
|
|
79
79
|
return nil if text.empty?
|
|
80
80
|
|
|
81
|
-
text.split("-").map(&:capitalize).join(" ")
|
|
81
|
+
label = text.split("-").map(&:capitalize).join(" ")
|
|
82
|
+
abbr = element.respond_to?(:abbreviation) ? element.abbreviation : nil
|
|
83
|
+
abbr = Array(abbr).filter_map { |a| a.respond_to?(:value) ? Array(a.value).join.strip : nil }.first
|
|
84
|
+
abbr && !abbr.empty? ? "#{label} (#{abbr})" : label
|
|
82
85
|
end
|
|
83
86
|
|
|
84
87
|
def iho_copyright_line(bibdata)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Iho
|
|
5
|
+
# IHO M-3 (2026 edition), "Principles and procedures for making changes
|
|
6
|
+
# to IHO technical standards and specifications", document development
|
|
7
|
+
# stages (p. 68). A `:status:` value may be given as the stage slug or
|
|
8
|
+
# as its M-3 abbreviation; both normalize to the slug plus the
|
|
9
|
+
# abbreviation, which is carried on the bibdata stage element so the
|
|
10
|
+
# development stage is identifiable in the rendered document.
|
|
11
|
+
module M3Stages
|
|
12
|
+
STAGES = {
|
|
13
|
+
"concept-proposal" => "CP",
|
|
14
|
+
"proposal-development" => "PD",
|
|
15
|
+
"working-draft" => "WD",
|
|
16
|
+
"endorsement-draft" => "ED",
|
|
17
|
+
"approval-draft" => "AD",
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
# Returns [stage, abbreviation]. Values outside the M-3 2026
|
|
21
|
+
# vocabulary pass through unchanged with no abbreviation, preserving
|
|
22
|
+
# the pre-M-3 2026 statuses (in-force, draft, ...).
|
|
23
|
+
def self.normalize(value)
|
|
24
|
+
raw = value.to_s.strip
|
|
25
|
+
return [nil, nil] if raw.empty?
|
|
26
|
+
|
|
27
|
+
slug = raw.downcase.tr(" ", "-").tr("_", "-")
|
|
28
|
+
return [slug, STAGES[slug]] if STAGES.key?(slug)
|
|
29
|
+
|
|
30
|
+
hit = STAGES.find { |_s, abbr| abbr.casecmp(raw).zero? }
|
|
31
|
+
return [hit[0], hit[1]] if hit
|
|
32
|
+
|
|
33
|
+
[raw, nil]
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
data/lib/metanorma/iho.rb
CHANGED
data/metanorma-iho.gemspec
CHANGED
|
@@ -27,10 +27,9 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.require_paths = ["lib"]
|
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
|
|
29
29
|
|
|
30
|
-
spec.add_dependency "metanorma-generic", "
|
|
30
|
+
spec.add_dependency "metanorma-generic", "~> 3.5.1"
|
|
31
31
|
|
|
32
32
|
spec.add_development_dependency "debug"
|
|
33
|
-
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
|
34
33
|
spec.add_development_dependency "guard", "~> 2.14"
|
|
35
34
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
|
36
35
|
spec.add_development_dependency "rake", "~> 13.0"
|
data/metanorma.yml
CHANGED
|
@@ -12,6 +12,8 @@ committees:
|
|
|
12
12
|
full_name: Inter-Regional Coordination Committee
|
|
13
13
|
- code: ihb
|
|
14
14
|
full_name: International Hydrographic Bureau
|
|
15
|
+
- code: ncwg
|
|
16
|
+
full_name: Nautical Cartography Working Group
|
|
15
17
|
htmlcoverpage: lib/isodoc/iho/html/html_iho_titlepage.html
|
|
16
18
|
htmlintropage: lib/isodoc/iho/html/html_iho_intro.html
|
|
17
19
|
htmlstylesheet: lib/isodoc/iho/html/htmlstyle.scss
|
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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.2
|
|
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
|
+
date: 2026-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: metanorma-generic
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.5.1
|
|
19
|
+
version: 3.5.1
|
|
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.5.1
|
|
26
|
+
version: 3.5.1
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: debug
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -38,20 +38,6 @@ dependencies:
|
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: equivalent-xml
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0.6'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0.6'
|
|
55
41
|
- !ruby/object:Gem::Dependency
|
|
56
42
|
name: guard
|
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -260,6 +246,7 @@ files:
|
|
|
260
246
|
- lib/metanorma/iho/iho-style.yml
|
|
261
247
|
- lib/metanorma/iho/iho.rng
|
|
262
248
|
- lib/metanorma/iho/log.rb
|
|
249
|
+
- lib/metanorma/iho/m3_stages.rb
|
|
263
250
|
- lib/metanorma/iho/mathml4-content.rng
|
|
264
251
|
- lib/metanorma/iho/mathml4-core.rng
|
|
265
252
|
- lib/metanorma/iho/mathml4-presentation.rng
|