metanorma-mpfa 0.5.2 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ require_relative "base_convert"
2
+ require "isodoc"
3
+
4
+ module IsoDoc
5
+ module MPFA
6
+ # A {Converter} implementation that generates PDF HTML output, and a
7
+ # document schema encapsulation of the document for validation
8
+ class PdfConvert < IsoDoc::XslfoPdfConvert
9
+ def initialize(options)
10
+ @libdir = File.dirname(__FILE__)
11
+ super
12
+ end
13
+
14
+ def pdf_stylesheet(docxml)
15
+ doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
16
+ doctype = "standards" unless %w(circular guidelines
17
+ compliance-standards-for-mpf-trustees
18
+ supervision-of-mpf-intermediaries).include? doctype
19
+ "mpfd.#{doctype}.xsl"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -12,6 +12,15 @@ module IsoDoc
12
12
  prefix_name(f, " ", lbl, "title")
13
13
  end
14
14
 
15
+ def clause1(f)
16
+ lbl = @xrefs.anchor(f['id'], :label, f.parent.name != "sections")
17
+ if lbl == "1" and !f.at(ns("./title"))
18
+ prefix_name(f, "<tab/>", " ", "title")
19
+ else
20
+ super
21
+ end
22
+ end
23
+
15
24
  include Init
16
25
  end
17
26
  end
@@ -75,8 +75,8 @@ module IsoDoc
75
75
  end
76
76
 
77
77
  def annex_names(clause, num)
78
- @anchors[clause["id"]] = { label: annex_name_lbl(clause, num),
79
- xref: "#{@labels['annex']} #{num}", level: 1 }
78
+ @anchors[clause["id"]] = { label: annex_name_lbl(clause, num), value: num,
79
+ xref: l10n("#{@labels['annex']} #{num}"), level: 1 }
80
80
  if a = single_annex_special_section(clause)
81
81
  annex_names1(a, "#{num}", 1)
82
82
  else
@@ -91,7 +91,7 @@ module IsoDoc
91
91
 
92
92
  def annex_names1(clause, num, level)
93
93
  clause["container"] or @anchors[clause["id"]] =
94
- { label: num, xref: "#{@labels['annex']} #{num}", level: level }
94
+ { label: num, xref: l10n("#{@labels['annex']} #{num}"), level: level }
95
95
  i = 0
96
96
  clause.xpath(ns("./clause | ./references")).each do |c|
97
97
  i = annex_naming(c, num, level, i)
@@ -1,6 +1,7 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "asciidoctor/mpfa/converter"
3
3
  require_relative "isodoc/mpfa/html_convert"
4
+ require_relative "isodoc/mpfa/pdf_convert"
4
5
  require_relative "isodoc/mpfa/word_convert"
5
6
  require_relative "isodoc/mpfa/presentation_xml_convert"
6
7
  require_relative "metanorma/mpfa/version"
@@ -20,7 +20,8 @@ module Metanorma
20
20
  def output_formats
21
21
  super.merge(
22
22
  html: "html",
23
- doc: "doc"
23
+ doc: "doc",
24
+ pdf: "pdf"
24
25
  )
25
26
  end
26
27
 
@@ -34,6 +35,8 @@ module Metanorma
34
35
  IsoDoc::MPFA::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
35
36
  when :doc
36
37
  IsoDoc::MPFA::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
38
+ when :pdf
39
+ IsoDoc::MPFA::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
37
40
  when :presentation
38
41
  IsoDoc::MPFA::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
39
42
  else
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module MPFA
3
- VERSION = "0.5.2"
3
+ VERSION = "0.5.7"
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
31
  spec.add_dependency "htmlentities", "~> 4.3.4"
32
- spec.add_dependency "metanorma-standoc", "~> 1.5.0"
32
+ spec.add_dependency "metanorma-standoc", "~> 1.6.0"
33
33
  spec.add_dependency "isodoc", "~> 1.2.0"
34
34
  spec.add_dependency "twitter_cldr"
