metanorma-unece 0.0.5 → 0.0.6

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: 86e4d49b216c7cf8ee9315034243132870f6c4932257128c8eb3c752ad5a87f5
4
- data.tar.gz: 92c478095f75b798443b4bd1b2317e2f5492e01b732d2b2d94f7fdc174f1bc63
3
+ metadata.gz: 93cd4ceeaf6825b20fc2292bdf21d4b1303c6beb7fdc15752130cda11f9e1bf6
4
+ data.tar.gz: ed0519860a0f996f436a3c40236ab6dc4040b303789467cb88482b24e1e4bd6e
5
5
  SHA512:
6
- metadata.gz: 490b142dcfd116a872c4f28139b8bd267e576705ba09457148667367053e7b0cd0d5be1dd6f3f7ce7db87326a7883cbb684e8572eaaf0823626ad073b34b88c0
7
- data.tar.gz: '08e69ccc41508b7ef6495dbbfa6cd17fba5fd2ee826459fc52f2a5e4e135d9ff29b89f94a97a6399b79aa52a66dc46b83e2603fe38251a9fce5cc1fa883f40f4'
6
+ metadata.gz: add90ed90dc0ab5745d6ac986c54d090b8929e914db6733601c3becb1e214f372347efa48295d941e07dc9ef8f71bd724d4830f4485bd084b59ca1f81ad7d34a
7
+ data.tar.gz: fb9137b591878903fb3618e5abd852da8cd4ba8227b58f62397675fd5cceddd12a1d2e47472d487a99449073c98ad8c094a2424b38c538538bddde7c02bf1f39
data/README.adoc CHANGED
@@ -185,8 +185,11 @@ resolution:: Resolutions and other formal decisions of United Nations organs
185
185
  `:committee:`:: The name of the relevant UNECE committee, for example,
186
186
  `United Nations Centre for Trade Facilitation and Electronic Business (UN/CEFACT)` (mandatory)
187
187
 
188
- `:language:` :: The language of the document (only `en` for now) (mandatory)
189
- `:script:` :: The language of the document (only `Latn` for now) (mandatory)
188
+ `:language:` :: The language(s) of the document. This is the language in which the document
189
+ has been issued, not the language(s) in which it has been submitted. ISO-639-1 codes are used
190
+ for languages, and they are comma-delimited. If not specified, the six official languages of the
191
+ UN are assumed: Arabic, Chinese, English, French, Russian and Spanish (`ar,zh,en,fr,ru,es`).
192
+ `:script:` :: The script of the document
190
193
 
191
194
  `:toc:` :: Include table of contents in Word output. (Table of contents is always included in
192
195
  HTML output.)
@@ -194,23 +197,31 @@ HTML output.)
194
197
  NOTE: The attribute `:draft:`, if present, includes review notes in the XML output;
195
198
  these are otherwise suppressed.
196
199
 
200
+ === UN document-specific attributes
201
+
202
+ `:distribution:`:: Extent of distribution allowed. e.g. `General`
197
203
 
198
204
  === Recommendation specific attributes
199
205
 
200
206
  `:docnumber:`:: The document number if the document is a Recommendation. e.g. `42` for Recommendation 42, which happens to be the ultimate answer. (mandatory for Recommendation)
201
207
 
208
+ `:submissionlanguage:`:: The language(s) in which the document was originally submitted.
209
+ ISO-639-1 codes are used for languages, and they are comma-delimited.
202
210
 
203
211
  === Plenary document specific attributes
204
212
 
205
213
  `:session-date:`:: Date of the session where this document will be discussed. e.g. `Geneva, 30 April – 1 May 2018`
206
214
 
