metanorma-generic 3.1.2 → 3.1.4

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: c50b039e644c1672d5e945c482602c872a21bceff11ac3f7d4d9d768639b81b1
4
- data.tar.gz: 3fbcdb088cf39e43227dc48cc23874af81829e743d7a583e3408300f06dfbad8
3
+ metadata.gz: 28240604233a01b6fe0040e0764123ac77a6ab9fb6893b1d760f5786425bc8d3
4
+ data.tar.gz: 879de0d79f7cd020c0e6cbef606bbb301779794278d43a8ae1e1dbaf4ed60b04
5
5
  SHA512:
6
- metadata.gz: 11057878ee61b576be907979f6db2d66a30dea8b19b886e1aacce53d50b254bf989369b4f50d16cd1a16643412936b21d76d2f41b74e9e1cd0dd94316913615d
7
- data.tar.gz: 5a7b58efe110889513dd6621fdd3bfc365b8eb2df02b91ca5ccad467dce4fd7ebb3a70b38e3257a2e3ed50e1a6e7fd9d1367efedc73450d5a8d0d53ec187c74b
6
+ metadata.gz: cabbd0463f13c372ad5fe3627a87ec55b62268a2f3e9aa09d1ecf2325b4035bf92a231d5d8dcbb3229535c74d2a061493304f91330f088002af2b864aaff99d3
7
+ data.tar.gz: 5fae636b2e3c53a1402c30f90141f85f34fa43d9be3d4ae3523d3327f2847d283d3066b7348bf388851612a5bced79854d9b05547317123a64809aad3eb73290
@@ -53,21 +53,15 @@ module IsoDoc
53
53
 
54
54
  def author(isoxml, _out)
55
55
  super
56
- tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
56
+ tc = isoxml.at(ns("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/name"))
57
57
  set(:tc, tc.text) if tc
58
58
  end
59
59
 
60
60
  def stage_abbr(status)
61
- return super unless configuration.stage_abbreviations
62
-
61
+ configuration.stage_abbreviations or return super
63
62
  Hash(configuration.stage_abbreviations).dig(status)
64
63
  end
65
64
 
66
- def unpublished(status)
67
- stages = configuration&.published_stages || ["published"]
68
- !(Array(stages).map { |m| m.downcase }.include? status.downcase)
69
- end
70
-
71
65
  def doctype(isoxml, _out)
72
66
  super
73
67
  b = isoxml&.at(ns("//bibdata/ext/doctype#{currlang}")) ||
@@ -77,10 +71,8 @@ module IsoDoc
77
71
 
78
72
  def xmlhash2hash(hash)
79
73
  ret = {}
80
- return ret if hash.nil? || hash[:kind] != "element"
81
-
82
- hash[:attr].nil? or
83
- hash[:attr].each { |k, v| ret["#{hash[:name]}_#{k}"] = v }
74
+ hash.nil? || hash[:kind] != "element" and return ret
75
+ hash[:attr]&.each { |k, v| ret["#{hash[:name]}_#{k}"] = v }
84
76
  ret[hash[:name]] = hash[:kids] ? xmlhash2hash_kids(hash) : hash[:text]
85
77
  ret
86
78
  end
@@ -76,12 +76,6 @@ from other documents in the same doctype</a:documentation>
76
76
  <ref name="flavor">
77
77
  <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
78
78
  </ref>
79
- <optional>
80
- <ref name="editorialgroup">
81
- <a:documentation>Groups associated with the production of the standards document, typically within
82
- a standards definition organization</a:documentation>
83
- </ref>
84
- </optional>
85
79
  <zeroOrMore>
86
80
  <ref name="ics">
87
81
  <a:documentation>Classification of the document contents taken from the International Classification of Standards</a:documentation>
@@ -130,49 +124,6 @@ a standards definition organization</a:documentation>
130
124
  However we prefer not to hardcode it, given ongoing extension.</a:documentation>
131
125
  <text/>
132
126
  </define>
