metanorma-un 0.10.6 → 0.10.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,7 @@ module IsoDoc
49
49
  def footnotes(_div)
50
50
  if @meta.get[:item_footnote]
51
51
  fn = noko do |xml|
52
- xml.aside **{ id: "ftnitem" } do |d|
52
+ xml.aside id: "ftnitem" do |d|
53
53
  d.p @meta.get[:item_footnote]
54
54
  end
55
55
  end.join("\n")
@@ -74,15 +74,10 @@ module IsoDoc
74
74
  end
75
75
 
76
76
  def make_body2(body, docxml)
77
- body.div **{ class: "WordSection2" } do |div2|
77
+ body.div class: "WordSection2" do |div2|
78
78
  info docxml, div2
79
79
  boilerplate docxml, div2
80
- preface_block docxml, div2
81
- abstract docxml, div2
82
- foreword docxml, div2
83
- introduction docxml, div2
84
- preface docxml, div2
85
- acknowledgements docxml, div2
80
+ front docxml, div2
86
81
  div2.p { |p| p << "&#xa0;" } # placeholder
87
82
  end
88
83
  section_break(body)
@@ -109,27 +104,25 @@ module IsoDoc
109
104
  end_line(isoxml, out)
110
105
  end
111
106
 
112
- def introduction(isoxml, out)
113
- f = isoxml.at(ns("//introduction")) || return
114
- out.div **{ class: "Section3", id: f["id"] } do |div|
107
+ def introduction(clause, out)
108
+ out.div class: "Section3", id: clause["id"] do |div|
115
109
  page_break(out)
116
- div.p(**{ class: "IntroTitle" }) do |h1|
117
- f&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
110
+ div.p(class: "IntroTitle") do |h1|
111
+ clause&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
118
112
  end
119
- f.elements.each do |e|
113
+ clause.elements.each do |e|
120
114
  parse(e, div) unless e.name == "title"
121
115
  end
122
116
  end
123
117
  end
124
118
 
125
- def foreword(isoxml, out)
126
- f = isoxml.at(ns("//foreword")) || return
127
- out.div **attr_code(id: f["id"]) do |s|
119
+ def foreword(clause, out)
120
+ out.div **attr_code(id: clause["id"]) do |s|
128
121
  page_break(out)
129
- s.p(**{ class: "ForewordTitle" }) do |h1|
130
- f&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
122
+ s.p(class: "ForewordTitle") do |h1|
123
+ clause&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
131
124
  end
132
- f.elements.each { |e| parse(e, s) unless e.name == "title" }
125
+ clause.elements.each { |e| parse(e, s) unless e.name == "title" }
133
126
  end
134
127
  end
135
128
 
@@ -160,14 +153,13 @@ module IsoDoc
160
153
  abstractbox.parent.remove if abstractbox && !abstract
161
154
  end
162
155
 
163
- def abstract(isoxml, out)
164
- f = isoxml.at(ns("//abstract")) || return
165
- out.div **attr_code(id: f["id"]) do |s|
156
+ def abstract(clause, out)
157
+ out.div **attr_code(id: clause["id"]) do |s|
166
158
  page_break(out)
167
- s.p(**{ class: "AbstractTitle" }) do |h1|
168
- f&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
159
+ s.p(class: "AbstractTitle") do |h1|
160
+ clause&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
169
161
  end
170
- f.elements.each { |e| parse(e, s) unless e.name == "title" }
162
+ clause.elements.each { |e| parse(e, s) unless e.name == "title" }
171
163
  end
172
164
  end
173
165
 
@@ -17,6 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
+ <!-- VERSION v1.2.1 -->
20
21
  <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">
21
22
  <include href="reqt.rng"/>
22
23
  <include href="basicdoc.rng">
@@ -382,6 +383,9 @@
382
383
  <optional>
383
384
  <ref name="dl"/>
384
385
  </optional>
386
+ <optional>
387
+ <ref name="source"/>
388
+ </optional>
385
389
  </element>
386
390
  </define>
387
391
  <define name="figure">
@@ -404,9 +408,6 @@
404
408
  <attribute name="class"/>
405
409
  </optional>
406
410
  <ref name="BlockAttributes"/>