207
- `:agenda-item:`:: Number of the agenda item this document belongs to. e.g. `Item 6 of the provisional agenda`
215
+ `:item-number:`:: Number of the agenda item this document belongs to. e.g. `Item 6 of the provisional agenda`. If the document corresponds to multiple items, they are comma-delimited. If the document belongs to multiple subitems under a single item, following editorial practice of the UN (http://dd.dgacm.org/editorialmanual/ed-guidelines/format/Model_mast21.pdf), give the item and subitems identifiers here.
216
+
217
+ `:item-name:`:: Name of the agenda item this document belongs to. If the document corresponds to multiple items, they are comma-delimited.
218
+ `:subitem-name:`:: Name of the agenda subitem this document belongs to. If the document corresponds to multiple subitems, they are comma-delimited.
208
219
 
209
220
  `:collaborator:`:: Collaborator of this document, if any. e.g. `World Economic Forum`
210
221
 
211
- `:agenda-id:`:: The unique ID number of this agenda item. e.g. `ECE/TRADE/C/CEFACT/2018/6`
222
+ `:agenda-id:`:: The unique identifier of this agenda item. e.g. `ECE/TRADE/C/CEFACT/2018/6`. If there are multiple agenda items or subitems, given them comma-delimited.
212
223
 
213
- `:distribution:`:: Extent of distribution allowed. e.g. `General`
224
+ `:item-footnote:`:: Footnoted reference to item, if item is on the preliminary list or the provisional agenda.
214
225
 
215
226
  [[model_additions]]
216
227
  == Asciidoctor features specific to CSAND
@@ -80,19 +80,33 @@ module Asciidoctor
80
80
  end
81
81
  end
82
82
 
83
+ def metadata_distribution(node, xml)
84
+ xml.distribution node.attr("distribution") if node.attr("distribution")
85
+ end
86
+
83
87
  def metadata_session(node, xml)
84
88
  xml.session do |session|
85
89
  session.number node.attr("session") if node.attr("session")
86
90
  session.date node.attr("session-date") if node.attr("session-date")
87
- session.agenda_item node.attr("agenda-item") if node.attr("agenda-item")
91
+ node&.attr("item-number")&.split(/,[ ]*/)&.each { |i| session.item_number i }
92
+ node&.attr("item-name")&.split(/,[ ]*/)&.each { |i| session.item_name i }
93
+ node&.attr("subitem-name")&.split(/,[ ]*/)&.each { |i| session.subitem_name i }
88
94
  session.collaborator node.attr("collaborator") if node.attr("collaborator")
89
95
  session.id node.attr("agenda-id") if node.attr("agenda-id")
90
- session.distribution node.attr("distribution") if node.attr("distribution")
96
+ session.item_footnote node.attr("item-footnote") if node.attr("item-footnote")
91
97
  end
92
98
  end
93
99
 
100
+ def metadata_language(node, xml)
101
+ languages = node&.attr("language")&.split(/,[ ]*/) || %w(ar ru en fr zh es)
102
+ languages.each { |l| xml.language l }
103
+ languages = node&.attr("submissionlanguage")&.split(/,[ ]*/) || []
104
+ languages.each { |l| xml.submissionlanguage l }
105
+ end
106
+
94
107
  def metadata(node, xml)
95
108
  super
109
+ metadata_distribution(node, xml)
96
110
  metadata_session(node, xml)
97
111
  end
98
112
 
@@ -144,15 +158,6 @@ module Asciidoctor
144
158
  File.join(File.dirname(__FILE__), "unece.rng"))
145
159
  end
146
160
 
147
- def literal(node)
148
- noko do |xml|
149
- xml.figure **id_attr(node) do |f|
150
- figure_title(node, f)
151
- f.pre node.lines.join("\n")
152
- end
153
- end
154
- end
155
-
156
161
  def style(n, t)
157
162
  return
158
163
  end
@@ -173,29 +178,6 @@ module Asciidoctor
173
178
  IsoDoc::Unece::WordConvert.new(doc_extract_attributes(node))
174
179
  end
175
180
 
