pandocomatic 0.1.4.6 → 0.1.4.7
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9dde99bc773690e6b0ebb3bbdbbd84e828cb1d3
|
4
|
+
data.tar.gz: 4b03ed3fb5fa5d90bb6956d583ae9e54fef498e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9e21f62f03a0528d9a93481959b9172184aca2198ef3779d7f80e9b1e827ae4b8691fe1f5c35acf3b684d944eddbbd53cb7c9f040fae4a2319fefcad191c269
|
7
|
+
data.tar.gz: 647a7a4977665fdae9e4e763303479388608d5721695ca6bec339888b0de151c7077ca11435bc8af4f079844e272084e1c31a80f6f5a65eec563deebe64f2db2
|
@@ -101,6 +101,9 @@ module Pandocomatic
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
# Run setup scripts
|
105
|
+
setup template
|
106
|
+
|
104
107
|
# Read in the file to convert
|
105
108
|
input = File.read @src
|
106
109
|
|
@@ -132,6 +135,9 @@ module Pandocomatic
|
|
132
135
|
rescue StandardError => e
|
133
136
|
raise IOError.new(:error_writing_file, e, @dst)
|
134
137
|
end
|
138
|
+
|
139
|
+
# run cleanup scripts
|
140
|
+
cleanup template
|
135
141
|
end
|
136
142
|
|
137
143
|
# TODO: update this list
|
@@ -202,6 +208,14 @@ module Pandocomatic
|
|
202
208
|
process input, 'postprocessors', config
|
203
209
|
end
|
204
210
|
|
211
|
+
def setup(config = {})
|
212
|
+
process "", 'setup', config
|
213
|
+
end
|
214
|
+
|
215
|
+
def cleanup(config = {})
|
216
|
+
process "", 'cleanup', config
|
217
|
+
end
|
218
|
+
|
205
219
|
# Run the input string through a list of filters called processors. There
|
206
220
|
# are to types: preprocessors and postprocessors
|
207
221
|
def process(input, type, config = {})
|
@@ -98,10 +98,12 @@ module Pandocomatic
|
|
98
98
|
settings['templates'].each do |name, template|
|
99
99
|
full_template = {
|
100
100
|
'glob' => [],
|
101
|
+
'setup' => [],
|
101
102
|
'preprocessors' => [],
|
102
103
|
'metadata' => {},
|
103
104
|
'pandoc' => {},
|
104
|
-
'postprocessors' => []
|
105
|
+
'postprocessors' => [],
|
106
|
+
'cleanup' => []
|
105
107
|
}
|
106
108
|
|
107
109
|
reset_template name, full_template.merge(template)
|
@@ -114,7 +116,7 @@ module Pandocomatic
|
|
114
116
|
end
|
115
117
|
|
116
118
|
def marshal_load(array)
|
117
|
-
@data_dir, @settings, @templates, @convert_patterns
|
119
|
+
@data_dir, @settings, @templates, @convert_patterns = array
|
118
120
|
end
|
119
121
|
|
120
122
|
def to_s()
|
@@ -229,10 +231,10 @@ module Pandocomatic
|
|
229
231
|
|
230
232
|
def reset_template(name, template)
|
231
233
|
if @templates.has_key? name then
|
232
|
-
fields = ['glob', 'preprocessors', 'pandoc', 'postprocessors']
|
234
|
+
fields = ['glob', 'cleanup', 'setup', 'preprocessors', 'pandoc', 'postprocessors']
|
233
235
|
fields.each do |field|
|
234
236
|
case field
|
235
|
-
when 'preprocessors', 'postprocessors', 'glob'
|
237
|
+
when 'cleanup', 'setup', 'preprocessors', 'postprocessors', 'glob'
|
236
238
|
if @templates[name][field] then
|
237
239
|
if template[field] then
|
238
240
|
@templates[name][field].concat(template[field]).uniq!
|
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.1.4.
|
4
|
+
version: 0.1.4.7
|
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: 2017-07-
|
11
|
+
date: 2017-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paru
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
requirements:
|
154
154
|
- pandoc, a universal document converer <http://pandoc.org>
|
155
155
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.6.11
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Automating the use of pandoc
|