metanorma-un 0.5.6 → 0.5.11

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: 79714156551c88f6bc3eefeebdbeffe4193e8dbd1733c37daafe177a86eacea0
4
- data.tar.gz: 5840e63035de8487fc98ef7b666b25f30aaaf3176e0d2b117f9b2e8d4797eda1
3
+ metadata.gz: 3669c8651ebe2fd2d2ee518d75f80e152bdf76b1f6e6580ca2795e365a440fda
4
+ data.tar.gz: 75d299cd1e26be0ab1e8b407f60ac0c8eb6e790923d1beb4f4154383923da117
5
5
  SHA512:
6
- metadata.gz: 894f12d8ecf83d3d6b6550e034bcc14412788df9c1f094457ff09590e133385ccb424c7ed3d7048edb82a5cd162f63ccae0cdcb82bf80783e108d529ab5ad882
7
- data.tar.gz: c80957880910920416881f277c72b7990cc50cda1b7bbccda5457916a6ec8b8d175dc5a7c1138c9c662acca0aac23ca08151ec2f117a9cb30f90a8b3385100c7
6
+ metadata.gz: 0b4fbbad777aed0a62be4f95fe3668fc7fcc1ed1a42478b9e6b69cbbe5c8adddcd833731cc64062e6484b735a9d35e2a378a6ea260f27bfe4bfc7eeff82aaa9c
7
+ data.tar.gz: 3e82ec5eb0e089f3259644789b6c53297f313d0d6f31dba720c656029cf40ce8396fcde56f82954aefa4988ffdf1551147b23a92090c6564fcc87bb5966a1f46
@@ -4,7 +4,8 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master ]
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
8
9
  pull_request:
9
10
 
10
11
  jobs:
@@ -31,14 +32,34 @@ jobs:
31
32
  steps:
32
33
  - uses: actions/checkout@master
33
34
 
34
- - name: Use Ruby
35
- uses: ruby/setup-ruby@v1
35
+ - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
- bundler-cache: true
39
38
 
40
- - name: Update gems
41
- run: bundle install --jobs 4 --retry 3
39
+ - if: matrix.os == 'macos-latest'
40
+ run: brew install autoconf automake libtool
42
41
 
43
- - name: Run specs
44
- run: bundle exec rake
42
+ - uses: actions/cache@v2
43
+ with:
44
+ path: vendor/bundle
45
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
46
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
47
+
48
+ - run: bundle config set path 'vendor/bundle'
49
+
50
+ - run: bundle install --jobs 4 --retry 3
51
+
52
+ - run: bundle exec rake
53
+
54
+ tests-passed:
55
+ needs: rake
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - name: Trigger tests passed event
59
+ uses: Sibz/github-status-action@v1
60
+ with:
61
+ authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
62
+ context: 'tests-passed-successfully'
63
+ description: 'Tests passed successfully'
64
+ state: 'success'
65
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -3,16 +3,14 @@
3
3
  (Formerly known as metanorma-unece)
4
4
 
5
5
  image:https://img.shields.io/gem/v/metanorma-un.svg["Gem Version", link="https://rubygems.org/gems/metanorma-un"]::
6
- image:https://github.com/metanorma/metanorma-un/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-un/actions?workflow=macos"]
7
- image:https://github.com/metanorma/metanorma-un/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-un/actions?workflow=windows"]
8
- image:https://github.com/metanorma/metanorma-un/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/metanorma/metanorma-un/actions?workflow=ubuntu"]
6
+ image:https://github.com/metanorma/metanorma-un/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-un/actions?workflow=rake"]
9
7
  image:https://codeclimate.com/github/metanorma/metanorma-unece/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-unece"]
10
8
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-un.svg["Pull Requests", link="https://github.com/metanorma/metanorma-un/pulls"]
11
9
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-un/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-un/releases"]
12
10
 
13
11
  == Functionality
14
12
 
15
- This gem processes http://asciidoctor.org/[Asciidoctor] documents following
13
+ This gem processes https://www.metanorma.com/[Metanorma documents] following
16
14
  a template for generating UN International Standards.
