metanorma-un 0.5.0 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84ac6004180fc5b55f02c08ce72d19b4b2e0de5f5b406f4c6796fe5595edeee6
4
- data.tar.gz: 0d742071c23c5455cca3ddcd9a13dcdcf45ad781478dfad4a4297510697e5f70
3
+ metadata.gz: a89fbe7a8aacf50f53139a549d660b7d0706321463965c5050bb6c2c1d4acdac
4
+ data.tar.gz: f43a231cf294d7f45becca41ce489d6534811cc9f414a0163aeffcb3aa199415
5
5
  SHA512:
6
- metadata.gz: e0d3b23e08336a19b8000792d0facbb9e7311f77ef014e5931503027b5dd9e54fa84e6135c4e38535a8bc0a75d476f5b8ac95443cda73b1e9c4cb19a3d5b3571
7
- data.tar.gz: 88d72ed256d4c45d0c1873c42423fcc6449a99b0a3efa8d842f9d33fcf63dc823a102fac228b4c3fb9a82f737e20cd3befeb6a43e59c7b13884a4c7f301216b6
6
+ metadata.gz: 62377ec55bd35ef893b6ac9bf80676a2873cdd5a63cf6635412b6ceb294aa6d85b352c535392647e633691fd9c1424a740460586e6f3395c1a8958e230e6ea98
7
+ data.tar.gz: 75337ef3e5cab047fae4c81d3e879291d904de3e58bb07bdf976e1bb3197789679b0fecd6f9ecf20b3489701d9a4036ef6584b1f969e56996dd24300195425e4
@@ -402,6 +402,16 @@
402
402
  </choice>
403
403
  </attribute>
404
404
  </optional>
405
+ <optional>
406
+ <attribute name="valign">
407
+ <choice>
408
+ <value>top</value>
409
+ <value>middle</value>
410
+ <value>bottom</value>
411
+ <value>baseline</value>
412
+ </choice>
413
+ </attribute>
414
+ </optional>
405
415
  <choice>
406
416
  <zeroOrMore>
407
417
  <ref name="TextElement"/>
@@ -429,6 +439,16 @@
429
439
  </choice>
430
440
  </attribute>
431
441
  </optional>
442
+ <optional>
443
+ <attribute name="valign">
444
+ <choice>
445
+ <value>top</value>
446
+ <value>middle</value>
447
+ <value>bottom</value>
448
+ <value>baseline</value>
449
+ </choice>
450
+ </attribute>
451
+ </optional>
432
452
  <choice>
433
453
  <zeroOrMore>
434
454
  <ref name="TextElement"/>
@@ -998,6 +1018,9 @@
998
1018
  <value>alphabet_upper</value>
999
1019
  </choice>
1000
1020
  </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1001
1024
  <oneOrMore>
1002
1025
  <ref name="li"/>
1003
1026
  </oneOrMore>
@@ -40,15 +40,17 @@
40
40
  </legal-statement>
41
41
  <feedback-statement>
42
42
  <clause>
43
- <p id="boilerplate-feedback-name">UN Economic Commission for Europe: Information Service</p>
43
+ <p id="boilerplate-feedback-name">{% if subdivision %}{{subdivision}}{% else %}UN Economic Commission for Europe: Information Service{% endif %}</p>
44
44
  <p id="boilerplate-feedback-address">
45
+ {% if pub_address %}{{ pub_address }}{% else %}
45
46
  Palais des Nations<br />
46
47
  CH-1211 Geneva 10<br />
47
- Switzerland<br />
48
+ Switzerland{% endif %}<br />
48
49
  <br />
49
- <link target="tel:+41(0)229171234">+41 (0) 22 917 12 34 (switchboard)</link><br />
50
- <link target="mailto:unece_info@un.org">unece_info@un.org</link><br />
51
- <link target="https://www.unece.org/">www.unece.org/</link>
50
+ <link target="tel:{% if pub_phone %}{{ pub_phone }}{% else %}+41(0)229171234{% endif %}">{% if pub_phone %}{{ pub_phone }}{% else %}+41 (0) 22 917 12 34 (switchboard){% endif %}</link><br />
51
+ {% if pub_fax %}<link target="tel:{{pub_fax}}">{{pub_fax}}</link><br/>{% endif %}
52
+ <link target="mailto:{% if pub_email %}{{ pub_email }}{% else %}unece_info@un.org{% endif %}">{% if pub_email %}{{ pub_email }}{% else %}unece_info@un.org{% endif %}</link><br />
53
+ <link target="{% if pub_uri %}{{pub_uri}}{% else %}https://www.unece.org/{% endif %}">{% if pub_uri %}{{pub_uri}}{% else %}www.unece.org/{% endif %}</link>
52
54
  </p>
