metanorma-mpfa 0.5.5 → 0.5.10

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: 62a96f1d5d303059e7dc8a29e7d3bd18b23b543ca007fbae6ca366a40b740bb0
4
- data.tar.gz: 6d7cb703ff990f04ebe42a6920979b56350c15319e6489ffdd7ecfa991b57a59
3
+ metadata.gz: 34aa33b015cf044867e8acdb9ed23bc2d9d4eda4a8ce72b9897d6da904e1dac3
4
+ data.tar.gz: ed7f870dc1e11a4eee461d41a594ecdc25b6d47b10c310c5222683091c31bf5d
5
5
  SHA512:
6
- metadata.gz: c2b4bdc8f4ca796605864b7ca351aab6a52536723841309841c25230378a274514245461c126ea4c967c6b7e8b066cd8c556e8ef2ca287091737f71b8763a594
7
- data.tar.gz: 94139ffd2306c52d8f8c4ac4f0f2797b51575bbc15da80eada6e4765d310f30b9dd4be9ff85a4e892aac4ec41c261df2ba1706e25cb5391d6eced04030c5efc5
6
+ metadata.gz: 27f5c653e39d1d072e2aafc064bb4f0e268c1b61a43e17b9345b011d9233e1c14a8bc9de23241c60b61d61a5957a06070c0541fa8d3b4e746600f273f9d31439
7
+ data.tar.gz: 437e85029b70c0758505167b5b6bf0aeef3c883bfc8693c0a742e775e4465fff8406f5dd886ee84571bd97fab2033ad3565e7a57b70de0c2530b4e52d54e1346
@@ -0,0 +1,62 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ include:
23
+ - ruby: '2.7'
24
+ os: 'ubuntu-latest'
25
+ experimental: true
26
+ - ruby: '2.7'
27
+ os: 'windows-latest'
28
+ experimental: true
29
+ - ruby: '2.7'
30
+ os: 'macos-latest'
31
+ experimental: true
32
+ steps:
33
+ - uses: actions/checkout@master
34
+
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+
39
+ - uses: actions/cache@v2
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
48
+
49
+ - run: bundle exec rake
50
+
51
+ tests-passed:
52
+ needs: rake
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - name: Trigger tests passed event
56
+ uses: Sibz/github-status-action@v1
57
+ with:
58
+ authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
59
+ context: 'tests-passed-successfully'
60
+ description: 'Tests passed successfully'
61
+ state: 'success'
62
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -1,21 +1,17 @@
1
1
  = Metanorma-MPFA: Metanorma processor for MPFA documents
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-mpfa.svg["Gem Version", link="https://rubygems.org/gems/metanorma-mpfa"]
4
- image:https://github.com/metanorma/metanorma-mpfa/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=macos"]
5
- image:https://github.com/metanorma/metanorma-mpfa/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=ubuntu"]
6
- image:https://github.com/metanorma/metanorma-mpfa/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=windows"]
4
+ image:https://github.com/metanorma/metanorma-mpfa/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=rake"]
7
5
  image:https://codeclimate.com/github/metanorma/metanorma-mpfa/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-mpfa"]
8
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-mpfa.svg["Pull Requests", link="https://github.com/metanorma/metanorma-mpfa/pulls"]
9
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-mpfa/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-mpfa/releases"]
10
8
 
11
- _Formerly known as_ `metanorma-mpfd`.
12
-
13
9
  WARNING: This gem is still under development. Moreover, unlike other Metanorma gems,
14
10
  there is no formal MPFA specification, and this work is still currently exploratory.
15
11
 
16
12
  == Functionality
17
13
 
18
- This gem processes http://asciidoctor.org/[Asciidoctor] documents following
14
+ This gem processes https://www.metanorma.com/[Metanorma documents] following
19
15
  a template for generating documents for the http://www.mpfa.org.hk[Mandatory Provident Fund Schemes Authority of Hong Kong].
20
16
 
21
17
  The gem currently inherits from the https://github.com/metanorma/metanorma-standoc
@@ -77,3 +73,7 @@ this general model can be found on its page.
77
73
  ////
78
74
  * Document templates are available at the https://github.com/metanorma/mn-templates-mpf[mn-templates-mpf] repository.
79
75
  /////
76
+
77
+ == Notes
78
+
79
+ Metanorma-MPFA was formerly published as `metanorma-mpfd`.
@@ -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">
@@ -56,7 +56,7 @@ module Asciidoctor
56
56
  presentation_xml_converter(node).convert(@filename + ".xml")