176
- def inline_quoted(node)
177
- noko do |xml|
178
- case node.type
179
- when :emphasis then xml.em node.text
180
- when :strong then xml.strong node.text
181
- when :monospaced then xml.tt node.text
182
- when :double then xml << "\"#{node.text}\""
183
- when :single then xml << "'#{node.text}'"
184
- when :superscript then xml.sup node.text
185
- when :subscript then xml.sub node.text
186
- when :asciimath then stem_parse(node.text, xml)
187
- else
188
- case node.role
189
- when "strike" then xml.strike node.text
190
- when "smallcap" then xml.smallcap node.text
191
- when "keyword" then xml.keyword node.text
192
- else
193
- xml << node.text
194
- end
195
- end
196
- end.join
197
- end
198
-
199
181
  def sections_cleanup(xmldoc)
200
182
  super
201
183
  xmldoc.xpath("//clause/p | //annex/p").each do |p|
@@ -384,6 +384,7 @@
384
384
  <ref name="sourcecode"/>
385
385
  <ref name="example"/>
386
386
  <ref name="review"/>
387
+ <ref name="pre"/>
387
388
  </choice>
388
389
  </define>
389
390
  <define name="paragraph">
@@ -540,6 +541,20 @@
540
541
  </zeroOrMore>
541
542
  </element>
542
543
  </define>
544
+ <define name="pre">
545
+ <element name="pre">
546
+ <attribute name="id">
547
+ <data type="ID"/>
548
+ </attribute>
549
+ <optional>
550
+ <ref name="tname"/>
551
+ </optional>
552
+ <text/>
553
+ <zeroOrMore>
554
+ <ref name="note"/>
555
+ </zeroOrMore>
556
+ </element>
557
+ </define>
543
558
  <define name="table">
544
559
  <element name="table">
545
560
  <attribute name="id">
@@ -710,6 +725,7 @@
710
725
  </optional>
711
726
  <choice>
712
727
  <ref name="image"/>
728
+ <ref name="pre"/>
713
729
  <zeroOrMore>
714
730
  <ref name="figure"/>
715
731
  </zeroOrMore>
@@ -735,6 +751,7 @@
735
751
  <ref name="sub"/>
736
752
  <ref name="sup"/>
737
753
  <ref name="tt"/>
754
+ <ref name="keyword"/>
738
755
  <ref name="strike"/>
739
756
  <ref name="smallcap"/>
740
757
  <ref name="xref"/>
@@ -765,6 +782,11 @@
765
782
  <text/>
766
783
  </element>
767
784
  </define>
785
+ <define name="keyword">
786
+ <element name="keyword">
787
+ <text/>
788
+ </element>
789
+ </define>
768
790
  <define name="sub">
769
791
  <element name="sub">
770
792
  <text/>
@@ -199,6 +199,9 @@
199
199
  <zeroOrMore>
200
200
  <ref name="language"/>
201
201
  </zeroOrMore>
202
+ <zeroOrMore>
203
+ <ref name="submissionlanguage"/>
204
+ </zeroOrMore>
202
205
  <zeroOrMore>
203
206
  <ref name="script"/>
204
207
  </zeroOrMore>
@@ -216,6 +219,12 @@
216
219
  <zeroOrMore>
217
220
  <ref name="ics"/>
218
221
  </zeroOrMore>
222
+ <optional>
223
+ <ref name="distribution"/>
224
+ </optional>
225
+ <optional>
226
+ <ref name="session"/>
227
+ </optional>
219
228
  </define>
220
229
  <define name="preface">
221
230
  <element name="preface">
@@ -236,11 +245,93 @@
236
245
  </element>
237
246
  </define>
238
247
  </include>
248
+ <define name="session">
249
+ <element name="session">
250
+ <optional>
251
+ <ref name="session-number"/>
252
+ </optional>
253
+ <optional>
254
+ <ref name="session-date"/>
255
+ </optional>
256
+ <zeroOrMore>
257
+ <ref name="item-number"/>
258
+ </zeroOrMore>
259
+ <zeroOrMore>
260
+ <ref name="item-name"/>
261
+ </zeroOrMore>
262
+ <zeroOrMore>
263
+ <ref name="subitem-name"/>
264
+ </zeroOrMore>
265
+ <optional>
266
+ <ref name="collaborator"/>
267
+ </optional>
268
+ <optional>
269
+ <ref name="agenda-id"/>
270
+ </optional>
271
+ <optional>
272
+ <ref name="item-footnote"/>
273
+ </optional>
274
+ </element>
275
+ </define>
239
276
  <define name="committee">