53
55
  </clause>
54
56
  </feedback-statement>
@@ -11,24 +11,8 @@ module Asciidoctor
11
11
 
12
12
  register_for "un"
13
13
 
14
- def metadata_author(node, xml)
15
- xml.contributor do |c|
16
- c.role **{ type: "author" }
17
- c.organization do |a|
18
- a.name Metanorma::UN::ORGANIZATION_NAME_LONG
19
- a.abbreviation Metanorma::UN::ORGANIZATION_NAME_SHORT
20
- end
21
- end
22
- end
23
-
24
- def metadata_publisher(node, xml)
25
- xml.contributor do |c|
26
- c.role **{ type: "publisher" }
27
- c.organization do |a|
28
- a.name Metanorma::UN::ORGANIZATION_NAME_LONG
29
- a.abbreviation Metanorma::UN::ORGANIZATION_NAME_SHORT
30
- end
31
- end
14
+ def default_publisher
15
+ "United Nations"
32
16
  end
33
17
 
34
18
  def metadata_committee(node, xml)
@@ -58,8 +42,8 @@ module Asciidoctor
58
42
  node.attr("subtitle") and
59
43
  xml.title **{ type: "subtitle", language: lang,
60
44
  format: "text/plain" } do |t|
61
- t << asciidoc_sub(node.attr("subtitle"))
62
- end
45
+ t << asciidoc_sub(node.attr("subtitle"))
46
+ end
63
47
  end
64
48
  end
65
49
 
@@ -74,19 +58,6 @@ module Asciidoctor
74
58
  xml.docnumber { |i| i << node.attr("docnumber") }
75
59
  end
76
60
 
77
- def metadata_copyright(node, xml)
78
- from = node.attr("copyright-year") || Date.today.year
79
- xml.copyright do |c|
80
- c.from from
81
- c.owner do |owner|
82
- owner.organization do |o|
83
- o.name Metanorma::UN::ORGANIZATION_NAME_LONG
84
- o.abbreviation Metanorma::UN::ORGANIZATION_NAME_SHORT
85
- end
86
- end
87
- end
88
- end
89
-
90
61
  def metadata_distribution(node, xml)
91
62
  xml.distribution node.attr("distribution") if node.attr("distribution")
92
63
  end
@@ -142,7 +113,7 @@ module Asciidoctor
142
113
  end
143
114
 
144
115
  def doctype(node)
145
- d = node.attr("doctype")
116
+ d = super
146
117
  unless %w{plenary recommendation addendum communication corrigendum
147
118
  reissue agenda budgetary sec-gen-notes expert-report resolution
148
119
  plenary-attachment}.include? d
@@ -237,7 +208,7 @@ module Asciidoctor
237
208
 
238
209
  def admonition_attrs(node)
239
210
  attr_code(super.merge("unnumbered": node.option?("unnumbered"),
240
- "subsequence": node.attr("subsequence")))
211
+ "subsequence": node.attr("subsequence")))
241
212
  end
242
213
 
243
214
  def sectiontype_streamline(ret)
@@ -43,7 +43,9 @@
43
43
  <define name="xref">
44
44
  <element name="xref">
45
45
  <attribute name="target">
46
- <data type="IDREF"/>
46
+ <data type="string">
47
+ <param name="pattern">\i\c*|\c+#\c+</param>
48
+ </data>
47
49
  </attribute>
48
50
  <optional>
49
51
  <attribute name="type">
@@ -61,6 +63,11 @@
61
63
  </choice>
62
64
  </attribute>
63
65
  </optional>
66
+ <optional>
67
+ <attribute name="droploc">
68
+ <data type="boolean"/>
69
+ </attribute>
70
+ </optional>
64
71
  <text/>
65
72
  </element>
66
73
  </define>
@@ -578,6 +585,8 @@
578
585
  <ref name="ol"/>
579
586
  <ref name="dl"/>
580
587
  <ref name="formula"/>
588
+ <ref name="quote"/>
589
+ <ref name="sourcecode"/>
581
590
  </choice>
582
591
  </oneOrMore>
583
592
  </element>
@@ -661,6 +670,16 @@
661
670
  </choice>
662
671
  </attribute>
663
672
  </optional>
673
+ <optional>
674
+ <attribute name="valign">
675
+ <choice>
676
+ <value>top</value>
677
+ <value>middle</value>
678
+ <value>bottom</value>
679
+ <value>baseline</value>
680
+ </choice>
681
+ </attribute>
682
+ </optional>
664
683
  <choice>
665
684
  <zeroOrMore>
666
685
  <choice>
@@ -697,6 +716,16 @@
697
716
  </choice>
698
717
  </attribute>
