metanorma-iso 3.4.0 → 3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af8cccd4eb2c8c09f5e8e1714b3154106d37cbc60b470143dc1569885ddc5268
4
- data.tar.gz: b9d3770934d56c2d25891663214631ab6fd72264ed9b17e1bb7729cf4302b89d
3
+ metadata.gz: 9929b1cb4a3a27bc2d67e5cc35208ce6c0cde2edfcf610819b52431664a6d6e1
4
+ data.tar.gz: 1387bd4a7a70668aa172c398ef68e1ec7382742ae81d929e92925974be424526
5
5
  SHA512:
6
- metadata.gz: de6922a6e5923045702366f758294685bf1ebde75aab4a7abf78f9e7ab48c72478e8e733d21611ce84dd45ed9aaac61b6857b2c158dda910f650e237c3cfbf7c
7
- data.tar.gz: 6a218b206ab889b35501881571a695d7d2fd3e623e76f356aaf98717aa46298986ca1aacdcb108f6675945db181abff80cab3e79a5e007c28837cd74b6a0a9cb
6
+ metadata.gz: 39a5747db6618a81b7e0785edbf83c3e9bec40fdf11c7b51bf40eeb8f21e60a12acd50f6f1189eea94dd291b848174b83e354adeddc28d35b7c4bccbeb792f46
7
+ data.tar.gz: fc1a91e0703ecda60bf4e92b6528e5f6c1205675ad5b1b7daa20264154c4e0844c4ef53a141279b98e1bcad39e49eff22d481fffb6ff639889ce88989faea35e
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  # Auto-generated by Cimas: Do not edit it manually!
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
4
- - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
5
5
 
6
6
  # local repo-specific modifications
7
7
  # ...
@@ -99,20 +99,8 @@ module IsoDoc
99
99
  end
100
100
  end
101
101
 
102
- def table_parse(node, out)
103
- @in_table = true
104
- out.table(**table_attrs(node)) do |t|
105
- table_title_parse(node, t)
106
- table_parse_core(node, t)
107
- table_parse_tail(node, t)
108
- end
109
- @in_table = false
110
- end
111
-
112
102
  def table_title_parse(node, out)
113
- name = node.at(ns("./fmt-name"))
114
- summ = node["summary"]
115
- meas = node.at(ns("./note[@type = 'units']"))
103
+ name, summ, meas = table_title_parse_prep(node)
116
104
  name || summ || meas or return
117
105
  out.caption do |p|
118
106
  children_parse(name, p)
@@ -123,14 +111,16 @@ module IsoDoc
123
111
  end
124
112
  end
125
113
 
126
- def table_parse_tail(node, out)
127
- (key = node.at(ns("./key"))) && parse(key, out)
128
- node.xpath(ns("./fmt-source")).each { |n| parse(n, out) }
129
- node.xpath(ns("./note[not(@type = 'units')]")).each do |n|
130
- parse(n, out)
131
- end
132
- node.xpath(ns("./fmt-footnote-container/fmt-fn-body"))
133
- .each { |n| parse(n, out) }
114
+ def table_title_parse_prep(node)
115
+ name = node.at(ns("./fmt-name"))
116
+ summ = node["summary"]
117
+ meas = node.at(ns("./note[@type = 'units']"))
118
+ [name, summ, meas]
119
+ end
120
+
121
+ def table_parse_tail_elems
122
+ ["./key", "./fmt-source", "./note[not(@type = 'units')]",
123
+ "./fmt-footnote-container/fmt-fn-body"]
134
124
  end
135
125
 
136
126
  def figure_parse1(node, out)
@@ -2097,7 +2097,7 @@
2097
2097
  <fo:table-row>
2098
2098
  <fo:table-cell number-columns-spanned="2" border-right="{$COVER_PAGE_BORDER}" padding-right="4mm">
2099
2099
 
2100
- <fo:block-container font-family="Cambria" line-height="1.1" role="SKIP" height="110mm">
2100
+ <fo:block-container font-family="Cambria" line-height="1.1" role="SKIP" height="110mm" id="{concat('__internal_layout__coverpage_p_title_', $num , '_', generate-id())}">
2101
2101
  <!-- for role see coment https://github.com/pdf-association/extension-brotli/issues/5#issuecomment-3931742869 -->
2102
2102
  <fo:block margin-right="3.5mm" role="P/Title"> <!-- role="SKIP" -->