240
277
  <element name="committee">
241
278
  <text/>
242
279
  </element>
243
280
  </define>
281
+ <define name="session-number">
282
+ <element name="number">
283
+ <text/>
284
+ </element>
285
+ </define>
286
+ <define name="session-date">
287
+ <element name="session-date">
288
+ <data type="date"/>
289
+ </element>
290
+ </define>
291
+ <define name="item-number">
292
+ <element name="item-number">
293
+ <text/>
294
+ </element>
295
+ </define>
296
+ <define name="collaborator">
297
+ <element name="collaborator">
298
+ <text/>
299
+ </element>
300
+ </define>
301
+ <define name="agenda-id">
302
+ <element name="agenda-id">
303
+ <text/>
304
+ </element>
305
+ </define>
306
+ <define name="item-name">
307
+ <element name="item-name">
308
+ <text/>
309
+ </element>
310
+ </define>
311
+ <define name="subitem-name">
312
+ <element name="subitem-name">
313
+ <text/>
314
+ </element>
315
+ </define>
316
+ <define name="item-footnote">
317
+ <element name="item-footnote">
318
+ <text/>
319
+ </element>
320
+ </define>
321
+ <define name="submissionlanguage">
322
+ <element name="submissionlanguage">
323
+ <text/>
324
+ </element>
325
+ </define>
326
+ <define name="distribution">
327
+ <element name="distribution">
328
+ <choice>
329
+ <value>general</value>
330
+ <value>limited</value>
331
+ <value>restricted</value>
332
+ </choice>
333
+ </element>
334
+ </define>
244
335
  <define name="unece-standard">
245
336
  <element name="unece-standard">
246
337
  <ref name="bibdata"/>