17
15
 
18
16
  The gem currently inherits from the https://github.com/metanorma/metanorma-standoc[Metanorma-Standoc]
@@ -596,6 +596,7 @@
596
596
  <ref name="bookmark"/>
597
597
  <ref name="image"/>
598
598
  <ref name="index"/>
599
+ <ref name="index-xref"/>
599
600
  </choice>
600
601
  </define>
601
602
  <define name="PureTextElement">
@@ -728,15 +729,61 @@
728
729
  </define>
729
730
  <define name="index">
730
731
  <element name="index">
731
- <attribute name="primary"/>
732
+ <attribute name="to">
733
+ <data type="IDREF"/>
734
+ </attribute>
735
+ <element name="primary">
736
+ <oneOrMore>
737
+ <ref name="PureTextElement"/>
738
+ </oneOrMore>
739
+ </element>
732
740
  <optional>
733
- <attribute name="secondary"/>
741
+ <element name="secondary">
742
+ <oneOrMore>
743
+ <ref name="PureTextElement"/>
744
+ </oneOrMore>
745
+ </element>
734
746
  </optional>
735
747
  <optional>
736
- <attribute name="tertiary"/>
748
+ <element name="tertiary">
749
+ <oneOrMore>
750
+ <ref name="PureTextElement"/>
751
+ </oneOrMore>
752
+ </element>
737
753
  </optional>
738
754
  </element>
739
755
  </define>
756
+ <define name="index-xref">
757
+ <element name="index-xref">
758
+ <attribute name="also">
759
+ <data type="boolean"/>
760
+ </attribute>
761
+ <element name="primary">
762
+ <oneOrMore>
763
+ <ref name="PureTextElement"/>
764
+ </oneOrMore>
765
+ </element>
766
+ <optional>
767
+ <element name="secondary">
768
+ <oneOrMore>
769
+ <ref name="PureTextElement"/>
770
+ </oneOrMore>
771
+ </element>
772
+ </optional>
773
+ <optional>
774
+ <element name="tertiary">
775
+ <oneOrMore>
776
+ <ref name="PureTextElement"/>
777
+ </oneOrMore>
778
+ </element>
779
+ </optional>
780
+ <element name="target">
781
+ <oneOrMore>
782
+ <ref name="PureTextElement"/>
783
+ </oneOrMore>
784
+ </element>
785
+ </element>
786
+ </define>
740
787
  <!-- bare ID element, used for referencing arbitrary spans of text -->
741
788
  <define name="bookmark">
742
789
  <element name="bookmark">
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -47,6 +55,13 @@
47
55
  <param name="pattern">\i\c*|\c+#\c+</param>
48
56
  </data>
49
57
  </attribute>
58
+ <optional>
59
+ <attribute name="to">
60
+ <data type="string">
61
+ <param name="pattern">\i\c*|\c+#\c+</param>
62
+ </data>
63
+ </attribute>
64
+ </optional>
50
65
  <optional>
51
66
  <attribute name="type">
52
67
  <ref name="ReferenceFormat"/>
@@ -141,6 +156,11 @@
141
156
  <data type="boolean"/>
142
157
  </attribute>
143
158
  </optional>
159
+ <optional>
160
+ <attribute name="key">
161
+ <data type="boolean"/>
162
+ </attribute>
163
+ </optional>
144
164
  <oneOrMore>
145
165
  <ref name="dt"/>
146
166
  <ref name="dd"/>
@@ -233,6 +253,12 @@
233
253
  <data type="boolean"/>
234
254
  </attribute>
235
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
259
+ <optional>
260
+ <ref name="colgroup"/>
261
+ </optional>
236
262
  <optional>
237
263
  <ref name="tname"/>
238
264
  </optional>
@@ -751,6 +777,18 @@
751
777
  </define>
752
778
  </include>
753
779
  <!-- end overrides -->
780
+ <define name="colgroup">
781
+ <element name="colgroup">
782
+ <oneOrMore>
783
+ <ref name="col"/>
784
+ </oneOrMore>
785
+ </element>
786
+ </define>
787
+ <define name="col">
788
+ <element name="col">
789
+ <attribute name="width"/>
790
+ </element>
791
+ </define>
754
792
  <define name="TextElement" combine="choice">
