metanorma 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/compile.rb +2 -3
- data/lib/metanorma/output/xslfo.rb +3 -8
- data/lib/metanorma/version.rb +1 -1
- data/metanorma.gemspec +1 -0
- metadata +16 -3
- data/bin/mn2pdf.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d31bfd040a821eb67e404cdcac72e196cd1eadcd431ea83898c61607ac3409ad
|
4
|
+
data.tar.gz: c82efc3000a7cae4121db548251396334d6be65bb466f010e862a5e19d511907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8092c7467439a4d08fa6eada3c8f5f30d0f819b87d365448749ac6aa3dd49889fcae29b6b953a1dd5c44157009f67bdcbfe6bef3d7c773eb94062ca39543d916
|
7
|
+
data.tar.gz: 6297078a3b5f891faec9ffcf62580436e6f43dc64d1df25fb96566b33d87cf8a1366d74dc32d1bdcef2704fbc80367796708743e1db76e896c7892956e6813aa
|
data/lib/metanorma/compile.rb
CHANGED
@@ -9,9 +9,9 @@ module Metanorma
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def compile(filename, options = {})
|
12
|
+
require_libraries(options)
|
12
13
|
options = options_extract(filename, options)
|
13
14
|
validate(options) or return nil
|
14
|
-
require_libraries(options)
|
15
15
|
@processor = @registry.find_processor(options[:type].to_sym)
|
16
16
|
extensions = get_extensions(options) or return nil
|
17
17
|
(file, isodoc = process_input(filename, options)) or return nil
|
@@ -32,7 +32,6 @@ module Metanorma
|
|
32
32
|
xml = Nokogiri::XML(file)
|
33
33
|
if xml.root
|
34
34
|
@registry.root_tags.each do |k, v|
|
35
|
-
STDERR.puts "k(#{k}), v(#{v})"
|
36
35
|
return { type: k } if v == xml.root.name
|
37
36
|
end
|
38
37
|
end
|
@@ -104,7 +103,7 @@ module Metanorma
|
|
104
103
|
def process_input(filename, options)
|
105
104
|
case extname = File.extname(filename)
|
106
105
|
when ".adoc"
|
107
|
-
Util.log("[metanorma] Processing:
|
106
|
+
Util.log("[metanorma] Processing: AsciiDoc input.", :info)
|
108
107
|
file = read_file(filename)
|
109
108
|
options[:asciimath] and
|
110
109
|
file.sub!(/^(=[^\n]+\n)/, "\\1:mn-keep-asciimath:\n")
|
@@ -1,5 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require "tempfile"
|
1
|
+
require 'mn2pdf'
|
3
2
|
require_relative "./utils.rb"
|
4
3
|
|
5
4
|
module Metanorma
|
@@ -7,12 +6,8 @@ module Metanorma
|
|
7
6
|
class XslfoPdf < Base
|
8
7
|
def convert(url_path, output_path, xsl_stylesheet)
|
9
8
|
return if url_path.nil? || output_path.nil? || xsl_stylesheet.nil?
|
10
|
-
|
11
|
-
|
12
|
-
url_path, "--xsl-file", xsl_stylesheet, "--pdf-file",
|
13
|
-
output_path].join(" ")
|
14
|
-
_, error_str, status = Open3.capture3(cmd)
|
15
|
-
raise error_str unless status.success?
|
9
|
+
|
10
|
+
Mn2pdf.convert(url_path, output_path, xsl_stylesheet)
|
16
11
|
end
|
17
12
|
end
|
18
13
|
end
|
data/lib/metanorma/version.rb
CHANGED
data/metanorma.gemspec
CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_runtime_dependency 'asciidoctor'
|
27
27
|
spec.add_runtime_dependency 'htmlentities'
|
28
28
|
spec.add_runtime_dependency 'nokogiri'
|
29
|
+
spec.add_runtime_dependency 'mn2pdf', "~> 1.13"
|
29
30
|
|
30
31
|
spec.add_development_dependency "rake", "~> 12.0"
|
31
32
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
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: asciidoctor
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mn2pdf
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.13'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.13'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +176,6 @@ files:
|
|
162
176
|
- Rakefile
|
163
177
|
- bin/console
|
164
178
|
- bin/metanorma-pdf.js
|
165
|
-
- bin/mn2pdf.jar
|
166
179
|
- bin/rasterize.js
|
167
180
|
- bin/rspec
|
168
181
|
- bin/setup
|
data/bin/mn2pdf.jar
DELETED
Binary file
|