699
718
  </optional>
719
+ <optional>
720
+ <attribute name="valign">
721
+ <choice>
722
+ <value>top</value>
723
+ <value>middle</value>
724
+ <value>bottom</value>
725
+ <value>baseline</value>
726
+ </choice>
727
+ </attribute>
728
+ </optional>
700
729
  <choice>
701
730
  <zeroOrMore>
702
731
  <choice>
@@ -834,6 +863,13 @@
834
863
  </define>
835
864
  <define name="standard-document">
836
865
  <element name="standard-document">
866
+ <attribute name="version"/>
867
+ <attribute name="type">
868
+ <choice>
869
+ <value>semantic</value>
870
+ <value>presentation</value>
871
+ </choice>
872
+ </attribute>
837
873
  <ref name="bibdata"/>
838
874
  <optional>
839
875
  <ref name="boilerplate"/>
@@ -855,7 +891,7 @@
855
891
  <oneOrMore>
856
892
  <choice>
857
893
  <ref name="content"/>
858
- <ref name="preface_abstract"/>
894
+ <ref name="abstract"/>
859
895
  <ref name="foreword"/>
860
896
  <ref name="introduction"/>
861
897
  <ref name="acknowledgements"/>
@@ -1049,14 +1085,17 @@
1049
1085
  <ref name="section-title"/>
1050
1086
  </optional>
1051
1087
  <group>
1052
- <group>
1053
- <zeroOrMore>
1054
- <ref name="BasicBlock"/>
1055
- </zeroOrMore>
1056
- <zeroOrMore>
1057
- <ref name="note"/>
1058
- </zeroOrMore>
1059
- </group>
1088
+ <choice>
1089
+ <group>
1090
+ <zeroOrMore>
1091
+ <ref name="BasicBlock"/>
1092
+ </zeroOrMore>
1093
+ <zeroOrMore>
1094
+ <ref name="note"/>
1095
+ </zeroOrMore>
1096
+ </group>
1097
+ <ref name="amend"/>
1098
+ </choice>
1060
1099
  <zeroOrMore>
1061
1100
  <choice>
1062
1101
  <ref name="clause-subsection"/>
@@ -1453,11 +1492,6 @@
1453
1492
  </optional>
1454
1493
  </element>
1455
1494
  </define>
1456
- <define name="preface_abstract">
1457
- <element name="abstract">
1458
- <ref name="Basic-Section"/>
1459
- </element>
1460
- </define>
1461
1495
  <define name="term-clause">
1462
1496
  <element name="clause">
1463
1497
  <optional>
@@ -1507,4 +1541,79 @@
1507
1541
  <ref name="CitationType"/>
1508
1542
  </element>
1509
1543
  </define>
1544
+ <define name="amend">
1545
+ <element name="amend">
1546
+ <optional>
1547
+ <attribute name="id">
1548
+ <data type="ID"/>
1549
+ </attribute>
1550
+ </optional>
1551
+ <attribute name="change">
1552
+ <choice>
1553
+ <value>add</value>
1554
+ <value>modify</value>
1555
+ <value>delete</value>
1556
+ </choice>
1557
+ </attribute>
1558
+ <optional>
1559
+ <attribute name="path"/>
1560
+ </optional>
1561
+ <optional>
1562
+ <attribute name="path_end"/>
1563
+ </optional>
1564
+ <optional>
1565
+ <attribute name="title"/>
1566
+ </optional>
1567
+ <optional>
1568
+ <element name="location">
1569
+ <zeroOrMore>
1570
+ <ref name="locality"/>
1571
+ </zeroOrMore>
1572
+ </element>
1573
+ </optional>
1574
+ <zeroOrMore>
1575
+ <ref name="autonumber"/>
1576
+ </zeroOrMore>
1577
+ <optional>
1578
+ <element name="description">
1579
+ <zeroOrMore>
1580
+ <ref name="BasicBlock"/>
1581
+ </zeroOrMore>
1582
+ </element>
1583
+ </optional>
1584
+ <optional>
1585
+ <element name="newcontent">
1586
+ <zeroOrMore>
1587
+ <ref name="BasicBlock"/>
1588
+ </zeroOrMore>
1589
+ </element>
1590
+ </optional>
1591
+ <optional>
1592
+ <element name="description">
1593
+ <zeroOrMore>
1594
+ <ref name="BasicBlock"/>
1595
+ </zeroOrMore>
1596
+ </element>
1597
+ </optional>
1598
+ </element>
1599
+ </define>
1600
+ <define name="autonumber">
1601
+ <element name="autonumber">
1602
+ <attribute name="type">
1603
+ <choice>
1604
+ <value>requirement</value>
1605
+ <value>recommendation</value>
1606
+ <value>permission</value>
1607
+ <value>table</value>
1608
+ <value>figure</value>
1609
+ <value>admonition</value>
1610
+ <value>formula</value>
1611
+ <value>sourcecode</value>
1612
+ <value>example</value>
1613
+ <value>note</value>
1614
+ </choice>
1615
+ </attribute>
1616
+ <text/>
1617
+ </element>
1618
+ </define>
1510
1619
  </grammar>