133
- <define name="editorialgroup">
134
- <a:documentation>A group associated with the production of the standards document, typically within
135
- a standards definition organization</a:documentation>
136
- <element name="editorialgroup">
137
- <oneOrMore>
138
- <ref name="technical-committee">
139
- <a:documentation>A technical committee associated with the production of the standards document</a:documentation>
140
- </ref>
141
- </oneOrMore>
142
- </element>
143
- </define>
144
- <define name="technical-committee">
145
- <a:documentation>Technical committee associated with the production of a standards document</a:documentation>
146
- <element name="technical-committee">
147
- <ref name="IsoWorkgroup"/>
148
- </element>
149
- </define>
150
- <define name="IsoWorkgroup">
151
- <optional>
152
- <attribute name="number">
153
- <a:documentation>Numeric identifier of the technical committee</a:documentation>
154
- </attribute>
155
- </optional>
156
- <optional>
157
- <attribute name="type">
158
- <a:documentation>Type of the technical committee, used in identifying the technical committee</a:documentation>
159
- </attribute>
160
- </optional>
161
- <optional>
162
- <attribute name="identifier">
163
- <a:documentation>Non-numeric, complete identifier of the technical committee</a:documentation>
164
- </attribute>
165
- </optional>
166
- <optional>
167
- <attribute name="prefix">
168
- <a:documentation>Disambiguating prefix added to number to form the identifier of the technical committee,
169
- typically indicating its type</a:documentation>
170
- </attribute>
171
- </optional>
172
- <text>
173
- <a:documentation>Name of the technical committee</a:documentation>
174
- </text>
175
- </define>
176
127
  <define name="ics">
177
128
  <a:documentation>Classification taken from the International Classification of Standards.
178
129
  ICS is defined by ISO here -- https://www.iso.org/publication/PUB100033.html</a:documentation>
@@ -242,6 +242,8 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
242
242
  </choice>
243
243
  </define>
244
244
  <define name="roledescription">
245
+ <a:documentation>A more detailed description of the role of the contributor
246
+ Some descriptions are reserved words; in particular, the editorial committee of a standard has the role description "committee"</a:documentation>
245
247
  <element name="description">
246
248
  <ref name="LocalizedMarkedUpString"/>
247
249
  </element>
@@ -443,7 +445,10 @@ real names (if the person is named with a pseudonym or user name); previous lega
443
445
  </oneOrMore>
444
446
  <zeroOrMore>
445
447
  <ref name="subdivision">
446
- <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item</a:documentation>
448
+ <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item.
449
+ Multiple subdivisions can be specified for an organization, with no implication of hierarchical
450
+ relation between them
451
+ Editorial and advisory groups are represented as consecutive subdivisions of the SDO</a:documentation>
447
452
  </ref>
448
453
  </zeroOrMore>
449
454
  <optional>
@@ -485,6 +490,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
485
490
  <a:documentation>The type of subdivision</a:documentation>
486
491
  </attribute>
487
492
  </optional>
493
+ <optional>
494
+ <attribute name="subtype">
495
+ <a:documentation>The subtype of subdivision; e.g. different types of technical committee</a:documentation>
496
+ </attribute>
497
+ </optional>
488
498
  <ref name="OrganizationType">
489
499
  <a:documentation>The subdivision, modelled recursively as an organization</a:documentation>
490
500
  </ref>
@@ -121,7 +121,8 @@ module Metanorma
121
121
  def committee_validate(xmldoc)
122
122
  committees = Array(configuration&.committees) || return
123
123
  committees.empty? and return
124
- xmldoc.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
124
+ xmldoc.xpath("//bibdata/contributor[role/description = 'committee']/" \
125
+ "organization/subdivision/name").each do |c|
125
126
  committees.include? c.text or
126
127
  @log.add("Document Attributes", nil,
127
128
  "#{c.text} is not a recognised committee")
@@ -166,7 +167,8 @@ module Metanorma
166
167
  conv.meta.set(a, configuration.send(a))
167
168
  end
168
169
  #conv.meta.set(:bibdata, bibdata_hash(xmldoc))