755
793
  <ref name="concept"/>
756
794
  </define>
@@ -801,6 +839,9 @@
801
839
  <data type="boolean"/>
802
840
  </attribute>
803
841
  </optional>
842
+ <optional>
843
+ <attribute name="number"/>
844
+ </optional>
804
845
  <optional>
805
846
  <attribute name="obligation">
806
847
  <choice>
@@ -856,9 +897,11 @@
856
897
  <element name="code">
857
898
  <text/>
858
899
  </element>
859
- <element name="text">
860
- <text/>
861
- </element>
900
+ <optional>
901
+ <element name="text">
902
+ <text/>
903
+ </element>
904
+ </optional>
862
905
  </element>
863
906
  </define>
864
907
  <define name="standard-document">
@@ -1028,6 +1071,9 @@
1028
1071
  </choice>
1029
1072
  </attribute>
1030
1073
  </optional>
1074
+ <optional>
1075
+ <attribute name="number"/>
1076
+ </optional>
1031
1077
  <optional>
1032
1078
  <attribute name="type"/>
1033
1079
  </optional>
@@ -1081,6 +1127,9 @@
1081
1127
  <optional>
1082
1128
  <attribute name="type"/>
1083
1129
  </optional>
1130
+ <optional>
1131
+ <attribute name="number"/>
1132
+ </optional>
1084
1133
  <optional>
1085
1134
  <ref name="section-title"/>
1086
1135
  </optional>
@@ -1183,6 +1232,9 @@
1183
1232
  <optional>
1184
1233
  <attribute name="type"/>
1185
1234
  </optional>
1235
+ <optional>
1236
+ <attribute name="number"/>
1237
+ </optional>
1186
1238
  <optional>
1187
1239
  <attribute name="obligation">
1188
1240
  <choice>
@@ -1511,6 +1563,7 @@
1511
1563
  <value>add</value>
1512
1564
  <value>modify</value>
1513
1565
  <value>delete</value>
1566
+ <value>replace</value>
1514
1567
  </choice>
1515
1568
  </attribute>
1516
1569
  <optional>
@@ -1541,6 +1594,11 @@
1541
1594
  </optional>
1542
1595
  <optional>
1543
1596
  <element name="newcontent">
1597
+ <optional>
1598
+ <attribute name="id">
1599
+ <data type="ID"/>
1600
+ </attribute>
1601
+ </optional>
1544
1602
  <zeroOrMore>
1545
1603
  <ref name="BasicBlock"/>
1546
1604
  </zeroOrMore>
@@ -3,7 +3,7 @@ require "fileutils"
3
3
  module IsoDoc
4
4
  module UN
5
5
  module BaseConvert
6
- def middle_clause
6
+ def middle_clause(_docxml)
7
7
  "//clause[parent::sections]"
8
8
  end
9
9
 