2103
2103
  <fo:block font-size="18pt" font-weight="bold" margin-top="2.5mm" role="SKIP"> <!-- role="H1" -->
@@ -2097,7 +2097,7 @@
2097
2097
  <fo:table-row>
2098
2098
  <fo:table-cell number-columns-spanned="2" border-right="{$COVER_PAGE_BORDER}" padding-right="4mm">
2099
2099
 
2100
- <fo:block-container font-family="Cambria" line-height="1.1" role="SKIP" height="110mm">
2100
+ <fo:block-container font-family="Cambria" line-height="1.1" role="SKIP" height="110mm" id="{concat('__internal_layout__coverpage_p_title_', $num , '_', generate-id())}">
2101
2101
  <!-- for role see coment https://github.com/pdf-association/extension-brotli/issues/5#issuecomment-3931742869 -->
2102
2102
  <fo:block margin-right="3.5mm" role="P/Title"> <!-- role="SKIP" -->
2103
2103
  <fo:block font-size="18pt" font-weight="bold" margin-top="2.5mm" role="SKIP"> <!-- role="H1" -->
@@ -5,7 +5,7 @@ module IsoDoc
5
5
  class Metadata < IsoDoc::Metadata
6
6
  def initialize(lang, script, locale, i18n)
7
7
  super
8
- DATETYPES.each { |w| @metadata["#{w.gsub(/-/, '_')}date".to_sym] = nil }
8
+ DATETYPES.each { |w| @metadata[:"#{w.gsub('-', '_')}date"] = nil }
9
9
  set(:obsoletes, nil)
10
10
  set(:obsoletes_part, nil)
11
11
  end
@@ -24,11 +24,12 @@ module IsoDoc
24
24
  def docstatus(isoxml, _out)
25
25
  docstatus = isoxml.at(ns("//bibdata/status/stage"))
26
26
  published = published_default(isoxml)
27
- revdate = isoxml.at(ns("//bibdata/version/revision-date"))
27
+ revdate = isoxml.at(ns("//bibdata/date[@type='updated']"))
28
28
  set(:revdate, revdate&.text)
29
29
  docstatus and docstatus1(isoxml, docstatus, published)
30
30
  docscheme = get[:"presentation_metadata_document-scheme"]
31
- docscheme && !docscheme.empty? and set(:document_scheme, docscheme.first)
31
+ docscheme && !docscheme.empty? and set(:document_scheme,
32
+ docscheme.first)
32
33
  end
33
34
 
34
35
  def docstatus1(isoxml, docstatus, published)
@@ -39,7 +40,7 @@ module IsoDoc
39
40
  status_abbrev(docstatus["abbreviation"] || "??",
40
41
  isoxml.at(ns("//bibdata/status/substage"))&.text,
41
42
  isoxml.at(ns("//bibdata/status/iteration"))&.text,
42
- isoxml.at(ns("//bibdata/version/draft"))&.text,
43
+ isoxml.at(ns("//bibdata/version"))&.text,
43
44
  isoxml.at(ns("//bibdata/ext/doctype"))&.text))
44
45
  !published and set(:stageabbr, docstatus["abbreviation"])
45
46
  end
@@ -67,8 +68,8 @@ module IsoDoc
67
68
  end
68
69
 
69
70
  def title_part_prefix(xml, part, lang)
70
- t = xml.at(ns("//bibdata/title[@language='#{lang}']"\
71
- "[@type='title-#{part}-prefix']")) or return
71
+ t = xml.at(ns("//bibdata/title[@language='#{lang}']" \
72
+ "[@type='title-#{part}-prefix']")) or return
72
73
  to_xml(t.children)
73
74
  end
74
75
 
@@ -97,7 +98,7 @@ module IsoDoc
97
98
  def title_parts(isoxml, lang)
98
99
  %w(intro main complementary part amd add).each_with_object({}) do |w, m|
99
100
  m[w.to_sym] = isoxml.at(ns("//bibdata/title[@type='title-#{w}' and " \
100
- "@language='#{lang}']"))
101
+ "@language='#{lang}']"))
101
102
  end
102
103
  end
103
104
 
@@ -164,7 +165,7 @@ module IsoDoc
164
165
  end
165
166
 
166
167
  COMMITTEE = "//bibdata/contributor[role/@type = 'author'] " \