57
57
  html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
58
58
  doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
59
- pdf_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
59
+ pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
60
60
  end
61
61
 
62
62
  def validate(doc)
@@ -82,6 +82,7 @@ module Asciidoctor
82
82
  end
83
83
 
84
84
  def pdf_converter(node)
85
+ return if node.attr("no-pdf")
85
86
  IsoDoc::MPFA::PdfConvert.new(doc_extract_attributes(node))
86
87
  end
87
88
  end
@@ -0,0 +1,5 @@
1
+ ---
2
+ Titillium Web:
3
+ Space Mono:
4
+ Arial:
5
+ Courier New:
@@ -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,9 @@
233
253
  <data type="boolean"/>
234
254
  </attribute>
235
255
  </optional>
256
+ <optional>
257
+ <ref name="colgroup"/>
258
+ </optional>
236
259
  <optional>
237
260
  <ref name="tname"/>
238
261
  </optional>
@@ -751,6 +774,18 @@
751
774
  </define>
752
775
  </include>
753
776
  <!-- end overrides -->
777
+ <define name="colgroup">
778
+ <element name="colgroup">
779
+ <oneOrMore>
780
+ <ref name="col"/>
781
+ </oneOrMore>
782
+ </element>
783
+ </define>
784
+ <define name="col">
785
+ <element name="col">
786
+ <attribute name="width"/>
787
+ </element>
788
+ </define>
754
789
  <define name="TextElement" combine="choice">
755
790
  <ref name="concept"/>
756
791
  </define>
@@ -1164,49 +1199,7 @@
1164
1199
  </define>
1165
1200
  <define name="annex">
1166
1201
  <element name="annex">
1167
- <optional>
1168
- <attribute name="id">
1169
- <data type="ID"/>
1170
- </attribute>
1171
- </optional>
1172
- <optional>
1173
- <attribute name="language"/>
1174
- </optional>
1175
- <optional>
1176
- <attribute name="script"/>
1177
- </optional>
1178
- <optional>
1179
- <attribute name="inline-header">
1180
- <data type="boolean"/>
1181
- </attribute>
1182
- </optional>
1183
- <attribute name="obligation">
1184
- <choice>
1185
- <value>normative</value>
1186
- <value>informative</value>
1187
- </choice>
1188
- </attribute>
1189
- <optional>
1190
- <ref name="section-title"/>
1191
- </optional>
1192
- <group>
1193
- <group>
1194
- <zeroOrMore>
1195
- <ref name="BasicBlock"/>
1196
- </zeroOrMore>
1197
- <zeroOrMore>
1198
- <ref name="note"/>
1199
- </zeroOrMore>
1200
- </group>
1201
- <zeroOrMore>
1202
- <choice>
1203
- <ref name="annex-subsection"/>
1204
- <ref name="terms"/>
1205
- <ref name="definitions"/>
1206
- <ref name="references"/>
1207
- </choice>
1208
- </zeroOrMore>
1209
- </group>
1202
+ <ref name="Annex-Section"/>
1210
1203
  </element>
1211
1204
  </define>
1212
1205
  <define name="terms">
@@ -40,7 +40,7 @@ module IsoDoc
40
40
  end
41
41
  end
42
42
 
43
- def middle_clause
43
+ def middle_clause(_docxml)
44
44
  "//clause[parent::sections][not(descendant::terms)]"
45
45
  end
46
46
 
@@ -59,7 +59,7 @@ module IsoDoc
59
59
  end
60
60
 
61
61
  def clause(isoxml, out)
62
- isoxml.xpath(ns(middle_clause)).each do |c|
62
+ isoxml.xpath(ns(middle_clause(isoxml))).each do |c|
63
63
  out.div **attr_code(id: c["id"]) do |s|
64
64
  clause_name(nil, c&.at(ns("./title")), s,
65
65
  class: c["container"] ? "containerhdr" : nil )