@@ -340,6 +340,13 @@
340
340
  </define>
341
341
  <define name="un-standard">
342
342
  <element name="un-standard">
343
+ <attribute name="version"/>
344
+ <attribute name="type">
345
+ <choice>
346
+ <value>semantic</value>
347
+ <value>presentation</value>
348
+ </choice>
349
+ </attribute>
343
350
  <ref name="bibdata"/>
344
351
  <optional>
345
352
  <ref name="boilerplate"/>
@@ -42,8 +42,16 @@
42
42
  </div>
43
43
  </div>
44
44
 
45
+ {% assign fn_refs = "" | split: ',' %}
46
+ {% assign txt = "" %}
47
+ {% for item in title_footnote %}
48
+ {% assign txt = txt | append: "*" %}
49
+ {% assign txtarr = txt | split: "," %}
50
+ {% assign fn_refs = fn_refs | concat: txtarr %}
51
+ {% endfor %}
52
+
45
53
  <div class="coverpage-title">
46
- <span class="title-first">{{ doctitle }}</span>
54
+ <span class="title-first">{{ doctitle }}{% if fn_refs.size > 0 %}<sup>{{ fn_refs | join: "," }}</sup>{% endif %} </span>
47
55
  <!--<span class="title-second">{{ docsubtitle }}</span>-->
48
56
  </div>
49
57
  </div>
@@ -69,6 +77,14 @@
69
77
  <div class="coverpage-stage-block" >{{ revdate }}</div>
70
78
  {% endif %}
71
79
 
80
+ {% if fn_refs.size > 0 %}
81
+ <div class="title-footnote">
82
+ {% for item in title_footnote %}
83
+ <p><sup>{{fn_refs[forloop.index0]}}</sup> {{ item }}</p>
84
+ {% endfor %}
85
+ </div>
86
+ {% endif %}
87
+
72
88
  <div class="info-section">
73
89
  <div class="copyright">
74
90
  <p class="year">
@@ -22,8 +22,17 @@
22
22
  <span class="docyear">{{ draftinfo }}</span>
23
23
  </div>
24
24
 
25
+
26
+ {% assign fn_refs = "" | split: ',' %}
27
+ {% assign txt = "" %}
28
+ {% for item in title_footnote %}
29
+ {% assign txt = txt | append: "*" %}
30
+ {% assign txtarr = txt | split: "," %}
31
+ {% assign fn_refs = fn_refs | concat: txtarr %}
32
+ {% endfor %}
33
+
25
34
  <div class="coverpage-title">
26
- <span class="title-first">{{ doctitle }}</span>
35
+ <span class="title-first">{{ doctitle }}{% if fn_refs.size > 0 %}<sup>{{ fn_refs | join: "," }}</sup>{% endif %} </span>
27
36
  <!--<span class="title-second">{{ docsubtitle }}</span>-->
28
37
  </div>
29
38
  </div>
@@ -57,6 +66,16 @@
57
66
  <div class="coverpage-stage-block" >{{ revdate }}</div>
58
67
  {% endif %}
59
68
 
69
+ {% if fn_refs.size > 0 %}
70
+ <div class="title-footnote">
71
+ {% for item in title_footnote %}
72
+ <p><sup>{{fn_refs[forloop.index0]}}</sup> {{ item }}</p>
73
+ {% endfor %}
74
+ </div>
75
+ {% endif %}
76
+
77
+
78
+
60
79
  <div class="info-section">
61
80
  <div class="copyright">
62
81
  <p class="year">
@@ -16,7 +16,7 @@ fieldset, form, label, legend,
16
16
  table, caption, tbody, tfoot, thead, tr, th, td,
17
17
  article, aside, canvas, details, embed,
18
18
  figure, figcaption, footer, header, hgroup,
19
- menu, nav, output, ruby, section, summary,
19
+ menu, output, ruby, section, summary,
20
20
  time, mark, audio, video {
21
21
  margin: 0;
22
22
  padding: 0; }
@@ -920,6 +920,9 @@ h2 p {
920
920
  padding: 0 2em 0 3em;
921
921
  text-align: center; }
922
922
 
923
+ .title-footnote {
924
+ text-align: left; }
925
+
923
926
  .info-section {
924
927
  padding: 0 2em; }
925
928