167
- "[role/description = 'committee']/organization".freeze
168
+ "[role/description = 'committee']/organization".freeze
168
169
 
169
170
  def tc_base(xml, _grouptype)
170
171
  s = xml.at(ns("#{COMMITTEE}/subdivision[@type = 'Technical committee']"))
@@ -208,8 +209,8 @@ module IsoDoc
208
209
 
209
210
  def secretariat(xml)
210
211
  sec = xml.at(ns("//bibdata/contributor[role/@type = 'author']" \
211
- "[role/description = 'secretariat']/organization/subdivision" \
212
- "[@type = 'Secretariat']/name"))
212
+ "[role/description = 'secretariat']/organization/subdivision" \
213
+ "[@type = 'Secretariat']/name"))
213
214
  set(:secretariat, sec.text) if sec
214
215
  end
215
216
 
@@ -20,8 +20,7 @@ module IsoDoc
20
20
  docxml.at(ns("//bibdata//contributor/role[description = 'committee']")) or
21
21
  ret += "<p>Editorial groups are missing.</p>"
22
22
  docxml.at(ns("//bibdata/date[@type = 'published' or @type = 'issued' " \
23
- "or @type = 'created']")) ||
24
- docxml.at(ns("//bibdata/version/revision-date")) or
23
+ "or @type = 'created' or @type = 'updated']")) or
25
24
  ret += "<p>Document date is missing.</p>"
26
25
  ret
27
26
  end
@@ -234,15 +234,6 @@ module IsoDoc
234
234
  @in_table = false
235
235
  end
236
236
 
237
- def table_parse_tail(node, out)
238
- (key = node.at(ns("./key"))) && parse(key, out)
239
- node.xpath(ns("./fmt-source")).each { |n| parse(n, out) }
240
- node.xpath(ns("./note[not(@type = 'units')]"))
241
- .each { |n| parse(n, out) }
242
- node.xpath(ns("./fmt-footnote-container/fmt-fn-body"))
243
- .each { |n| parse(n, out) }
244
- end
245
-
246
237
  def admonition_class(node)
247
238
  if node["type"] == "editorial" then "zzHelp"
248
239
  else super
@@ -30,26 +30,40 @@ module Metanorma
30
30
  end
31
31
 
32
32
  PUBLISHER = "./contributor[role/@type = 'publisher']/organization".freeze
33
+ ISO_NAME = "International Organization for Standardization".freeze
34
+ IEC_NAME = "International Electrotechnical Commission".freeze
33
35
 
34
36
  def pub_class(bib)
35
- return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
36
- return 1 if bib.at("#{PUBLISHER}[name = 'International Organization " \
37
- "for Standardization']")
38
- return 2 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
39
- return 2 if bib.at("#{PUBLISHER}[name = 'International " \
40
- "Electrotechnical Commission']")
41
- return 3 if bib.at("./docidentifier[@type]" \
42
- "[not(#{@conv.skip_docid} or @type = 'metanorma')]") ||
43
- bib.at("./docidentifier[not(@type)]")
44
-
37
+ bib.at("#{PUBLISHER}[abbreviation = 'ISO']") ||
38
+ bib.at("#{PUBLISHER}[name = '#{ISO_NAME}']") and return 1
39
+ bib.at("#{PUBLISHER}[abbreviation = 'IEC']") ||
40
+ bib.at("#{PUBLISHER}[name = '#{IEC_NAME}']") and return 2
41
+ bib.at("./docidentifier[@type]" \
42
+ "[not(#{@conv.skip_docid} or @type = 'metanorma')]") ||
43
+ bib.at("./docidentifier[not(@type)]") and return 3
45
44
  4
46
45
  end
47
46
 
47
+ def second_pub_class(bib, first_pub)
48
+ case first_pub
49
+ when 1
50
+ n = bib.at("#{PUBLISHER}[not(abbreviation = 'ISO')]" \
51
+ "[not(name = '#{ISO_NAME}')]")
52
+ n&.at("./abbreviation") || n&.at("./name") || ""
53
+ when 2
54
+ n = bib.at("#{PUBLISHER}[not(abbreviation = 'IEC')]" \
55
+ "[not(name = '#{IEC_NAME}')]")
56
+ n&.at("./abbreviation") || n&.at("./name") || ""
57
+ else ""
58
+ end
59
+ end
60
+
48
61
  def sort_biblio(bib)