@@ -230,7 +230,7 @@ body {
230
230
  margin-left: auto;
231
231
  margin-right: auto;
232
232
  max-width: 100%;
233
- font-size: 15px;
233
+ font-size: {{normalfontsize}};
234
234
  font-weight: 300;
235
235
  line-height: 1.4em;
236
236
  color: #333;
@@ -709,7 +709,7 @@ p.NormRef {
709
709
  pre,
710
710
  .pseudocode {
711
711
  background-color: #f2f2f2;
712
- font-size: 0.8em;
712
+ font-size: {{monospacefontsize}};
713
713
  line-height: 1.6em;
714
714
  padding: 1.5em;
715
715
  margin: 2em 0 1em 0;
@@ -813,7 +813,7 @@ a.footnote-number {
813
813
  vertical-align: super; }
814
814
 
815
815
  .footnote {
816
- font-size: 0.9em; }
816
+ font-size: {{footnotefontsize}}; }
817
817
 
818
818
  /*
819
819
  3.11 Blockquotes
@@ -58,7 +58,7 @@ $un-admonition-color: #47430c;
58
58
  $un-toc-active: #4d7ea5;
59
59
 
60
60
  body {
61
- @include bodyStyle1(15px, 1.4em, $un-text, #ffffff, 300);
61
+ @include bodyStyle1($normalfontsize, 1.4em, $un-text, #ffffff, 300);
62
62
  font-weight: 400;
63
63
  }
64
64
 
@@ -523,7 +523,7 @@ a.footnote-number {
523
523
  }
524
524
 
525
525
  .footnote {
526
- font-size: 0.9em;
526
+ font-size: $footnotefontsize;
527
527
  }
528
528
 
529
529
 
@@ -14,7 +14,7 @@ p.Sourcecode, li.Sourcecode, div.Sourcecode, pre.Sourcecode, pre {
14
14
  text-align: left;
15
15
  mso-pagination: widow-orphan;
16
16
  tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
17
- font-size: 10.0pt;
17
+ font-size: {{monospacefontsize}};
18
18
  font-family: {{monospacefont}};
19
19
  mso-fareast-font-family: Calibri;
20
20
  mso-bidi-font-family: "Courier New";
@@ -31,7 +31,7 @@ p.pseudocode, li.pseudocode, div.pseudocode {
31
31
  text-align: left;
32
32
  mso-pagination: widow-orphan;
33
33
  tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
34
- font-size: 10.5pt;
34
+ font-size: {{normalfontsize}};
35
35
  font-family: {{bodyfont}};
36
36
  mso-fareast-font-family: Calibri;
37
37
  mso-bidi-font-family: "Courier New";
@@ -49,7 +49,7 @@ p.Biblio, li.Biblio, div.Biblio, p.NormRef, li.NormRef, div.NormRef {
49
49
  tab-stops: 33.15pt;
50
50
  line-height: 12.0pt;
51
51
  mso-pagination: widow-orphan;
52
- font-size: 10.5pt;
52
+ font-size: {{normalfontsize}};
53
53
  font-weight: normal;
54
54
  font-family: {{bodyfont}};
55
55
  mso-fareast-font-family: {{bodyfont}};
@@ -147,10 +147,9 @@ p.Note, div.Note, li.Note, p.TableFootnote, div.TableFootnote, li.TableFootnote
147
147
  line-height: 12.0pt;
148
148
  mso-pagination: widow-orphan;
149
149
  tab-stops: 20.15pt;
150
- font-size: 10.0pt;
150
+ font-size: {{smallerfontsize}};
151
151
  mso-bidi-font-size: 11.0pt;
152
152
  font-family: {{bodyfont}};
153
- font-size: 10.0pt;
154
153
  mso-fareast-font-family: {{bodyfont}};
155
154
  mso-bidi-font-family: {{bodyfont}};
156
155
  mso-ansi-language: EN-GB; }
@@ -415,7 +414,7 @@ p.zzCopyright, li.zzCopyright {
415
414
  tab-stops: 20.15pt 25.7pt 481.15pt;
416
415
  padding: 0cm;
417
416
  mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt;
418
- font-size: 10.5pt;
417
+ font-size: {{normalfontsize}};
419
418
  font-family: {{bodyfont}};
420
419
  mso-fareast-font-family: {{bodyfont}};
421
420
  mso-bidi-font-family: {{bodyfont}};
@@ -501,7 +500,7 @@ p.Quote, li.Quote, div.Quote {
501
500
  line-height: 12.0pt;
502
501
  mso-pagination: widow-orphan;
503
502
  tab-stops: 20.15pt;
504
- font-size: 10.5pt;
503
+ font-size: {{normalfontsize}};
505
504
  font-family: {{bodyfont}};
506
505
  mso-fareast-font-family: {{bodyfont}};
507
506
  mso-bidi-font-family: {{bodyfont}};
@@ -517,7 +516,7 @@ p.QuoteAttribution {
517
516
  line-height: 12.0pt;
518
517
  mso-pagination: widow-orphan;
519
518
  tab-stops: 20.15pt;
520
- font-size: 10.5pt;
519
+ font-size: {{normalfontsize}};
521
520
  font-family: {{bodyfont}};
522
521
  mso-fareast-font-family: {{bodyfont}};
523
522
  mso-bidi-font-family: {{bodyfont}};
@@ -575,7 +574,7 @@ p.Formula, li.Formula, div.Formula {
575
574
  line-height: 12.0pt;
576
575
  mso-pagination: widow-orphan;
577
576
  tab-stops: right 487.45pt;
578
- font-size: 10.5pt;
577
+ font-size: {{normalfontsize}};
579
578
  font-family: {{bodyfont}};
580
579
  mso-fareast-font-family: {{bodyfont}};
581
580
  mso-bidi-font-family: {{bodyfont}};
@@ -698,7 +697,7 @@ table.MsoISOTable, table.MsoISOTableBig {
698
697
  mso-border-insideh: .75pt solid windowtext;
699
698
  mso-border-insidev: .75pt solid windowtext;
700
699
  margin-bottom: 12pt;
701
- font-size: 10.0pt;
700
+ font-size: {{smallerfontsize}};
702
701
  font-family: {{bodyfont}}; }
703
702
 
704
703
  table.MsoISOTable th, table.MsoISOTableBig th {
@@ -707,7 +706,7 @@ table.MsoISOTable th, table.MsoISOTableBig th {
707
706
  padding: 0cm 2.85pt 0cm 2.85pt; }
708
707
 
709
708
  table.MsoISOTable p, table.MsoISOTableBig p {
710
- font-size: 10.0pt; }
709
+ font-size: {{smallerfontsize}}; }
711
710
 
712
711
  table.MsoISOTable td, table.MsoISOTableBig td {
713
712
  border: solid windowtext 1pt;
@@ -729,7 +728,7 @@ table.MsoTableGrid {
729
728
  mso-para-margin-bottom: .0001pt;
730
729
  mso-pagination: widow-orphan;
731
730
  margin-bottom: 12pt;
732
- font-size: 10.0pt;
731
+ font-size: {{smallerfontsize}};
733
732
  font-family: {{bodyfont}}; }
734
733
 
735
734
  div.formula {
@@ -771,7 +770,7 @@ a.TableFootnoteRef, span.TableFootnoteRef {
771
770
  vertical-align: super; }
772
771
 
773
772
  aside {
774
- font-size: 10.0pt; }
773
+ font-size: {{footnotefontsize}}; }
775
774
 
776
775
  .example-title {
777
776
  font-weight: bold;
@@ -789,32 +788,32 @@ div.example {
789
788
 
790
789
  p.example, li.example, div.example, td.example {
791
790
  mso-pagination: none;
792
- font-size: 10.0pt;
791
+ font-size: {{smallerfontsize}};
793
792
  font-family: {{bodyfont}}; }
794
793
 
795
794
  td.example p.MsoListParagraph {
796
- font-size: 10.0pt; }
795
+ font-size: {{smallerfontsize}}; }
797
796
 
798
797
  div.example p.MsoListParagraph {
799
- font-size: 10.0pt; }
798
+ font-size: {{smallerfontsize}}; }
800
799
 
801
800
  div.Note p.MsoListParagraph {
802
- font-size: 10.0pt;
801
+ font-size: {{smallerfontsize}};
803
802
  margin-left: 1.0cm; }
804
803
 
805
804
  div.Note span.stem {
806
- font-size: 10.0pt; }
805
+ font-size: {{smallerfontsize}}; }
807
806
 
808
807
  div.Note p.Sourcecode, div.Note pre.Sourcecode {
809
808
  font-size: 8.0pt;
810
809
  margin-left: 1.0cm; }
811
810
 
812
811
  div.Note table.dl {
813
- font-size: 10.0pt;
812
+ font-size: {{smallerfontsize}};
814
813
  margin-left: 1.0cm; }
815
814
 
816
815
  span.note_label, span.example_label, td.example_label, td.note_label {
817
- font-size: 10.0pt;
816
+ font-size: {{smallerfontsize}};
818
817
  font-family: {{bodyfont}}; }
819
818
 
820
819
  table.dl {