169
- conv
170
+ @isodoc = conv
171
+ @isodoc
170
172
  end
171
173
 
172
174
  def bibdata_hash(xmldoc)
@@ -182,6 +184,11 @@ module Metanorma
182
184
  f.is_a? Hash and f[@lang] and return baselocation(f[@lang])
183
185
  super
184
186
  end
187
+
188
+ def published?(status, _xmldoc)
189
+ stages = configuration&.published_stages || ["published"]
190
+ (Array(stages).map(&:downcase).include? status.downcase)
191
+ end
185
192
  end
186
193
  end
187
194
  end
@@ -21,18 +21,8 @@ module Metanorma
21
21
  Array(configuration.relations) || []
22
22
  end
23
23
 
24
- def metadata_committee(node, xml)
25
- node.attr("committee") or return
26
- xml.editorialgroup do |a|
27
- a.committee node.attr("committee"),
28
- **attr_code(type: node.attr("committee-type"))
29
- i = 2
30
- while node.attr("committee_#{i}")
31
- a.committee node.attr("committee_#{i}"),
32
- **attr_code(type: node.attr("committee-type_#{i}"))
33
- i += 1
34
- end
35
- end
24
+ def metadata_committee_types(_node)
25
+ Array(configuration.committee_types || "committee")
36
26
  end
37
27
 
38
28
  def metadata_status(node, xml)
@@ -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.1.0 -->
3
+ <!-- VERSION v2.1.3 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -123,6 +123,10 @@ the type attribute defaults to `review` for reviews</a:documentation>
123
123
  <a:documentation>Notes whose scope is the current block</a:documentation>
124
124
  </ref>
125
125
  </zeroOrMore>
126
+ <ref name="BlockSource">
127
+ <a:documentation>Bibliographic source for the information in the list.
128
+ Sources are currently only rendered in metanorma-plateau</a:documentation>
129
+ </ref>
126
130
  </define>
127
131
  <define name="OlBody">
128
132
  <optional>
@@ -140,6 +144,10 @@ the type attribute defaults to `review` for reviews</a:documentation>
140
144
  <a:documentation>Notes whose scope is the current block</a:documentation>
141
145
  </ref>
142
146
  </zeroOrMore>
147
+ <ref name="BlockSource">
148
+ <a:documentation>Bibliographic source for the information in the list.
149
+ Sources are currently only rendered in metanorma-plateau</a:documentation>
150
+ </ref>
143
151
  </define>
144
152
  <define name="OlAttributes">
145
153
  <a:documentation>NOTE: `start` attribute is not included by default, because of problems it raises with DOC output</a:documentation>
@@ -188,6 +196,10 @@ the type attribute defaults to `review` for reviews</a:documentation>
188
196
  <a:documentation>Notes whose scope is the current block</a:documentation>
189
197
  </ref>
190
198
  </zeroOrMore>
199
+ <ref name="BlockSource">
200
+ <a:documentation>Bibliographic source for the information in the list.
201
+ Sources are currently only rendered in metanorma-plateau</a:documentation>
202
+ </ref>
191
203
  </define>
192
204
  <define name="dt">
193
205
  <element name="dt">
@@ -443,14 +455,7 @@ normative or informative references, some split references into sections organiz
443
455
  </ref>
444
456
  </zeroOrMore>
445
457
  <zeroOrMore>
446
- <ref name="doc_bibitem">
447
- <a:documentation>Bibliographic item cited in the document</a:documentation>
448
- </ref>
449
- <zeroOrMore>
450
- <ref name="note">
451
- <a:documentation>Annotation of the bibliographic item</a:documentation>
452
- </ref>
453
- </zeroOrMore>
458
+ <ref name="ReferenceEntry"/>
454
459
  </zeroOrMore>
455
460
  <zeroOrMore>
456
461
  <ref name="references">
@@ -592,18 +597,21 @@ gives an explicit page orientation</a:documentation>
592
597
  </element>
593
598
  </optional>
594
599
  </define>