49
62
  bib.sort { |a, b| sort_biblio_key(a) <=> sort_biblio_key(b) }
50
63
  end
51
64
 
52
65
  # sort by: doc class (ISO, IEC, other standard (not DOI &c), other
66
+ # then second publisher
53
67
  # then standard class (docid class other than DOI &c)
54
68
  # then docnumber if present, numeric sort
55
69
  # else alphanumeric metanorma id (abbreviation)
@@ -58,6 +72,7 @@ module Metanorma
58
72
  # then title
59
73
  def sort_biblio_key(bib)
60
74
  pubclass = pub_class(bib)
75
+ second_pubclass = second_pub_class(bib, pubclass)
61
76
  num = bib.at("./docnumber")&.text
62
77
  id = bib.at("./docidentifier[@primary = 'true']") ||
63
78
  bib.at("./docidentifier[not(#{@conv.skip_docid} or @type = 'metanorma')]")
@@ -67,7 +82,7 @@ module Metanorma
67
82
  type = id["type"] if id
68
83
  title = bib.at("./title[@type = 'main']")&.text ||
69
84
  bib.at("./title")&.text || bib&.at("./formattedref")&.text
70
- "#{pubclass} :: #{type} :: " \
85
+ "#{pubclass} :: #{second_pubclass} :: #{type} :: " \
71
86
  "#{num.nil? ? abbrid : sprintf('%09d', num.to_i)} :: " \
72
87
  "#{sprintf('%09d', partid.to_i)} :: #{id&.text} :: #{title}"
73
88
  end
@@ -100,6 +100,7 @@ module Metanorma
100
100
 
101
101
  def title(node, xml)
102
102
  %w(en ru fr).each do |lang|
103
+ node.attr("title-main-#{lang}") or next
103
104
  title1(node, xml, lang)
104
105
  end
105
106
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iso
3
- VERSION = "3.4.0".freeze
3
+ VERSION = "3.4.2".freeze
4
4
  end
5
5
  end
@@ -7,8 +7,10 @@ module Metanorma
7
7
  def create(type)
8
8
  case type
9
9
  when :modspec, :ogc
10
- ::Metanorma::Requirements::Modspec::Iso.new(parent: self)
11
- else ::Metanorma::Requirements::Default.new(parent: self)
10
+ ::Metanorma::Requirements::Modspec::Iso.new(parent: self,
11
+ isodoc: @isodoc)
12
+ else ::Metanorma::Requirements::Default.new(parent: self,
13
+ isodoc: @isodoc)
12
14
  end
13
15
  end
14
16
  end
data/lib/metanorma-iso.rb CHANGED
@@ -12,7 +12,7 @@ require_relative "isodoc/iso/isosts_convert"
12
12
  require_relative "isodoc/iso/presentation_xml_convert"
13
13
  require_relative "html2doc/lists"
14
14
  require "asciidoctor/extensions"
15
- require "metanorma"
15
+ require "metanorma-core"
16
16
 
17
17
  if defined? Metanorma::Registry
18
18
  require_relative "metanorma/iso"
@@ -32,16 +32,13 @@ Gem::Specification.new do |spec|
32
32
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
33
33
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
34
34
 
35
- spec.add_dependency "metanorma-standoc", "~> 3.4.0"
35
+ spec.add_dependency "metanorma-standoc", "~> 3.4.2"
36
36
  spec.add_dependency "mnconvert", "~> 1.14"
37
37
  spec.add_dependency "pubid"
38
- #spec.add_dependency "pubid-cen"
39
- #spec.add_dependency "pubid-iec"
40
- #spec.add_dependency "pubid-iso", "~> 0.7.0"
41
38
  spec.add_dependency "tokenizer", "~> 0.3.0"
42
39
 
43
40
  spec.add_development_dependency "benchmark"
44
- spec.add_development_dependency "canon", "= 0.1.3"
41
+ spec.add_development_dependency "canon" #, "= 0.2.3"
45
42
  spec.add_development_dependency "debug"
46
43
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
47
44
  spec.add_development_dependency "guard", "~> 2.14"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-13 00:00:00.000000000 Z
11
+ date: 2026-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.4.0
19
+ version: 3.4.2
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.4.0
26
+ version: 3.4.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mnconvert
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: canon
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.3
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.3
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: debug
99
99
  requirement: !ruby/object:Gem::Requirement