@@ -0,0 +1,133 @@
1
+ <div class="document-stage-band" id='{{ status | downcase | replace: " ", "-" }}-band'>
2
+ <p class="document-stage">{{ status }}</p>
3
+ </div>
4
+
5
+ <div class="document-type-band" id='{{ doctype | downcase | replace: " ", "-" }}-band'>
6
+ <p class="document-type">UNECE {{ doctype }}</p>
7
+ </div>
8
+
9
+
10
+
11
+ <div id='toggle'> <span>&#x2022;</span> </div>
12
+
13
+ <header>
14
+
15
+ <!--<div class="WordSection1">-->
16
+ <div class="coverpage">
17
+ <div class="wrapper-top">
18
+
19
+ <div class="coverpage-doc-identity">
20
+ <div class="doc-number">
21
+ <span class="docnumber">{{ formatted_docnumber }}</span>
22
+ <span class="docyear">{{ draftinfo }}</span>
23
+ </div>
24
+
25
+ <div class="doc-number">
26
+ <p>{{ session_number }} session</p>
27
+ <p>{{ session_date }}</p>
28
+ {% if session_itemnumber.size == 1 %}
29
+ <p>Agenda item {{ session_itemnumber[0] }}</p>
30
+ {% endif %}
31
+ {% if session_itemnumber.size > 1 %}
32
+ <p>Agenda items {{ session_itemnumber | join: ", " }}</p>
33
+ {% endif %}
34
+ <p>{{ docnumber }}{% if item_footnote %}[{{item_footnote}}]{% endif %}
35
+ {% if session_itemname.size > 0 %}
36
+ <p> {{ session_itemname | join: "<br/>" }}</p>
37
+ {% endif %}
38
+ {% if session_subitemname.size > 0 %}
39
+ <p>{{ session_subitemname | join: "<br/>" }}</p>
40
+ {% endif %}
41
+ </div>
42
+ </div>
43
+
44
+ <div class="coverpage-title">
45
+ <span class="title-first">{{ doctitle }}</span>
46
+ <!--<span class="title-second">{{ docsubtitle }}</span>-->
47
+ </div>
48
+ </div>
49
+
50
+ <div class="coverpage-logo">
51
+ <span>UNECE {{ docyear }}</span>
52
+ </div>
53
+
54
+ <div class="coverpage-tc-name">
55
+ <span>{{ tc }}</span>
56
+ </div>
57
+ </div>
58
+
59
+ <div class="wrapper-top-bottom"></div>
60
+
61
+ <div class="WordSection11">
62
+ <div class="coverpage-stage-block" >
63
+ <span class="coverpage-stage" id="{{ doctype | replace: ' ', '-' | downcase }}">UNECE {{ doctype }}</span>
64
+ </div>
65
+
66
+ <div class="coverpage-stage-block" >
67
+ <p><span class="coverpage-maturity" id="{{ status | replace: ' ', '-' | downcase }}">{% if unpublished %}{{ status }}{% endif %}</span></p>
68
+ {% if submissionlanguage %}
69
+ <p><span class="coverpage-maturity">Original: {{ submissionlanguage | join: "/" }}</span></p>
70
+ {% endif %}
71
+ {% if language %}
72
+ <p><span class="coverpage-maturity">{{ language | join: ", " }} only</span></p>
73
+ {% endif %}
74
+ </div>
75
+
76
+ {% if doctype == "Policy And Procedures" or doctype == "Proposal" %}
77
+ <div class="coverpage-stage-block" >{{ revdate }}</div>
78
+ {% endif %}
79
+
80
+ {% if unpublished %}
81
+ <div class="coverpage-warning">
82
+ <span class="title">Warning for Drafts</span>
83
+
84
+ <p class="content">
85
+ This document is not a UNECE Standard. It is distributed for review and
86
+ comment, and is subject to change without notice and may not be referred to as
87
+ a Standard. Recipients of this draft are invited to submit, with their
88
+ comments, notification of any relevant patent rights of which they are aware
89
+ and to provide supporting documentation.
90
+ </p>
91
+ </div>
92
+ {% endif %}
93
+
94
+ <div class="info-section">
95
+ <div class="copyright">
96
+ <p class="year">
97
+ &copy; {{ docyear }} United Nations.
98
+ </p>
99
+
100
+ <p class="message">
101
+ None of the materials provided on this web site may be used,
102
+ reproduced or transmitted, in whole or in part, in any form or by any
103
+ means, electronic or mechanical, including photocopying, recording or
104
+ the use of any information storage and retrieval system, except as
105
+ provided for in the Terms and Conditions of Use of United Nations Web
106
+ Sites, without permission in writing from the publisher. <br>
107
+ <br>
108
+ News-related material can be used as long as the appropriate credit is given and the United Nations is advised.<br>
109
+ <br>
110
+ To request such permission or for further enquires, please visit:
111
+ <a href="https://shop.un.org/rights-permissions">United Nations Publications: Rights and Permissions.</a><br>
112
+ </p>
113
+
114
+ <div class="contact-info">
115
+ <p class="name">UN Economic Commission for Europe: Information Service</p>
116
+ <p class="address">
117
+ Palais des Nations<br />
118
+ CH-1211 Geneva 10<br />
119
+ Switzerland<br />
120
+ <br />
121
+ <a href="tel:+41(0)229171234">+41 (0) 22 917 12 34 (switchboard)</a><br />
122
+ <a href="mailto:unece_info@un.org">unece_info@un.org</a><br />
123
+ <a href="https://www.unece.org/">www.unece.org/</a>
124
+ </p>
125
+ </div>
126
+ </div>
127
+
128
+ <div class="rule"></div>
129
+ </div>
130
+ </div>
131
+
132
+
133
+ </header>