metanorma-generic 3.5.0 → 3.5.1.pre.alpha.1

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: e662cc5234929d4f4c58d97a6f126e9ca754fd7e42927c9a304ffa6b0aa54014
4
- data.tar.gz: 4e9ee665b31028cdaf17bd0aeb0b0055862dca7e4067571d85d101fd3f6d9135
3
+ metadata.gz: fe8a07846a2115c9a96007c6eb8ca34f195310aeecc9ddcc69e24874569a7f33
4
+ data.tar.gz: 31dbdfc104e68db5bef5e91177ce910b3f32124a4dc6dc87ab98d6a80863922d
5
5
  SHA512:
6
- metadata.gz: 77285ec273ba755507e6fe898cb109944642077733bc255ab2012ebd94a5b8ac752eff89d08c346e48b565af28d6006663f2fdaaf704a1a50bf6c4289dc8ef55
7
- data.tar.gz: 0ac4ddcc9138d4bd72100238cb087ac6aca9b0363e822a1e63bad5098ebf4e61a3a5cfdc3c7c9feb907b2c67f0da3cca4acd64cfcef2f86822b4212039b3d14f
6
+ metadata.gz: f2ed5a33f21b696fc20d1ff380d474583fac15547af80c5b46590f8007357a50905720ea5766a7f3e6a07195b71699caa869880ca43a275ecc265c61d44b5c05
7
+ data.tar.gz: cfd3824d7aa22372e05c39fb97aedca32f1b8419b399c9c8df2be8019076755146f3551cdc7e866ef6853dd17ba5810b0226d4f565576811c7fc16cdbc07a6f0
data/Gemfile CHANGED
@@ -7,3 +7,22 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
7
7
  gemspec
8
8
 
9
9
  eval_gemfile("Gemfile.devel") rescue nil
10
+
11
+ # standoc main: the Document model tree (released 3.5.0 predates it)
12
+ gem "metanorma-standoc", github: "metanorma/metanorma-standoc", branch: "main"
13
+ # the released plugin line dropped the preprocessor names standoc main registers
14
+ gem "metanorma-plugin-lutaml", github: "metanorma/metanorma-plugin-lutaml", branch: "main"
15
+
16
+ # metanorma-document main: SvgmapElement and the base component tree
17
+ gem "metanorma-document", github: "metanorma/metanorma-document", branch: "main"
18
+
19
+ # canonical line: relaton 3 prerelease monogem + git-main render/core
20
+ # (released isodoc 3.7.3 lacks the moxml-aware BibdataConfig wrapper;
21
+ # released relaton alpha.5 crashes the bibdata Liquid drop round-trip)
22
+ gem "relaton", "= 3.0.0.pre.alpha.14"
23
+ gem "relaton-render", "= 3.0.0.pre.alpha.43"
24
+ gem "relaton-bib", "2.2.0.pre.alpha.1"
25
+ gem "pubid", github: "pubid/pubid", branch: "main"
26
+ gem "isodoc", github: "metanorma/isodoc", branch: "main"
27
+ gem "isodoc-i18n", github: "metanorma/isodoc-i18n", branch: "main"
28
+ gem "canon", "0.3.87"
@@ -51,8 +51,12 @@ module IsoDoc
51
51
 
52
52
  def author(isoxml, _out)
53
53
  super
54
- tc = isoxml.at(ns("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/name"))
55
- set(:tc, tc.text) if tc
54
+ tc = isoxml.at(ns("//bibdata/contributor[role/description = 'committee']/" \
55
+ "organization/subdivision[@type = 'Committee']/name"))
56
+ tc or return
57
+ committee = configuration.committee(tc.text)
58
+ set(:tc, committee ? committee.display_name : tc.text)
59
+ committee and set(:tc_committee, committee)
56
60
  end
57
61
 
58
62
  def stage_abbr(status)
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ module Metanorma
6
+ module Generic
7
+ class Committee < Lutaml::Model::Serializable
8
+ attribute :code, :string
9
+ attribute :full_name, :string
10
+
11
+ def display_name
12
+ full_name || code
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metanorma
4
+ module Generic::Document
5
+ class Root < Lutaml::Model::Serializable
6
+ include Metanorma::Standoc::Document::RootAttributes
7
+
8
+ attribute :bibdata,
9
+ Metanorma::Standoc::Document::Metadata::StandardBibData
10
+ attribute :preface,
11
+ Metanorma::Standoc::Document::Sections::Preface
12
+ attribute :sections,
13
+ Metanorma::Standoc::Document::Sections::Sections,
14
+ collection: true
15
+ attribute :annex,
16
+ Metanorma::Standoc::Document::Sections::AnnexSection,
17
+ collection: true
18
+ attribute :misccontainer,
19
+ Metanorma::Standoc::Document::Sections::MiscContainer
20
+
21
+ xml do
22
+ element "metanorma"
23
+ namespace Metanorma::Standoc::Document::Namespace
24
+
25
+ Metanorma::Standoc::Document::RootXmlMapping.apply(self)
26
+
27
+ map_element "misc-container", to: :misccontainer
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "metanorma/document"
4
+ require "metanorma/standoc/document"
5
+ module Metanorma
6
+ module Generic
7
+ end
8
+ end
9
+
10
+ module Metanorma
11
+ module Generic::Document
12
+ autoload :Root, "metanorma/generic/document/root"
13
+ end
14
+ end
15
+
16
+ module Metanorma
17
+ existing = defined?(Metanorma::GenericDocument) && Metanorma::GenericDocument
18
+ if !existing.equal?(Metanorma::Generic::Document)
19
+ Metanorma.send(:remove_const, :GenericDocument) if existing
20
+ GenericDocument = Metanorma::Generic::Document
21
+ end
22
+ end
23
+
24
+ # OCP adoption: ONE registration in the metanorma-core flavor table
25
+ require "metanorma-core"
26
+
27
+ Metanorma::Core::Flavors.register(Metanorma::Core::Flavor.new(
28
+ name: :generic,
29
+ gem: "metanorma-generic",
30
+ model_root: Metanorma::Generic::Document::Root,
31
+ pubid_module: nil,
32
+ renderers: { html: lambda do |_document, **_options|
33
+ Metanorma::Html::StandardRenderer
34
+ end },
35
+ ))
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar ns='https://www.metanorma.org/ns/standoc' xmlns="http://relaxng.org/ns/structure/1.0">
3
3
  <include href="biblio-standoc.rng"/>
4
- <include href="isodoc.rng">
4
+ <include href="standoc.rng">
5
5
  <define name="standard-document">
6
6
  <element name="metanorma">
7
7
  <ref name="Root-Attributes"/>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.2.0 -->
3
+ <!-- VERSION v2.3.0 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -328,7 +328,7 @@ Sources are currently only rendered in metanorma-plateau</a:documentation>
328
328
  </optional>
329
329
  </define>
330
330
  <define name="ExampleBodyContent">
331
- <a:documentation>Content alternatives of an example in the isodoc context: as basicdoc,
331
+ <a:documentation>Content alternatives of an example in the standoc context: as basicdoc,
332
332
  with figure admitted, and note admitted only trailing the example body
333
333
  rather than interleaved. The content hook is overridden rather than
334
334
  ExampleBody itself, so that the extension seam survives: additive
@@ -38,16 +38,16 @@ module Metanorma
38
38
  @docstage_valid and return @docstage_valid
39
39
  keys = configuration.stage_abbreviations&.keys or return
40
40
  (keys.map(&:to_s) +
41
- Array(configuration.published_stages).map(&:to_s) +
41
+ Array(configuration.published_stages || ["published"])
42
+ .map(&:to_s) +
42
43
  [configuration.default_stage]).compact.uniq
43
44
  end
44
45
 
45
46
  def committee_validate(xmldoc)
46
- committees = Array(configuration&.committees) || return
47
- committees.empty? and return
47
+ Array(configuration&.committees).empty? and return
48
48
  xmldoc.xpath("//bibdata/contributor[role/description = 'committee']/" \
49
49
  "organization/subdivision/name").each do |c|
50
- committees.include? c.text or
50
+ configuration.committee(c.text) or
51
51
  @log.add("GENERIC_3", nil, params: [c.text])
52
52
  end
53
53
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "3.5.0".freeze
3
+ VERSION = "3.5.1.pre.alpha.1".freeze
4
4
  end
5
5
  end
@@ -1,3 +1,4 @@
1
+ require "metanorma/generic/committee"
1
2
  require "metanorma/generic/processor"
2
3
  require "metanorma/generic/version"
3
4
  require "forwardable"
@@ -79,6 +80,28 @@ module Metanorma
79
80
 
80
81
  attr_accessor(*CONFIG_ATTRS)
81
82
 
83
+ # Assigning normalizes plain hashes (e.g. from metanorma.yml) into
84
+ # Committee models; Committee instances pass through unchanged.
85
+ def committees=(committees)
86
+ @committees = Array(committees).map do |committee|
87
+ case committee
88
+ when Committee then committee
89
+ when ::Hash then Committee.from_hash(committee)
90
+ # flavor metanorma.yml files carry committees as plain strings
91
+ # (e.g. bipm's); from_hash rejects non-hashes under
92
+ # lutaml-model 0.8.102's type checking.
93
+ else Committee.new(code: committee.to_s, full_name: committee.to_s)
94
+ end
95
+ end
96
+ end
97
+
98
+ def committee(code)
99
+ code or return nil
100
+ Array(committees).find do |committee|
101
+ committee.code == code.to_s.downcase
102
+ end
103
+ end
104
+
82
105
  class << self
83
106
  attr_accessor :_file
84
107
  end
@@ -100,6 +123,11 @@ module Metanorma
100
123
  default_org
101
124
  default_formats
102
125
  default_titles
126
+ parse_committees
127
+ end
128
+
129
+ def parse_committees
130
+ @committees and self.committees = @committees
103
131
  end
104
132
 
105
133
  def default_org
@@ -209,5 +237,6 @@ module Metanorma
209
237
  end
210
238
 
211
239
  configure {}
240
+ autoload :Document, "metanorma/generic/document"
212
241
  end
213
242
  end
@@ -27,7 +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 "metanorma-standoc", "~> 3.5.0"
30
+ spec.add_dependency "metanorma-standoc", ">= 3.5"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -46,7 +46,8 @@ committee_types:
46
46
  - Committee
47
47
  - Workgroup
48
48
  committees:
49
- - TC 1
49
+ - code: tc1
50
+ full_name: Technical Committee 1
50
51
  relations:
51
52
  - part-of
52
53
  - translated-from
metadata CHANGED
@@ -1,28 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1.pre.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-10-22 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: metanorma-standoc
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
- - - "~>"
17
+ - - ">="
17
18
  - !ruby/object:Gem::Version
18
- version: 3.5.0
19
+ version: '3.5'
19
20
  type: :runtime
20
21
  prerelease: false
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
- - - "~>"
24
+ - - ">="
24
25
  - !ruby/object:Gem::Version
25
- version: 3.5.0
26
+ version: '3.5'
26
27
  - !ruby/object:Gem::Dependency
27
28
  name: debug
28
29
  requirement: !ruby/object:Gem::Requirement
@@ -249,11 +250,13 @@ files:
249
250
  - lib/metanorma/generic/biblio-standoc.rng
250
251
  - lib/metanorma/generic/biblio.rng
251
252
  - lib/metanorma/generic/cleanup.rb
253
+ - lib/metanorma/generic/committee.rb
252
254
  - lib/metanorma/generic/converter.rb
255
+ - lib/metanorma/generic/document.rb
256
+ - lib/metanorma/generic/document/root.rb
253
257
  - lib/metanorma/generic/fonts_manifest.yaml
254
258
  - lib/metanorma/generic/front.rb
255
259
  - lib/metanorma/generic/generic.rng
256
- - lib/metanorma/generic/isodoc.rng
257
260
  - lib/metanorma/generic/log.rb
258
261
  - lib/metanorma/generic/mathml4-content.rng
259
262
  - lib/metanorma/generic/mathml4-core.rng
@@ -264,6 +267,7 @@ files:
264
267
  - lib/metanorma/generic/processor.rb
265
268
  - lib/metanorma/generic/reqt.rng
266
269
  - lib/metanorma/generic/rsd.rng
270
+ - lib/metanorma/generic/standoc.rng
267
271
  - lib/metanorma/generic/validate.rb
268
272
  - lib/metanorma/generic/version.rb
269
273
  - metanorma-generic.gemspec
@@ -272,6 +276,7 @@ homepage: https://github.com/metanorma/metanorma-generic
272
276
  licenses:
273
277
  - BSD-2-Clause
274
278
  metadata: {}
279
+ post_install_message:
275
280
  rdoc_options: []
276
281
  require_paths:
277
282
  - lib
@@ -286,7 +291,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
291
  - !ruby/object:Gem::Version
287
292
  version: '0'
288
293
  requirements: []
289
- rubygems_version: 4.0.16
294
+ rubygems_version: 3.5.22
295
+ signing_key:
290
296
  specification_version: 4
291
297
  summary: Metanorma template gem for customisation.
292
298
  test_files: []