themedoc 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +39 -33
- data/bin/themedoc +9 -3
- data/themedoc.gemspec +1 -1
- metadata +17 -7
data/README.md
CHANGED
@@ -1,37 +1,9 @@
|
|
1
|
-
|
2
|
-
% theming pandoc
|
1
|
+
# About
|
3
2
|
|
4
|
-
|
3
|
+
Themedoc adds theming to the fabulous [pandoc](http://johnmacfarlane.net/pandoc/index.html) document converter.
|
4
|
+
Themes are represented as yaml files that live in the ~/.themedoc folder and can also be bundled with resources such as images,
|
5
|
+
javascripts or css-files.
|
5
6
|
|
6
|
-
## Open
|
7
|
-
|
8
|
-
* Should see why it doesn't run rb 1.8
|
9
|
-
* Needs mostly testing
|
10
|
-
* Perhaps we need to push some stuff to separate files
|
11
|
-
* propagate exit code
|
12
|
-
- don't forget cleanup
|
13
|
-
- propagate pandocs stderr
|
14
|
-
* implement version
|
15
|
-
|
16
|
-
## Closed
|
17
|
-
|
18
|
-
* no theme given use default html
|
19
|
-
* Should deal with missing extension and assume markdown input
|
20
|
-
* Default theme should use pdflate
|
21
|
-
* Message that states output file
|
22
|
-
* list of themes
|
23
|
-
* Snippets for before and after body
|
24
|
-
|
25
|
-
|
26
|
-
# Features
|
27
|
-
|
28
|
-
* Support different themes for pandoc
|
29
|
-
* Theme consists of
|
30
|
-
+ command line options for pandoc
|
31
|
-
+ template variables for pandoc
|
32
|
-
+ a snippet inclusion mechanism
|
33
|
-
+ bundled resources
|
34
|
-
* Parameterisation via the command line
|
35
7
|
|
36
8
|
# Getting started
|
37
9
|
|
@@ -51,12 +23,23 @@ started on your own theme quickly copy the default theme:
|
|
51
23
|
|
52
24
|
cp -R ~/.themedoc/default ~/.themedoc/mytheme
|
53
25
|
|
26
|
+
|
54
27
|
To get help around theme specific parameters go like this:
|
55
28
|
|
56
29
|
themedoc --theme default --help
|
57
30
|
|
31
|
+
# Features
|
32
|
+
|
33
|
+
* Support different themes for pandoc
|
34
|
+
* Theme consists of
|
35
|
+
+ command line options for pandoc
|
36
|
+
+ template variables for pandoc
|
37
|
+
+ a snippet inclusion mechanism (that also support templating)
|
38
|
+
+ bundled resources
|
39
|
+
* Parameterisation via the command line
|
40
|
+
|
58
41
|
# Philosophy
|
59
|
-
|
42
|
+
|
60
43
|
One of its primary usecases is to render pandoc markdown into
|
61
44
|
various formats, such as pdf and different flavours of html.
|
62
45
|
The output can be customised in various ways:
|
@@ -80,6 +63,29 @@ conveniently bundled into a yaml file. Also it allows to bundle other
|
|
80
63
|
resources into the theme and takes care of making them available
|
81
64
|
through the command line.
|
82
65
|
|
66
|
+
# Release Notes
|
67
|
+
|
68
|
+
## Release 0.2
|
69
|
+
|
70
|
+
* If no theme is given themedoc now defaults to `default-html`
|
71
|
+
* Doesn't depend on the extension of the input file (no more than `pandoc`)
|
72
|
+
* `default` theme now uses pdf-latex
|
73
|
+
* Added `default`
|
74
|
+
* Writes a message to stdout that states output file
|
75
|
+
* `--list-themes` lists the themes available
|
76
|
+
* Now we also support snippets to be inserted before and after the body
|
77
|
+
|
78
|
+
# TODO
|
79
|
+
|
80
|
+
* Streaming from stdin ??
|
81
|
+
* Should see why it doesn't run rb 1.8
|
82
|
+
* Testing needed
|
83
|
+
* propagate exit code
|
84
|
+
- don't forget cleanup
|
85
|
+
- propagate pandocs stderr
|
86
|
+
* implement `--version`
|
87
|
+
* Make `--list-themes` more robust by checking for files to be directories
|
88
|
+
* Port templating to slippers
|
83
89
|
|
84
90
|
|
85
91
|
|
data/bin/themedoc
CHANGED
@@ -204,6 +204,12 @@ def apply_overrides(parameter_definitions, command_line_opts, pandoc_parameters)
|
|
204
204
|
|
205
205
|
end
|
206
206
|
|
207
|
+
def make_dot_file(path)
|
208
|
+
splitted = path.split('/')
|
209
|
+
len = splitted.length
|
210
|
+
return (splitted[0, len -1] << ("." + splitted.last)).join('/')
|
211
|
+
end
|
212
|
+
|
207
213
|
installer = Installer.new()
|
208
214
|
installer.install_if_needed()
|
209
215
|
|
@@ -240,7 +246,7 @@ theme.template_parameters \
|
|
240
246
|
regions = ["in-header", "before-body", "after-body"]
|
241
247
|
|
242
248
|
regions.each{|region_name|
|
243
|
-
snippet_file_name=
|
249
|
+
snippet_file_name= make_dot_file(parser.input_file_name() + "." + region_name)
|
244
250
|
if (theme.include(region_name))
|
245
251
|
region_content = Mustache.render(theme.include(region_name), template_parameters);
|
246
252
|
File.open(snippet_file_name, "w+") { |f| f << region_content}
|
@@ -258,9 +264,9 @@ if (parser.opts[:debug])
|
|
258
264
|
exit
|
259
265
|
end
|
260
266
|
|
261
|
-
`rm .resources`
|
267
|
+
`rm -rf .resources`
|
262
268
|
regions.each{|region_name|
|
263
|
-
snippet_file_name=
|
269
|
+
snippet_file_name= make_dot_file(parser.input_file_name() + "." + region_name)
|
264
270
|
`rm -f #{snippet_file_name}`
|
265
271
|
}
|
266
272
|
|
data/themedoc.gemspec
CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.summary = 'themedoc is a theming frontend for pandoc'
|
4
4
|
s.description = 'themedoc is a theming frontend for pandoc that allows grouping
|
5
5
|
parameters, extra resources and output snippets into named themes'
|
6
|
-
s.version = '0.
|
6
|
+
s.version = '0.3'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
|
9
9
|
s.files = ['bin/themedoc']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: themedoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: trollop
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: mustache
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: ! "themedoc is a theming frontend for pandoc that allows grouping\n parameters,
|
37
47
|
extra resources and output snippets into named themes"
|
38
48
|
email: ''
|
@@ -72,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
82
|
version: '0'
|
73
83
|
requirements: []
|
74
84
|
rubyforge_project:
|
75
|
-
rubygems_version: 1.8.
|
85
|
+
rubygems_version: 1.8.24
|
76
86
|
signing_key:
|
77
87
|
specification_version: 3
|
78
88
|
summary: themedoc is a theming frontend for pandoc
|