@@ -111,6 +111,10 @@ b, strong {
111
111
  div.document-stage-band, div.document-type-band {
112
112
  background-color: #333333; }
113
113
 
114
+ a.FootnoteRef + a.FootnoteRef:before {
115
+ content: ", ";
116
+ vertical-align: super; }
117
+
114
118
  #standard-band {
115
119
  background-color: #0AC442; }
116
120
 
@@ -220,7 +224,7 @@ body {
220
224
  margin-left: auto;
221
225
  margin-right: auto;
222
226
  max-width: 100%;
223
- font-size: 15px;
227
+ font-size: {{normalfontsize}};
224
228
  font-weight: 300;
225
229
  line-height: 1.4em;
226
230
  color: #301907;
@@ -683,7 +687,7 @@ p.Biblio, p.NormRef {
683
687
  pre,
684
688
  .pseudocode {
685
689
  background-color: #f7f7f7;
686
- font-size: 0.8em;
690
+ font-size: {{monospacefontsize}};
687
691
  line-height: 1.6em;
688
692
  padding: 1.5em;
689
693
  margin: 2em 0 1em 0;
@@ -789,7 +793,7 @@ a.footnote-number {
789
793
  font-size: 0.8em; }
790
794
 
791
795
  .footnote {
792
- font-size: 0.9em; }
796
+ font-size: {{footnotefontsize}}; }
793
797
 
794
798
  /*
795
799
  3.11 Blockquotes
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
  body {
17
- @include bodyStyle1(15px, 1.4em, #301907, #f7f7f7, 300);
17
+ @include bodyStyle1($normalfontsize, 1.4em, #301907, #f7f7f7, 300);
18
18
  // @include sidebarNavContainer(323px);
19
19
  main {
20
20
  margin: 0 0 0 6em;
@@ -446,7 +446,7 @@ a.footnote-number {
446
446
  }
447
447
 
448
448
  .footnote {
449
- font-size: 0.9em;
449
+ font-size: $footnotefontsize;
450
450
  }
451
451
 
452
452
 
@@ -9,7 +9,7 @@ p.Sourcecode, li.Sourcecode, div.Sourcecode, pre.Sourcecode, pre {
9
9
  text-align: left;
10
10
  mso-pagination: widow-orphan;
11
11
  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;
12
- font-size: 10.0pt;
12
+ font-size: {{monospacefontsize}};
13
13
  font-family: {{monospacefont}};
14
14
  mso-fareast-font-family: Calibri;
15
15
  mso-bidi-font-family: "Courier New";
@@ -26,7 +26,7 @@ p.pseudocode, li.pseudocode, div.pseudocode {
26
26
  text-align: left;
27
27
  mso-pagination: widow-orphan;
28
28
  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;
29
- font-size: 10.5pt;
29
+ font-size: {{normalfontsize}};
30
30
  font-family: {{bodyfont}};
31
31
  mso-fareast-font-family: Calibri;
32
32
  mso-bidi-font-family: "Courier New";
@@ -44,7 +44,7 @@ p.Biblio, li.Biblio, div.Biblio, p.NormRef, li.NormRef, div.NormRef {
44
44
  tab-stops: 33.15pt;
45
45
  line-height: 12.0pt;
46
46
  mso-pagination: widow-orphan;
47
- font-size: 10.5pt;
47
+ font-size: {{normalfontsize}};
48
48
  font-weight: normal;
49
49
  font-family: {{bodyfont}};
50
50
  mso-fareast-font-family: {{bodyfont}};
@@ -142,10 +142,9 @@ p.Note, div.Note, li.Note, p.TableFootnote, div.TableFootnote, li.TableFootnote
142
142
  line-height: 12.0pt;
143
143
  mso-pagination: widow-orphan;
144
144
  tab-stops: 20.15pt;
145
- font-size: 10.0pt;
145
+ font-size: {{smallerfontsize}};
146
146
  mso-bidi-font-size: 11.0pt;
147
147
  font-family: {{bodyfont}};
148
- font-size: 10.0pt;
149
148
  mso-fareast-font-family: {{bodyfont}};
150
149
  mso-bidi-font-family: {{bodyfont}};
151
150
  mso-ansi-language: EN-GB; }
@@ -410,7 +409,7 @@ p.zzCopyright, li.zzCopyright {
410
409
  tab-stops: 20.15pt 25.7pt 481.15pt;
411
410
  padding: 0cm;
412
411
  mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt;
413
- font-size: 10.5pt;
412
+ font-size: {{normalfontsize}};
414
413
  font-family: {{bodyfont}};
415
414
  mso-fareast-font-family: {{bodyfont}};
416
415
  mso-bidi-font-family: {{bodyfont}};
@@ -496,7 +495,7 @@ p.Quote, li.Quote, div.Quote {
496
495
  line-height: 12.0pt;
497
496
  mso-pagination: widow-orphan;
498
497
  tab-stops: 20.15pt;
499
- font-size: 10.5pt;
498
+ font-size: {{normalfontsize}};
500
499
  font-family: {{bodyfont}};
501
500
  mso-fareast-font-family: {{bodyfont}};
502
501
  mso-bidi-font-family: {{bodyfont}};
@@ -512,7 +511,7 @@ p.QuoteAttribution {
512
511
  line-height: 12.0pt;
513
512
  mso-pagination: widow-orphan;
514
513
  tab-stops: 20.15pt;
515
- font-size: 10.5pt;
514
+ font-size: {{normalfontsize}};
516
515
  font-family: {{bodyfont}};
517
516
  mso-fareast-font-family: {{bodyfont}};
518
517
  mso-bidi-font-family: {{bodyfont}};
@@ -574,7 +573,7 @@ p.Formula, li.Formula, div.Formula {
574
573
  line-height: 12.0pt;
575
574
  mso-pagination: widow-orphan;
576
575
  tab-stops: right 487.45pt;
577
- font-size: 10.5pt;
576
+ font-size: {{normalfontsize}};
578
577
  font-family: {{bodyfont}};
579
578
  mso-fareast-font-family: {{bodyfont}};
580
579
  mso-bidi-font-family: {{bodyfont}};
@@ -688,7 +687,7 @@ table.MsoISOTable, table.MsoISOTableBig {
688
687
  mso-yfti-tbllook: 480;
689
688
  mso-border-insideh: .75pt solid windowtext;
690
689
  mso-border-insidev: .75pt solid windowtext;
691
- font-size: 10.0pt;
690
+ font-size: {{smallerfontsize}};
692
691
  font-family: {{bodyfont}}; }
693
692
 
694
693
  table.MsoISOTable th, table.MsoISOTableBig th {
@@ -702,7 +701,7 @@ table.MsoISOTable td, table.MsoISOTableBig td {
702
701
  padding: 0cm 2.85pt 0cm 2.85pt; }
703
702
 
704
703
  table.MsoISOTable p, table.MsoISOTableBig p {
705
- font-size: 10.0pt; }
704
+ font-size: {{smallerfontsize}}; }
706
705
 
707
706
  table.MsoTableGrid {
708
707
  mso-style-name: "Table Grid";
@@ -718,7 +717,7 @@ table.MsoTableGrid {
718
717
  mso-para-margin: 0cm;
719
718
  mso-para-margin-bottom: .0001pt;
720
719
  mso-pagination: widow-orphan;
721
- font-size: 10.0pt;
720
+ font-size: {{smallerfontsize}};
722
721
  font-family: {{bodyfont}}; }
723
722
 
724
723
  div.formula {
@@ -760,7 +759,7 @@ a.TableFootnoteRef, span.TableFootnoteRef {
760
759
  vertical-align: super; }
761
760
 
762
761
  aside {
763
- font-size: 10.0pt; }
762
+ font-size: {{footnotefontsize}}; }
764
763
 
765
764
  .example-title {
766
765
  font-weight: bold;
@@ -778,32 +777,32 @@ div.example {
778
777
 
779
778
  p.example, li.example, div.example, td.example {
780
779
  mso-pagination: none;
781
- font-size: 10.0pt;
780
+ font-size: {{smallerfontsize}};
782
781
  font-family: {{bodyfont}}; }
783
782
 
784
783
  td.example p.MsoListParagraph {
785
- font-size: 10.0pt; }
784
+ font-size: {{smallerfontsize}}; }
786
785
 
787
786
  div.example p.MsoListParagraph {
788
- font-size: 10.0pt; }
787
+ font-size: {{smallerfontsize}}; }
789
788
 
790
789
  div.Note p.MsoListParagraph {
791
- font-size: 10.0pt;
790
+ font-size: {{smallerfontsize}};
792
791
  margin-left: 1.0cm; }
793
792
 
794
793
  div.Note span.stem {
795
- font-size: 10.0pt; }
794
+ font-size: {{smallerfontsize}}; }
796
795
 
797
796
  div.Note p.Sourcecode, div.Note pre.Sourcecode {
798
797
  font-size: 8.0pt;
799
798
  margin-left: 1.0cm; }
800
799
 
801
800
  div.Note table.dl {
802
- font-size: 10.0pt;
801
+ font-size: {{smallerfontsize}};
803
802
  margin-left: 1.0cm; }
804
803
 
805
804
  span.note_label, span.example_label, td.example_label, td.note_label {
806
- font-size: 10.0pt;
805
+ font-size: {{smallerfontsize}};
807
806
  font-family: {{bodyfont}}; }
808
807
 
809
808
  table.dl {