35
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-mpfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-27 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.0
33
+ version: 1.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.5.0
40
+ version: 1.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: isodoc
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -218,9 +218,7 @@ executables: []
218
218
  extensions: []
219
219
  extra_rdoc_files: []
220
220
  files:
221
- - ".github/workflows/macos.yml"
222
- - ".github/workflows/ubuntu.yml"
223
- - ".github/workflows/windows.yml"
221
+ - ".github/workflows/rake.yml"
224
222
  - ".gitignore"
225
223
  - ".hound.yml"
226
224
  - ".rubocop.yml"
@@ -265,6 +263,12 @@ files:
265
263
  - lib/isodoc/mpfa/i18n.rb
266
264
  - lib/isodoc/mpfa/init.rb
267
265
  - lib/isodoc/mpfa/metadata.rb
266
+ - lib/isodoc/mpfa/mpfd.circular.xsl
267
+ - lib/isodoc/mpfa/mpfd.compliance-standards-for-mpf-trustees.xsl
268
+ - lib/isodoc/mpfa/mpfd.guidelines.xsl
269
+ - lib/isodoc/mpfa/mpfd.standards.xsl
270
+ - lib/isodoc/mpfa/mpfd.supervision-of-mpf-intermediaries.xsl
271
+ - lib/isodoc/mpfa/pdf_convert.rb
268
272
  - lib/isodoc/mpfa/presentation_xml_convert.rb
269
273
  - lib/isodoc/mpfa/word_convert.rb
270
274
  - lib/isodoc/mpfa/xref.rb
@@ -1,38 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: macos
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- paths-ignore:
10
- - .github/workflows/ubuntu.yml
11
- - .github/workflows/windows.yml
12
-
13
- jobs:
14
- test-macos:
15
- name: Test on Ruby ${{ matrix.ruby }} macOS
16
- runs-on: macos-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- - name: Update gems
33
- run: |
34
- sudo gem install bundler --force
35
- bundle install --jobs 4 --retry 3
36
- - name: Run specs
37
- run: |
38
- bundle exec rake
@@ -1,56 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: ubuntu
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- tags:
9
- - '*'
10
- pull_request:
11
- paths-ignore:
12
- - .github/workflows/macos.yml
13
- - .github/workflows/windows.yml
14
-
15
- jobs:
16
- test-linux:
17
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
18
- runs-on: ubuntu-latest
19
- continue-on-error: ${{ matrix.experimental }}
20
- strategy:
21
- fail-fast: false
22
- matrix:
23
- ruby: [ '2.6', '2.5', '2.4' ]
24
- experimental: [false]
25
- include:
26
- - ruby: '2.7'
27
- experimental: true
28
- steps:
29
- - uses: actions/checkout@master
30
- - name: Use Ruby
31
- uses: actions/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- - name: Update gems
35
- run: |
36
- gem install bundler
37
- bundle install --jobs 4 --retry 3
38
- - name: Run specs
39
- run: |
40
- bundle exec rake
41
- - name: Trigger repositories
42
- if: matrix.ruby == '2.6'
43
- env:
44
- GH_USERNAME: metanorma-ci
45
- GH_ACCESS_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
46
- run: |
47
- curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
48
- [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
49
- CLIENT_PAYLOAD=$(cat <<EOF
50
- "{ "ref": "${GITHUB_REF}", "repo": "${GITHUB_REPOSITORY}" }"
51
- EOF
52
- )
53
- for repo in $REPOS
54
- do
55
- sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "$CLIENT_PAYLOAD"
56
- done
@@ -1,40 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: windows
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- paths-ignore:
10
- - .github/workflows/macos.yml
11
- - .github/workflows/ubuntu.yml
12
-
13
- jobs:
14
- test-windows:
15
- name: Test on Ruby ${{ matrix.ruby }} Windows
16
- runs-on: windows-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- - name: Update gems
33
- shell: pwsh
34
- run: |
35
- gem install bundler
36
- bundle config --local path vendor/bundle
37
- bundle install --jobs 4 --retry 3
38
- - name: Run specs
39
- run: |
40
- bundle exec rake