metanorma-iho 1.4.5 → 1.4.7

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: 1f33ef5228d83dd32ae49aeebd1c33df8e80e0baed1f28c82c0ef4ab3e39ed2f
4
- data.tar.gz: d8bc6786c13678a5196b5740c9244cc92158ab71405812e5b1361eda88a7e760
3
+ metadata.gz: 2a0c8836fe444ec765c6b42245525c7c2c80c90446fd1baa6f15f3f1e091727e
4
+ data.tar.gz: 628ae6e520fbb9a24ee27f7bf8afa26fcbf3787e1bcabcfa749913490c013785
5
5
  SHA512:
6
- metadata.gz: 43e3cd5162ce846eb93cdc87cdbfff1138dcaada5509a56568f640549946f60165bb10557ecaf22e2b5b9dd6cfa10d4adba2432c52efb0662d2db5068ddad248
7
- data.tar.gz: e478c371f40e813b25795fe652960efaddf0c575dde225f2c66e9ab5e4123cf00fca175e21f16b981e40ef362c1d124248d95b2ab9a9571797824ac104ec90c2
6
+ metadata.gz: b20740508b1bfe4d3490cc002ea8e37a9f4f8bd19bdef518e2bc14173e5f095e3027ea6d74699171a6f5e753a6902993f25d0208a08481dce1d7c9e9b88e7016
7
+ data.tar.gz: 12feb28601377b2e7446d2b3015d8020a3ebfe5b514cfa89ca9ca6fbc809c12446b679dff96ccb6da6aea663893bcf90f78a8ac3eb94d866be850b885a0c3655
@@ -92,7 +92,7 @@ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
92
92
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
93
93
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
94
94
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
95
- International Hydrographic Organization&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
95
+ {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<o:p></o:p></span></p>
96
96
 
97
97
  </div>
98
98
 
@@ -128,7 +128,7 @@ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
128
128
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
129
129
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
130
130
  1'>                                                                                                                                                                           </span>©
131
- International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
131
+ {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<o:p></o:p></span></p>
132
132
  </div>
133
133
 
134
134
  <div style='mso-element:footer' id=ef2l>
@@ -143,13 +143,12 @@ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
143
143
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
144
144
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
145
145
  1'>                                                                                                                                                                           </span>©
146
- International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
146
+ {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<o:p></o:p></span></p>
147
147
  </div>
148
148
 
149
149
  <div style='mso-element:footer' id=f2>
150
150
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
151
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All
152
- rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
151
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
153
152
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
154
153
  style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>  
155
154
  </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
@@ -162,8 +161,7 @@ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
162
161
 
163
162
  <div style='mso-element:footer' id=f2l>
164
163
  <p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
165
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All
166
- rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
164
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
167
165
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
168
166
  style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>  
169
167
  </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
@@ -187,7 +185,7 @@ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
187
185
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
188
186
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
189
187
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
190
- International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
188
+ {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<o:p></o:p></span></p>
191
189
  </div>
192
190
 
193
191
  <div style='mso-element:footer' id=ef3l>
@@ -203,13 +201,12 @@ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
203
201
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
204
202
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
205
203
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
206
- International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
204
+ {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<o:p></o:p></span></p>
207
205
  </div>
208
206
 
209
207
  <div style='mso-element:footer' id=f3>
210
208
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
211
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All
212
- rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
209
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
213
210
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
214
211
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
215
212
  PAGE<span style='mso-spacerun:yes'>   </span>\* MERGEFORMAT <span
@@ -223,8 +220,7 @@ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span>
223
220
 
224
221
  <div style='mso-element:footer' id=f3l>
225
222
  <p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
226
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© International Hydrographic Association&nbsp;{{ docyear }}&nbsp;– All
227
- rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
223
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ labels["org_name"] | default: "International Hydrographic Organization" }}&nbsp;{{ docyear }}&nbsp;– {{ labels["all_rights_reserved"] | default: "All rights reserved" }}<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
228
224
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
229
225
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
230
226
  PAGE<span style='mso-spacerun:yes'>   </span>\* MERGEFORMAT <span
@@ -3,7 +3,7 @@
3
3
  </div>
4
4
 
5
5
  <div class="document-type-band" id="{{ doctype | downcase | replace: ' ', '-' }}-band">
6
- <p class="document-type">IHO {{ doctype }}</p>
6
+ <p class="document-type">{{ labels["org_abbrev"] | default: "IHO" }} {{ doctype }}</p>
7
7
  </div>
8
8
 
9
9
 
@@ -18,7 +18,7 @@
18
18
  <div class="coverpage-doc-identity">
19
19
  <div class="doc-number">
20
20
  <span class="docnumber">{{ docnumber }}</span>
21
- {% if edition %}<span class="docyear">Edition {{ edition }}</span>{% endif %}
21
+ {% if edition %}<span class="docyear">{{ labels["edition"] | capitalize }} {{ edition }}</span>{% endif %}
22
22
  <span class="docyear">{{ draftinfo }}</span>
23
23
  </div>
24
24
 
@@ -29,7 +29,7 @@
29
29
  </div>
30
30
 
31
31
  <div class="coverpage-logo">
32
- <span>International Hydographic Organization. {{ docyear }}</span><br/>
32
+ <span>{{ labels["org_name"] | default: "International Hydrographic Organization" }}. {{ docyear }}</span><br/>
33
33
  <div class="logo-img">
34
34
  {{ logo }}
35
35
  </div>
@@ -55,7 +55,7 @@
55
55
 
56
56
  <div class="WordSection11">
57
57
  <div class="coverpage-stage-block" >
58
- <span class="coverpage-stage" id="{{ doctype | replace: ' ', '-' | downcase }}">IHO {{ doctype }}</span>
58
+ <span class="coverpage-stage" id="{{ doctype | replace: ' ', '-' | downcase }}">{{ labels["org_abbrev"] | default: "IHO" }} {{ doctype }}</span>
59
59
  </div>
60
60
 
61
61
  <div class="coverpage-stage-block" >
@@ -64,7 +64,7 @@
64
64
  {{- stage -}}
65
65
  {%- else -%}
66
66
  {%- if publisheddate and publisheddate != "XXXX" -%}
67
- Published {{ publisheddate -}}
67
+ {{ labels["published_on"] | default: "Published" }} {{ publisheddate -}}
68
68
  {%- endif -%}
69
69
  {%- endif -%}</span></p>
70
70
  </div>
@@ -733,7 +733,7 @@ AAAPAAAAAAAAAAAAAAAAAAcCAABkcnMvZG93bnJldi54bWxQSwUGAAAAAAMAAwC3AAAA/AIAAAAA
733
733
  <v:textbox style='mso-fit-shape-to-text:t' inset="5mm,8mm,5mm,8mm">
734
734
  <div>
735
735
  <p class="MsoNormal"><b style='mso-bidi-font-weight:normal'><span
736
- lang="EN-US" style='font-family:"Arial",sans-serif'>{{ docnumber}} {% if edition %}Edition {{ edition }}{% endif %}</span></b></p>
736
+ lang="EN-US" style='font-family:"Arial",sans-serif'>{{ docnumber}} {% if edition %}{{ labels["edition"] | capitalize }} {{ edition }}{% endif %}</span></b></p>
737
737
  </div>
738
738
  </v:textbox>
739
739
  </v:shape>
@@ -4,3 +4,7 @@ subclause: Clause
4
4
  dochistory: Document History
5
5
  punct:
6
6
  biblio-field-delimiter: ", "
7
+ org_name: International Hydrographic Organization
8
+ org_abbrev: IHO
9
+ published_on: Published
10
+ all_rights_reserved: All rights reserved
@@ -0,0 +1,10 @@
1
+ table_of_contents: Contenidos
2
+ clause: Sección
3
+ subclause: Cláusula
4
+ dochistory: Historial del documento
5
+ org_name: Organización Hidrográfica Internacional
6
+ org_abbrev: OHI
7
+ published_on: Publicado
8
+ all_rights_reserved: Todos los derechos reservados
9
+ punct:
10
+ biblio-field-delimiter: ", "
@@ -0,0 +1,10 @@
1
+ table_of_contents: Table des matières
2
+ clause: Section
3
+ subclause: Article
4
+ dochistory: Historique du document
5
+ org_name: Organisation hydrographique internationale
6
+ org_abbrev: OHI
7
+ published_on: Publié
8
+ all_rights_reserved: Tous droits réservés
9
+ punct:
10
+ biblio-field-delimiter: ", "
@@ -15,11 +15,21 @@ module IsoDoc
15
15
  end
16
16
 
17
17
  def i18n_init(lang, script, locale, i18nyaml = nil)
18
- i18ns = [i18nyaml,
19
- Metanorma::Iho.configuration.i18nyaml, @i18nyaml]
18
+ i18ns = [i18nyaml, flavor_i18nyaml(lang), @i18nyaml]
20
19
  @i18n = I18n.new(lang, script, locale: locale, i18nyaml: i18ns)
21
20
  end
22
21
 
22
+ # The flavour ships English, French and Spanish strings, selected
23
+ # by document language (metanorma-iho#566: S-4 is published in
24
+ # all three, with identical numbering). Any other language keeps
25
+ # the English flavour overrides on top of the isodoc base strings,
26
+ # as before the per-language split.
27
+ def flavor_i18nyaml(lang)
28
+ f = Metanorma::Iho.configuration.i18nyaml
29
+ f.is_a?(Hash) or return f
30
+ f[lang] || f["en"]
31
+ end
32
+
23
33
  def bibrenderer(options = {})
24
34
  require_relative "../../metanorma/iho/citation_style"
25
35
 
@@ -35,6 +35,29 @@ module IsoDoc
35
35
  end
36
36
  end
37
37
 
38
+ # The cover identity: the FIRST publisher organization's name and
39
+ # abbreviation, with the IHO identity as the defaults so existing
40
+ # IHO documents render unchanged.
41
+ def publisher_identity(isoxml)
42
+ org = isoxml.at(ns("//bibdata/contributor[role/@type = 'publisher']" \
43
+ "/organization"))
44
+ name = org&.at(ns("./name"))&.text || "International Hydrographic " \
45
+ "Organization"
46
+ abbr = org&.at(ns("./abbreviation"))&.text || "IHO"
47
+ set(:publisher_name, name)
48
+ set(:publisher_abbr, abbr)
49
+ return unless org
50
+
51
+ # The cover templates read org_name / org_abbrev labels. Only a
52
+ # publisher NAMED in document bibdata (WMO on S-1XX product
53
+ # specifications) replaces them: when bibdata names no publisher,
54
+ # the flavor's own localized labels stand, as they are the IHO
55
+ # identity in the document language (metanorma-iho#566: S-4 is
56
+ # published in English, French and Spanish editions).
57
+ labels["org_name"] = name
58
+ labels["org_abbrev"] = abbr
59
+ end
60
+
38
61
  def images_logo_xpaths
39
62
  org = "//bibdata/contributor[role/@type = 'publisher']/organization"
40
63
  {
@@ -47,6 +70,7 @@ module IsoDoc
47
70
 
48
71
  def images(xml, out)
49
72
  super
73
+ publisher_identity(xml)
50
74
  images_logo_xpaths.each do |k, v|
51
75
  i = xml.at(ns(v))
52
76
  set(k, i ? to_xml(i.at("./*[local-name() = 'svg']"))&.strip : nil)
@@ -0,0 +1,31 @@
1
+ == copyright-statement
2
+ === {blank}
3
+ [align="center"]
4
+ © Copyright Organización Hidrográfica Internacional {{ docyear }}
5
+
6
+ Esta obra está protegida por los Derechos de Autor. A excepción de todo uso autorizado en el marco de la Convención de Berna para la Protección de las Obras Artísticas y Literarias (1886), y excepto en las circunstancias que se describen a continuación, ninguna parte de esta obra puede ser traducida, reproducida mediante ningún proceso, ni adaptada, comunicada o comercialmente explotada sin previa autorización escrita de la Secretaría de la Organización Hidrográfica Internacional (OHI). Los Derechos de Autor de ciertas partes de esta publicación pueden pertenecer a terceros y la autorización de la traducción y/o reproducción de ese material tiene que ser otorgada por su propietario.
7
+
8
+
9
+ == license-statement
10
+ === {blank}
11
+ Este documento o material de este documento puede ser traducido, reproducido o difundido para información general, basándose únicamente en un importe que no exceda la recuperación de los costes. Ninguna copia podrá ser vendida ni difundida a fines comerciales sin previo acuerdo escrito de la OHI y otros titulares del copyright.
12
+
13
+ En el caso en el que este documento o material parcial de este documento fuese reproducido, traducido o difundido en los términos anteriormente descritos, tendrán que incluirse las siguientes menciones:
14
+
15
+ ____
16
+ "El material procedente de la Publicación de la OHI [referencia del extracto: Título, Edición] se reproduce con la autorización de la Secretaría de la Organización Hidrográfica Internacional (OHI) (Autorización No. ….. /…) actuando en nombre de la Organización Hidrográfica Internacional (OHI), que no es responsable de la exactitud del material reproducido: en caso de duda, prevalecerá el texto auténtico de la OHI. La inclusión de material procedente de la OHI no deberá interpretarse como equivalente de una aprobación de este producto por la OHI."
17
+
18
+ "Este(a) [documento/publicación] es una traducción del/de la [documento/publicación] [nombre] de la OHI. La OHI no ha comprobado esta traducción y por tanto declina toda responsabilidad de su precisión. En caso de duda, deberá consultarse la versión original de [nombre] en [idioma]."
19
+ ____
20
+
21
+ Los escudos de la OHI u otros identificadores no se pueden utilizar en cualquier producto derivado sin previo permiso escrito de la Secretaría de la OHI.
22
+
23
+ == feedback-statement
24
+ Publicado por la +
25
+ Organización Hidrográfica Internacional +
26
+ 4b quai Antoine 1^er^ +
27
+ Principado de Monaco +
28
+ Teléfono: (377) 93.10.81.00 +
29
+ Telefax: (377) 93.10.81.40 +
30
+ link:mailto:info@iho.int[info@iho.int] +
31
+ link:https://www.iho.int[www.iho.int] +
@@ -0,0 +1,30 @@
1
+ == copyright-statement
2
+ === {blank}
3
+ [align="center"]
4
+ © Copyright Organisation hydrographique internationale {{ docyear }}
5
+
6
+ Cet ouvrage est protégé par le droit d’auteur. A l’exception de tout usage autorisé dans le cadre de la Convention de Berne pour la protection des œuvres littéraires et artistiques (1886) et à l’exception des circonstances décrites ci-dessous, aucune partie de cet ouvrage ne peut être traduite, reproduite sous quelque forme que ce soit, adaptée, communiquée ou exploitée à des fins commerciales sans autorisation écrite préalable du Secrétariat de l’Organisation hydrographique internationale (OHI). Le droit d’auteur de certaines parties de cette publication peut être détenu par un tiers et l’autorisation de traduction et/ou de reproduction de ces parties doit être obtenue auprès de leur propriétaire.
7
+
8
+
9
+ == license-statement
10
+ === {blank}
11
+ Ce document, dans son intégralité ou en partie, peut être traduit, reproduit ou diffusé pour information générale sur la base du seul recouvrement des coûts. Aucune reproduction ne peut être vendue ou diffusée à des fins commerciales sans autorisation écrite préalable du Secrétariat de l’OHI ou de tout autre détenteur du droit d’auteur.
12
+
13
+ Au cas où ce document, dans son intégralité ou en partie, serait reproduit, traduit ou diffusé selon les dispositions décrites ci-dessus les mentions suivantes devront être incluses :
14
+
15
+ ____
16
+ "Le matériel provenant de la publication [référence de l’extrait : titre, édition] est reproduit avec la permission du Secrétariat de l’OHI (Autorisation N° …./…), agissant au nom de l’Organisation hydrographique internationale (OHI), qui n’est pas responsable de l’exactitude du matériel reproduit : en cas de doute le texte authentique de l’OHI prévaut. L’inclusion de matériel provenant de l’OHI ne sera pas interprétée comme équivalant à une approbation de ce produit par l’OHI."
17
+
18
+ "Ce [document/publication] est une traduction du [document/publication] [nom] de l’OHI. L’OHI n’a pas vérifié cette traduction et en conséquence décline toute responsabilité quant à sa fidélité. En cas de doute la version source de [nom] en [langue] doit être consultée."
19
+ ____
20
+
21
+ Le logo de l’OHI ou tout autre signe identificateur de l’OHI ne seront pas utilisés dans tout produit dérivé sans autorisation écrite préalable du Secrétariat de l’OHI.
22
+
23
+ == feedback-statement
24
+ Publié par l'Organisation Hydrographique Internationale +
25
+ 4b quai Antoine 1^er^ +
26
+ Principauté de Monaco +
27
+ Tél. : (377) 93.10.81.00 +
28
+ Télécopie : (377) 93.10.81.40 +
29
+ link:mailto:info@iho.int[info@iho.int] +
30
+ link:https://www.iho.int[www.iho.int] +
@@ -3,6 +3,16 @@ module Metanorma
3
3
  class Cleanup < ::Metanorma::Generic::Cleanup
4
4
  extend Forwardable
5
5
 
6
+ # Boilerplate is selected by document language (en/fr/es,
7
+ # metanorma-iho#566); any other language keeps the English IHO
8
+ # boilerplate rather than falling through to the standoc default.
9
+ def boilerplate_file(xmldoc)
10
+ f = configuration.boilerplate
11
+ f.is_a?(Hash) && !f[@lang] && f["en"] and
12
+ return @conv.baselocation(f["en"])
13
+ super
14
+ end
15
+
6
16
  def bibdata_docidentifier_cleanup(isoxml)
7
17
  bibdata_docidentifier_i18n(isoxml)
8
18
  super
@@ -1,5 +1,6 @@
1
1
  require "metanorma-standoc"
2
2
  require "metanorma-generic"
3
+ require "pubid"
3
4
  require_relative "front"
4
5
 
5
6
  module Metanorma
@@ -32,6 +32,10 @@ Metanorma::Core::Flavors.register(Metanorma::Core::Flavor.new(
32
32
  model_root: Metanorma::Iho::Document::Root,
33
33
  pubid_module: :"Pubid::Iho",
34
34
  renderers: { html: lambda do |_document, **_options|
35
- Metanorma::Html::StandardRenderer
35
+ # The IHO subclass carries the flavor registrations (Root/Sections
36
+ # dispatch) and the IHO cover renderer; the base StandardRenderer
37
+ # would render IHO documents unflavored.
38
+ require "metanorma/iho/html/renderer"
39
+ Metanorma::Iho::Html::Renderer
36
40
  end },
37
41
  ))
@@ -62,6 +62,57 @@ module Metanorma
62
62
  end
63
63
  end
64
64
 
65
+ # Loose-leaf sections (metanorma-iho#573). In a Part document
66
+ # (:partnumber: B) a top-level clause declares its update unit with
67
+ # [update-unit=B-400], a Pubid::Iho spec citation (B-400 is the
68
+ # section-level citation of Section 400 of Part B). Each declaring
69
+ # clause is enumerated in bibdata as a hasPart relation whose
70
+ # bibitem carries the section title and the Pubid::Iho identifiers.
71
+ def metadata_relations(node, xml)
72
+ super
73
+ metadata_update_units(node, xml)
74
+ end
75
+
76
+ def metadata_update_units(node, xml)
77
+ part = node.attr("partnumber") or return
78
+ update_unit_sections(node).each do |sect|
79
+ id = update_unit_identifier(sect, part) or next
80
+ xml.relation type: "hasPart" do |r|
81
+ r.bibitem do |b|
82
+ add_noko_elem(b, "title", sect.title)
83
+ add_noko_elem(b, "docidentifier", id.to_s,
84
+ type: "IHO", primary: "true")
85
+ add_noko_elem(b, "docidentifier", id.to_urn, type: "URN")
86
+ end
87
+ end
88
+ end
89
+ end
90
+
91
+ def update_unit_sections(node)
92
+ node.find_by(context: :section) do |s|
93
+ s.level == 1 && s.attr("update-unit")
94
+ end
95
+ end
96
+
97
+ def update_unit_identifier(sect, part)
98
+ val = sect.attr("update-unit").to_s.strip
99
+ id = update_unit_parse(val)
100
+ if id.nil?
101
+ @log.add("IHO_2", sect, params: [val])
102
+ elsif id.part.to_s.casecmp(part.to_s).nonzero?
103
+ @log.add("IHO_3", sect, params: [val, part])
104
+ id = nil
105
+ end
106
+ id
107
+ end
108
+
109
+ def update_unit_parse(val)
110
+ id = Pubid::Iho::Identifier.parse(val)
111
+ id.respond_to?(:spec) && id.spec && id.part ? id : nil
112
+ rescue StandardError
113
+ nil
114
+ end
115
+
65
116
  def metadata_commentperiod(node, xml)
66
117
  from = node.attr("comment-from") or return
67
118
  xml.commentperiod do |c|
@@ -38,7 +38,7 @@ module Metanorma
38
38
  stage = iho_stage(bibdata)
39
39
  lines << stage if stage
40
40
 
41
- lines << "IHO Standard" if docnumber
41
+ lines << "#{publisher_abbr(bibdata)} Standard" if docnumber
42
42
 
43
43
  owner_line = iho_copyright_line(bibdata)
44
44
  lines << owner_line if owner_line
@@ -84,6 +84,24 @@ module Metanorma
84
84
  abbr && !abbr.empty? ? "#{label} (#{abbr})" : label
85
85
  end
86
86
 
87
+ # The cover identity strapline follows the document's publisher:
88
+ # the first publisher organization's abbreviation, "IHO" when the
89
+ # document does not name one.
90
+ def publisher_abbr(bibdata)
91
+ orgs = bibdata.respond_to?(:contributor) ? Array(bibdata.contributor) : []
92
+ abbr = orgs.filter_map do |c|
93
+ role = c.respond_to?(:role) ? Array(c.role).first : nil
94
+ next unless role.respond_to?(:type) && role.type.to_s == "publisher"
95
+
96
+ org = c.respond_to?(:organization) ? Array(c.organization).first : nil
97
+ next unless org.respond_to?(:abbreviation)
98
+
99
+ a = org.abbreviation
100
+ a.is_a?(String) ? a : nil
101
+ end.first
102
+ abbr.nil? || abbr.empty? ? "IHO" : abbr
103
+ end
104
+
87
105
  def iho_copyright_line(bibdata)
88
106
  cr = bibdata.respond_to?(:copyright) ? bibdata.copyright : nil
89
107
  entry = Array(cr).first
@@ -6,6 +6,14 @@ module Metanorma
6
6
  "IHO_1": { category: "AsciiDoc Input",
7
7
  error: "Missing workgroup attribute for document",
8
8
  severity: 2 },
9
+ "IHO_2": { category: "AsciiDoc Input",
10
+ error: "update-unit value `%s` is not a valid IHO " \
11
+ "S-4 section identifier (expected e.g. B-400)",
12
+ severity: 2 },
13
+ "IHO_3": { category: "AsciiDoc Input",
14
+ error: "update-unit `%s` does not belong to Part %s " \
15
+ "of this document",
16
+ severity: 2 },
9
17
  }.freeze
10
18
  # rubocop:enable Naming/VariableNumber
11
19
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.4.5".freeze
3
+ VERSION = "1.4.7".freeze
4
4
  end
5
5
  end
@@ -27,6 +27,7 @@ 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 "pubid", "~> 2.0", ">= 2.0.30"
30
31
  spec.add_dependency "metanorma-generic", "~> 3.5.1"
31
32
 
32
33
  spec.add_development_dependency "debug"
data/metanorma.yml CHANGED
@@ -4,7 +4,10 @@ organization_name_long: International Hydrographic Organization
4
4
  document_namespace: https://www.metanorma.org/ns/iho
5
5
  xml_root_tag: 'iho-standard'
6
6
  validate_rng_file: lib/metanorma/iho/iho.rng
7
- i18nyaml: lib/isodoc/iho/i18n-en.yaml
7
+ i18nyaml:
8
+ en: lib/isodoc/iho/i18n-en.yaml
9
+ fr: lib/isodoc/iho/i18n-fr.yaml
10
+ es: lib/isodoc/iho/i18n-es.yaml
8
11
  committees:
9
12
  - code: hssc
10
13
  full_name: Hydrographic Services and Standards Committee
@@ -22,7 +25,10 @@ html_headerfont: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-
22
25
  html_monospacefont: '"Fira Code",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'
23
26
  html_normalfontsize: "15px"
24
27
  html_footnotefontsize: "0.9em"
25
- boilerplate: lib/metanorma/iho/boilerplate.adoc
28
+ boilerplate:
29
+ en: lib/metanorma/iho/boilerplate.adoc
30
+ fr: lib/metanorma/iho/boilerplate-fr.adoc
31
+ es: lib/metanorma/iho/boilerplate-es.adoc
26
32
  webfont:
27
33
  - "https://fonts.googleapis.com/css2?family=Fira+Code&display=swap"
28
34
  standardstylesheet: lib/isodoc/iho/html/iho.scss
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.7
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-15 00:00:00.000000000 Z
11
+ date: 2026-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pubid
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.30
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.30
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: metanorma-generic
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -215,6 +235,8 @@ files:
215
235
  - lib/isodoc/iho/html/wordstyle.scss
216
236
  - lib/isodoc/iho/html_convert.rb
217
237
  - lib/isodoc/iho/i18n-en.yaml
238
+ - lib/isodoc/iho/i18n-es.yaml
239
+ - lib/isodoc/iho/i18n-fr.yaml
218
240
  - lib/isodoc/iho/iho.specification.xsl
219
241
  - lib/isodoc/iho/iho.standard.xsl
220
242
  - lib/isodoc/iho/init.rb
@@ -232,6 +254,8 @@ files:
232
254
  - lib/metanorma/iho/basicdoc.rng
233
255
  - lib/metanorma/iho/biblio-standoc.rng
234
256
  - lib/metanorma/iho/biblio.rng
257
+ - lib/metanorma/iho/boilerplate-es.adoc
258
+ - lib/metanorma/iho/boilerplate-fr.adoc
235
259
  - lib/metanorma/iho/boilerplate.adoc
236
260
  - lib/metanorma/iho/citation_style.rb
237
261
  - lib/metanorma/iho/cleanup.rb