pandocomatic 0.2.7.0 → 0.2.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6777ab9ccebbe75dff8b2e818b9092604517db7039035a11612f2cc93dd5ad81
4
- data.tar.gz: eae1fffb172cecd76b805cc1b59e72546a4950d2689356d36bacca0dcd67618f
3
+ metadata.gz: 18dc7f810b75440eda7e6186e30062b2912d984c1b9e5688bbf201dfc0a3ba15
4
+ data.tar.gz: 06c2f7dccc619bf274471675c3ad3cff5940edf29179a92ae10ea3b7e9a30dab
5
5
  SHA512:
6
- metadata.gz: c4b1ff0b99853e723c9f8cdda7d4340e81cf2bc649864e35544a596e4d4d8370507b6a1737e64b754cc77a31f2150759734671a336543b05af07fccb86a1831a
7
- data.tar.gz: 84320c981c1100d36ac44c575358439899e612652fc82b22e1af3154d7d11e92a23bbbb97759a609c53092898bdf06932ede70a6ae6c275a460bbdf4cc121cce
6
+ metadata.gz: 8630dd61fac6049714be13fccd69783e9d4559ea308f6ced12bac67521ea7243879ee396dfe045e22eb8cefa36a07bb5642919afc38ce588212c7bd95133c173
7
+ data.tar.gz: 1e2a6fc78ea0c8a52f88add42a8267c1153f625d00969ffca0917e3d3cd8990bce79149421070f849d3b22c92b8c7db8d2af25aa5a8aeaa0d468a9d5a3015a1d
@@ -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
@@ -64,7 +64,6 @@ module Pandocomatic
64
64
  global_templates = @config.determine_templates(@src)
65
65
 
66
66
  if global_templates.empty?
67
-
68
67
  subcommands.push ConvertFileCommand.new(@config, @src, dst)
69
68
  else
70
69
  global_templates.each do |template_name|
@@ -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? File.realpath(root) then
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
- if root.end_with? "/" or path.start_with? "/"
872
- "#{root}#{path}"
873
- else
874
- "#{root}/#{path}"
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
 
@@ -47,7 +47,7 @@ module Pandocomatic
47
47
  ERROR_STATUS = 1266 # This is the sum of the ascii values of the characters in 'pandocomatic'
48
48
 
49
49
  # Pandocomatic's current version
50
- VERSION = [0, 2, 7, 0]
50
+ VERSION = [0, 2, 7, 5]
51
51
 
52
52
  # Run pandocomatic given options
53
53
  #
@@ -42,7 +42,7 @@ module Pandocomatic
42
42
  #
43
43
  # @return [String]
44
44
  def to_s()
45
- erb = ERB.new(File.read(@template), 0, '>')
45
+ erb = ERB.new(File.read(@template), trim_mode: '>')
46
46
  erb.result(binding())
47
47
  end
48
48
 
@@ -150,7 +150,7 @@ AUTHOR
150
150
 
151
151
  LICENSE
152
152
 
153
- Copyright 2014—2019 Huub de Beer <Huub@heerdebeer.org>
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
@@ -1,6 +1,6 @@
1
1
  Pandocomatic version <%=@version.join('.')%>
2
2
 
3
- © 2014—2019 Huub de Beer <Huub@heerdebeer.org>
3
+ © 2014—2020 Huub de Beer <Huub@heerdebeer.org>
4
4
 
5
5
  Pandocomatic is free software; pandocomatic is released under the GPLv3.
6
6
 
@@ -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.0
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: 2020-05-06 00:00:00.000000000 Z
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.0
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.0
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.5'
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
- rubyforge_project:
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