metanorma-mpfd 0.3.18 → 0.3.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +0 -7
- data/.github/workflows/ubuntu.yml +2 -11
- data/.github/workflows/windows.yml +0 -7
- data/lib/asciidoctor/mpfd/converter.rb +0 -5
- data/lib/asciidoctor/mpfd/isodoc.rng +6 -3
- data/lib/isodoc/mpfd/base_convert.rb +4 -0
- data/lib/metanorma-mpfd.rb +0 -1
- data/lib/metanorma/mpfd/processor.rb +1 -4
- data/lib/metanorma/mpfd/version.rb +1 -1
- metadata +2 -3
- data/lib/isodoc/mpfd/pdf_convert.rb +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca2562bc6c3b269e4bb9f055c588b7be139ca9cb6c974d066ef5b4d9ee50b3f5
|
4
|
+
data.tar.gz: d698a6d0691d5f8abf6865a946985248d5838047d4b6d6c4cd846d83460d6d64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef482901e312f0ecf7839ef8e6d3f365fe49fc2347d11d134f626fb800ef9ce495d4ee2a9473e957cf16be265143c432a8b6ed17c94d673b2ac3168bd3d5c6b
|
7
|
+
data.tar.gz: b98ae184d3304ff2c6124d67d3ca7f140d18b3501c8f9dc093e62011b6f729434583e860a666cb44cda7dca62674f90662f011b98ac6a89395833d0f68b1aa1a
|
data/.github/workflows/macos.yml
CHANGED
@@ -26,13 +26,6 @@ jobs:
|
|
26
26
|
run: |
|
27
27
|
sudo gem install bundler --force
|
28
28
|
bundle install --jobs 4 --retry 3
|
29
|
-
- name: Use Node
|
30
|
-
uses: actions/setup-node@v1
|
31
|
-
with:
|
32
|
-
node-version: '12'
|
33
|
-
- name: Install Puppeteer
|
34
|
-
run: |
|
35
|
-
npm install -g puppeteer@3.0.1
|
36
29
|
- name: Run specs
|
37
30
|
run: |
|
38
31
|
bundle exec rake
|
@@ -26,20 +26,11 @@ jobs:
|
|
26
26
|
run: |
|
27
27
|
gem install bundler
|
28
28
|
bundle install --jobs 4 --retry 3
|
29
|
-
- name: Use Node
|
30
|
-
uses: actions/setup-node@v1
|
31
|
-
with:
|
32
|
-
node-version: '12'
|
33
|
-
- name: Install Puppeteer
|
34
|
-
run: |
|
35
|
-
sudo apt-get update
|
36
|
-
sudo apt-get install libgbm1
|
37
|
-
npm install -g puppeteer@3.0.1
|
38
29
|
- name: Run specs
|
39
30
|
run: |
|
40
31
|
bundle exec rake
|
41
32
|
- name: Trigger dependent repositories
|
42
|
-
if: github.ref == 'refs/heads/master'
|
33
|
+
if: github.ref == 'refs/heads/master' && matrix.ruby == '2.6'
|
43
34
|
env:
|
44
35
|
GH_USERNAME: ${{ secrets.PAT_USERNAME }}
|
45
36
|
GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
|
@@ -48,5 +39,5 @@ jobs:
|
|
48
39
|
[[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
|
49
40
|
for repo in $DEPENDENT_REPOS
|
50
41
|
do
|
51
|
-
sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY
|
42
|
+
sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
|
52
43
|
done
|
@@ -28,13 +28,6 @@ jobs:
|
|
28
28
|
gem install bundler
|
29
29
|
bundle config --local path vendor/bundle
|
30
30
|
bundle install --jobs 4 --retry 3
|
31
|
-
- name: Use Node
|
32
|
-
uses: actions/setup-node@v1
|
33
|
-
with:
|
34
|
-
node-version: '12'
|
35
|
-
- name: Install Puppeteer
|
36
|
-
run: |
|
37
|
-
npm install -g puppeteer@3.0.1
|
38
31
|
- name: Run specs
|
39
32
|
run: |
|
40
33
|
bundle exec rake
|
@@ -90,7 +90,6 @@ module Asciidoctor
|
|
90
90
|
File.open(filename, "w") { |f| f.write(ret) }
|
91
91
|
html_converter(node).convert filename unless node.attr("nodoc")
|
92
92
|
word_converter(node).convert filename unless node.attr("nodoc")
|
93
|
-
pdf_converter(node).convert filename unless node.attr("nodoc")
|
94
93
|
end
|
95
94
|
@log.write(@localdir + @filename + ".err") unless @novalid
|
96
95
|
@files_to_delete.each { |f| FileUtils.rm f }
|
@@ -111,10 +110,6 @@ module Asciidoctor
|
|
111
110
|
IsoDoc::Mpfd::HtmlConvert.new(html_extract_attributes(node))
|
112
111
|
end
|
113
112
|
|
114
|
-
def pdf_converter(node)
|
115
|
-
IsoDoc::Mpfd::PdfConvert.new(html_extract_attributes(node))
|
116
|
-
end
|
117
|
-
|
118
113
|
def word_converter(node)
|
119
114
|
IsoDoc::Mpfd::WordConvert.new(doc_extract_attributes(node))
|
120
115
|
end
|
@@ -129,6 +129,9 @@
|
|
129
129
|
</choice>
|
130
130
|
</attribute>
|
131
131
|
</optional>
|
132
|
+
<attribute name="normative">
|
133
|
+
<data type="boolean"/>
|
134
|
+
</attribute>
|
132
135
|
<optional>
|
133
136
|
<ref name="section-title"/>
|
134
137
|
</optional>
|
@@ -303,11 +306,11 @@
|
|
303
306
|
<ref name="paragraph"/>
|
304
307
|
</element>
|
305
308
|
</define>
|
306
|
-
<define name="TextElement" combine="choice">
|
307
|
-
<ref name="concept"/>
|
308
|
-
</define>
|
309
309
|
</include>
|
310
310
|
<!-- end overrides -->
|
311
|
+
<define name="TextElement" combine="choice">
|
312
|
+
<ref name="concept"/>
|
313
|
+
</define>
|
311
314
|
<define name="concept">
|
312
315
|
<element name="concept">
|
313
316
|
<optional>
|
@@ -162,11 +162,15 @@ module IsoDoc
|
|
162
162
|
def annex_names(clause, num)
|
163
163
|
@anchors[clause["id"]] = { label: annex_name_lbl(clause, num),
|
164
164
|
xref: "#{@annex_lbl} #{num}", level: 1 }
|
165
|
+
if a = single_annex_special_section(clause)
|
166
|
+
annex_names1(a, "#{num}", 1)
|
167
|
+
else
|
165
168
|
i = 0
|
166
169
|
clause.xpath(ns("./clause | ./references")).each do |c|
|
167
170
|
container_names(c, 0)
|
168
171
|
i = annex_naming(c, num, 1, i)
|
169
172
|
end
|
173
|
+
end
|
170
174
|
hierarchical_asset_names(clause, num)
|
171
175
|
end
|
172
176
|
|
data/lib/metanorma-mpfd.rb
CHANGED
@@ -2,7 +2,6 @@ require "asciidoctor" unless defined? Asciidoctor::Converter
|
|
2
2
|
require_relative "asciidoctor/mpfd/converter"
|
3
3
|
require_relative "isodoc/mpfd/html_convert"
|
4
4
|
require_relative "isodoc/mpfd/word_convert"
|
5
|
-
require_relative "isodoc/mpfd/pdf_convert"
|
6
5
|
require_relative "metanorma/mpfd/version"
|
7
6
|
|
8
7
|
if defined? Metanorma
|
@@ -13,8 +13,7 @@ module Metanorma
|
|
13
13
|
def output_formats
|
14
14
|
super.merge(
|
15
15
|
html: "html",
|
16
|
-
doc: "doc"
|
17
|
-
pdf: "pdf"
|
16
|
+
doc: "doc"
|
18
17
|
)
|
19
18
|
end
|
20
19
|
|
@@ -32,8 +31,6 @@ module Metanorma
|
|
32
31
|
IsoDoc::Mpfd::HtmlConvert.new(options).convert(outname, isodoc_node)
|
33
32
|
when :doc
|
34
33
|
IsoDoc::Mpfd::WordConvert.new(options).convert(outname, isodoc_node)
|
35
|
-
when :pdf
|
36
|
-
IsoDoc::Mpfd::PdfConvert.new(options).convert(outname, isodoc_node)
|
37
34
|
else
|
38
35
|
super
|
39
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-mpfd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.19
|
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-05-
|
11
|
+
date: 2020-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -245,7 +245,6 @@ files:
|
|
245
245
|
- lib/isodoc/mpfd/i18n-en.yaml
|
246
246
|
- lib/isodoc/mpfd/i18n-zh-Hans.yaml
|
247
247
|
- lib/isodoc/mpfd/metadata.rb
|
248
|
-
- lib/isodoc/mpfd/pdf_convert.rb
|
249
248
|
- lib/isodoc/mpfd/word_convert.rb
|
250
249
|
- lib/metanorma-mpfd.rb
|
251
250
|
- lib/metanorma/mpfd.rb
|
@@ -1,65 +0,0 @@
|
|
1
|
-
require_relative "base_convert"
|
2
|
-
require "isodoc"
|
3
|
-
|
4
|
-
module IsoDoc
|
5
|
-
module Mpfd
|
6
|
-
# A {Converter} implementation that generates PDF HTML output, and a
|
7
|
-
# document schema encapsulation of the document for validation
|
8
|
-
class PdfConvert < IsoDoc::PdfConvert
|
9
|
-
def initialize(options)
|
10
|
-
@libdir = File.dirname(__FILE__)
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
|
-
include BaseConvert
|
15
|
-
|
16
|
-
def default_fonts(options)
|
17
|
-
{
|
18
|
-
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Titillium Web",sans-serif'),
|
19
|
-
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Titillium Web",sans-serif'),
|
20
|
-
monospacefont: '"Space Mono",monospace'
|
21
|
-
}
|
22
|
-
end
|
23
|
-
|
24
|
-
def default_file_locations(_options)
|
25
|
-
{
|
26
|
-
htmlstylesheet: html_doc_path("htmlstyle.scss"),
|
27
|
-
htmlcoverpage: html_doc_path("html_rsd_titlepage.html"),
|
28
|
-
htmlintropage: html_doc_path("html_rsd_intro.html"),
|
29
|
-
scripts_pdf: html_doc_path("scripts.pdf.html"),
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
def googlefonts()
|
34
|
-
<<~HEAD.freeze
|
35
|
-
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
|
36
|
-
<link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
|
37
|
-
<link href="https://fonts.googleapis.com/css?family=Titillium+Web:400,400i,700,700i" rel="stylesheet">
|
38
|
-
HEAD
|
39
|
-
end
|
40
|
-
|
41
|
-
def make_body(xml, docxml)
|
42
|
-
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
|
43
|
-
xml.body **body_attr do |body|
|
44
|
-
make_body1(body, docxml)
|
45
|
-
make_body2(body, docxml)
|
46
|
-
make_body3(body, docxml)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def html_toc(docxml)
|
51
|
-
docxml
|
52
|
-
end
|
53
|
-
|
54
|
-
def make_body3(body, docxml)
|
55
|
-
body.div **{ class: "main-section" } do |div3|
|
56
|
-
preface docxml, div3
|
57
|
-
middle docxml, div3
|
58
|
-
footnotes div3
|
59
|
-
comments div3
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|