pandocomatic 0.2.7.0 → 0.2.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pandocomatic/cli.rb +2 -1
- data/lib/pandocomatic/command/convert_file_command.rb +1 -1
- data/lib/pandocomatic/command/convert_file_multiple_command.rb +0 -1
- data/lib/pandocomatic/configuration.rb +9 -7
- data/lib/pandocomatic/pandocomatic.rb +1 -1
- data/lib/pandocomatic/printer/printer.rb +1 -1
- data/lib/pandocomatic/printer/views/help.txt +1 -1
- data/lib/pandocomatic/printer/views/version.txt +1 -1
- data/lib/pandocomatic/processors/fileinfo_preprocessor.rb +2 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18dc7f810b75440eda7e6186e30062b2912d984c1b9e5688bbf201dfc0a3ba15
|
4
|
+
data.tar.gz: 06c2f7dccc619bf274471675c3ad3cff5940edf29179a92ae10ea3b7e9a30dab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8630dd61fac6049714be13fccd69783e9d4559ea308f6ced12bac67521ea7243879ee396dfe045e22eb8cefa36a07bb5642919afc38ce588212c7bd95133c173
|
7
|
+
data.tar.gz: 1e2a6fc78ea0c8a52f88add42a8267c1153f625d00969ffca0917e3d3cd8990bce79149421070f849d3b22c92b8c7db8d2af25aa5a8aeaa0d468a9d5a3015a1d
|
data/lib/pandocomatic/cli.rb
CHANGED
@@ -125,8 +125,9 @@ module Pandocomatic
|
|
125
125
|
raise CLIError.new(:no_output_given) if not multiple_inputs and File.directory? input.first
|
126
126
|
end
|
127
127
|
|
128
|
+
# No check for root_path: a user can supply one that does not exists
|
129
|
+
# at this location and still work on the output location.
|
128
130
|
if options[:root_path_given]
|
129
|
-
options[:root_path] = File.absolute_path options[:root_path]
|
130
131
|
end
|
131
132
|
|
132
133
|
# Data dir, if specified, should be an existing and readable directory
|
@@ -126,7 +126,7 @@ module Pandocomatic
|
|
126
126
|
# Run the default preprocessors to mix-in information about the file
|
127
127
|
# that is being converted and mix-in the template's metadata section as
|
128
128
|
# well
|
129
|
-
input = FileInfoPreprocessor.run input, @src, pandoc_options
|
129
|
+
input = FileInfoPreprocessor.run input, @src, src_root, pandoc_options
|
130
130
|
input = MetadataPreprocessor.run input, template['metadata'] if template.has_key? 'metadata' and not template['metadata'].empty?
|
131
131
|
|
132
132
|
# Convert the file by preprocessing it, run pandoc on it, and
|
@@ -55,7 +55,9 @@ module Pandocomatic
|
|
55
55
|
'slideous' => 'html',
|
56
56
|
'dzslides' => 'html',
|
57
57
|
'revealjs' => 'html',
|
58
|
-
's5' => 'html'
|
58
|
+
's5' => 'html',
|
59
|
+
'bibtex' => 'bib',
|
60
|
+
'biblatex' => 'bib'
|
59
61
|
}
|
60
62
|
|
61
63
|
# Indicator for paths that should be treated as "relative to the root
|
@@ -301,6 +303,7 @@ module Pandocomatic
|
|
301
303
|
# If a temporary file has been created while concatenating
|
302
304
|
# multiple input files, ensure it is removed.
|
303
305
|
if @input.is_a? MultipleFilesInput then
|
306
|
+
warn "CLEAN UP"
|
304
307
|
@input.destroy!
|
305
308
|
end
|
306
309
|
end
|
@@ -851,7 +854,7 @@ module Pandocomatic
|
|
851
854
|
|
852
855
|
path.delete_prefix! ROOT_PATH_INDICATOR if is_root_relative_path? path
|
853
856
|
|
854
|
-
if File.realpath("#{dst_dir}").start_with?
|
857
|
+
if File.exist? root and File.realpath("#{dst_dir}").start_with?(File.realpath(root)) then
|
855
858
|
rel_start = ""
|
856
859
|
|
857
860
|
until File.identical?(File.realpath("#{dst_dir}/#{rel_start}"), File.realpath(root)) do
|
@@ -868,11 +871,10 @@ module Pandocomatic
|
|
868
871
|
# Because the destination is not in a subdirectory of root, a
|
869
872
|
# relative path to that root cannot be created. Instead,
|
870
873
|
# the path is assumed to be absolute relative to root
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
end
|
874
|
+
root = root.delete_suffix "/" if root.end_with? "/"
|
875
|
+
path = path.delete_prefix "/" if path.start_with? "/"
|
876
|
+
|
877
|
+
"#{root}/#{path}"
|
876
878
|
end
|
877
879
|
|
878
880
|
|
@@ -150,7 +150,7 @@ AUTHOR
|
|
150
150
|
|
151
151
|
LICENSE
|
152
152
|
|
153
|
-
Copyright 2014—
|
153
|
+
Copyright 2014—2020 Huub de Beer <huub@heerdebeer.org>
|
154
154
|
|
155
155
|
Pandocomatic is free software: you can redistribute it and/or modify
|
156
156
|
it under the terms of the GNU General Public License as published by the
|
@@ -31,7 +31,7 @@ module Pandocomatic
|
|
31
31
|
# @param path [String] the path to the input document
|
32
32
|
# @param options [Hash] pandoc options collected by pandocomatic to run on
|
33
33
|
# this file
|
34
|
-
def self.run input, path, options
|
34
|
+
def self.run input, path, src_path, options
|
35
35
|
created_at = File.stat(path).ctime
|
36
36
|
modified_at = File.stat(path).mtime
|
37
37
|
output = input
|
@@ -41,6 +41,7 @@ module Pandocomatic
|
|
41
41
|
output << " to: #{options['to']}\n" if options.has_key? 'to'
|
42
42
|
output << " template: #{options['template']}\n" if options.has_key? 'template'
|
43
43
|
output << " path: '#{path}'\n"
|
44
|
+
output << " src_path: '#{src_path}'\n"
|
44
45
|
output << " created: #{created_at.strftime '%Y-%m-%d'}\n"
|
45
46
|
output << " modified: #{modified_at.strftime '%Y-%m-%d'}\n"
|
46
47
|
output << "...\n\n"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pandocomatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.7.
|
4
|
+
version: 0.2.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huub de Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paru
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.4'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.4.
|
22
|
+
version: 0.4.2.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.4'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.4.
|
32
|
+
version: 0.4.2.1
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: optimist
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,7 +147,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
147
|
requirements:
|
148
148
|
- - ">="
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
version: '2.
|
150
|
+
version: '2.6'
|
151
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
152
|
requirements:
|
153
153
|
- - ">="
|
@@ -155,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
requirements:
|
157
157
|
- pandoc, a universal document converter
|
158
|
-
|
159
|
-
rubygems_version: 2.7.7
|
158
|
+
rubygems_version: 3.2.3
|
160
159
|
signing_key:
|
161
160
|
specification_version: 4
|
162
161
|
summary: Automate the use of pandoc
|