407
- <optional>
408
- <ref name="source"/>
409
- </optional>
410
411
  <optional>
411
412
  <ref name="tname"/>
412
413
  </optional>
@@ -431,6 +432,20 @@
431
432
  <zeroOrMore>
432
433
  <ref name="note"/>
433
434
  </zeroOrMore>
435
+ <optional>
436
+ <ref name="source"/>
437
+ </optional>
438
+ </element>
439
+ </define>
440
+ <define name="source">
441
+ <element name="source">
442
+ <attribute name="status">
443
+ <ref name="SourceStatusType"/>
444
+ </attribute>
445
+ <ref name="origin"/>
446
+ <optional>
447
+ <ref name="modification"/>
448
+ </optional>
434
449
  </element>
435
450
  </define>
436
451
  <define name="sourcecode">
@@ -1335,15 +1350,19 @@
1335
1350
  </choice>
1336
1351
  </element>
1337
1352
  </define>
1353
+ <define name="Root-Attributes">
1354
+ <attribute name="version"/>
1355
+ <attribute name="schema-version"/>
1356
+ <attribute name="type">
1357
+ <choice>
1358
+ <value>semantic</value>
1359
+ <value>presentation</value>
1360
+ </choice>
1361
+ </attribute>
1362
+ </define>
1338
1363
  <define name="standard-document">
1339
1364
  <element name="standard-document">
1340
- <attribute name="version"/>
1341
- <attribute name="type">
1342
- <choice>
1343
- <value>semantic</value>
1344
- <value>presentation</value>
1345
- </choice>
1346
- </attribute>
1365
+ <ref name="Root-Attributes"/>
1347
1366
  <ref name="bibdata"/>
1348
1367
  <optional>
1349
1368
  <ref name="misccontainer"/>
@@ -2099,10 +2118,7 @@
2099
2118
  <define name="termsource">
2100
2119
  <element name="termsource">
2101
2120
  <attribute name="status">
2102
- <choice>
2103
- <value>identical</value>
2104
- <value>modified</value>
2105
- </choice>
2121
+ <ref name="SourceStatusType"/>
2106
2122
  </attribute>
2107
2123
  <attribute name="type">
2108
2124
  <choice>
@@ -2116,6 +2132,17 @@
2116
2132
  </optional>
2117
2133
  </element>
2118
2134
  </define>
2135
+ <define name="SourceStatusType">
2136
+ <choice>
2137
+ <value>identical</value>
2138
+ <value>modified</value>
2139
+ <value>restyled</value>
2140
+ <value>context-added</value>
2141
+ <value>generalisation</value>
2142
+ <value>specialisation</value>
2143
+ <value>unspecified</value>
2144
+ </choice>
2145
+ </define>
2119
2146
  <define name="origin">
2120
2147
  <element name="origin">
2121
2148
  <choice>
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/un" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns='https://www.metanorma.org/ns/un' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
+ VERSION v1.2.1
4
5
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
6
  we cannot have a new default namespace: we will end up with a grammar with two different
6
7
  namespaces, one for isostandard and one for csand additions. And we do not want that.
@@ -209,13 +210,7 @@
209
210
  </include>
210
211
  <define name="un-standard">
211
212
  <element name="un-standard">
212
- <attribute name="version"/>
213
- <attribute name="type">
214
- <choice>
215
- <value>semantic</value>
216
- <value>presentation</value>
217
- </choice>
218
- </attribute>
213
+ <ref name="Root-Attributes"/>
219
214
  <ref name="bibdata"/>
220
215
  <optional>
221
216
  <ref name="misccontainer"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.10.6".freeze
3
+ VERSION = "0.10.8".freeze
4
4
  end
5
5
  end
data/metanorma-un.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "roman-numerals"
32
32
  spec.add_dependency "twitter_cldr"
33
33
 
34
- spec.add_dependency "metanorma-standoc", "~> 2.4.0"
34
+ spec.add_dependency "metanorma-standoc", "~> 2.4.2"
35
35
 
36
36
  spec.add_development_dependency "debug"
37
37
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.6
4
+ version: 0.10.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.4.0
61
+ version: 2.4.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.4.0
68
+ version: 2.4.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debug
71
71
  requirement: !ruby/object:Gem::Requirement