595
- </include>
596
- <!-- end overrides -->
597
- <define name="FnAttributes" combine="interleave">
598
- <ref name="RequiredId"/>
599
- <optional>
600
- <attribute name="hiddenref">
601
- <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
600
+ <define name="FnAttributes">
601
+ <ref name="RequiredId"/>
602
+ <optional>
603
+ <attribute name="hiddenref">
604
+ <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
602
605
  This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
603
- <data type="boolean"/>
606
+ <data type="boolean"/>
607
+ </attribute>
608
+ </optional>
609
+ <attribute name="reference">
610
+ <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
604
611
  </attribute>
605
- </optional>
606
- </define>
612
+ </define>
613
+ </include>
614
+ <!-- end overrides -->
607
615
  <define name="TdAttributes" combine="interleave">
608
616
  <ref name="RequiredId"/>
609
617
  <optional>
@@ -841,6 +849,17 @@ titlecase, or lowercase</a:documentation>
841
849
  <value>informative</value>
842
850
  </choice>
843
851
  </define>
852
+ <define name="ReferenceEntry">
853
+ <a:documentation>Entry in bibliography</a:documentation>
854
+ <ref name="doc_bibitem">
855
+ <a:documentation>Bibliographic item cited in the document</a:documentation>
856
+ </ref>
857
+ <zeroOrMore>
858
+ <ref name="note">
859
+ <a:documentation>Annotation of the bibliographic item</a:documentation>
860
+ </ref>
861
+ </zeroOrMore>
862
+ </define>
844
863
  <define name="doc_bibitem">
845
864
  <a:documentation>Standardisation document representation of bibliographic entry</a:documentation>
846
865
  <element name="bibitem">
@@ -871,6 +890,12 @@ titlecase, or lowercase</a:documentation>
871
890
  </oneOrMore>
872
891
  </element>
873
892
  </define>
893
+ <define name="ParagraphFnBody" combine="interleave">
894
+ <ref name="BlockSource">
895
+ <a:documentation>Bibliographic source for the information in the paragraph
896
+ parargaph sources are currently only rendered in metanorma-plateau</a:documentation>
897
+ </ref>
898
+ </define>
874
899
  <define name="BasicBlock" combine="choice">
875
900
  <ref name="columnbreak"/>
876
901
  </define>
@@ -2233,6 +2258,11 @@ used in document amendments</a:documentation>
2233
2258
  <ref name="RequiredId"/>
2234
2259
  <ref name="NumberingAttributes"/>
2235
2260
  <ref name="BlockAttributes"/>
2261
+ <optional>
2262
+ <attribute name="type">
2263
+ <a:documentation>Semantic classification of note</a:documentation>
2264
+ </attribute>
2265
+ </optional>
2236
2266
  <oneOrMore>
2237
2267
  <choice>
2238
2268
  <a:documentation>Content of the term note</a:documentation>
@@ -51,7 +51,11 @@ module Metanorma
51
51
  when :presentation
52
52
  IsoDoc::Generic::PresentationXMLConvert.new(options)
53
53
  .convert(inname, isodoc_node, nil, outname)
54
- else super end
54
+ when :pdf
55
+ IsoDoc::Generic::PdfConvert.new(options)
56
+ .convert(inname, isodoc_node, nil, outname)
57
+ else super
58
+ end
55
59
  end
56
60
  end
57
61
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "3.1.2".freeze
3
+ VERSION = "3.1.4".freeze
4
4
  end
5
5
  end
@@ -21,6 +21,7 @@ module Metanorma
21
21
  bibliography_titles
22
22
  boilerplate
23
23
  committees
24
+ committee_types
24
25
  document_namespace
25
26
  docid_template
26
27
  doctypes
@@ -42,6 +42,9 @@ metadata_extensions:
42
42
  - security
43
43
  published_stages:
44
44
  - published
45
+ committee_types:
46
+ - Committee
47
+ - Workgroup
45
48
  committees:
46
49
  - TC 1
47
50
  relations:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-04 00:00:00.000000000 Z
11
+ date: 2025-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc