jekyll-latex-pdf 0.3.0 → 0.3.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +14 -3
- data/lib/jekyll/latex/pdf/document.rb +24 -8
- data/lib/jekyll/latex/pdf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c206e73833eec7f40f7d9478b400f2b7b04d375a
|
4
|
+
data.tar.gz: 6bc6c41424c049589a90d65ee8d482730738568d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 903a0808e458235e79ff210dd7206fc04609a5202b2bfc4a175c875cbf9739723084d4b299e9ee3b55c00df77dea04f5685c70c8c4f04eacbe04428d062a4036
|
7
|
+
data.tar.gz: cf4f8283d2bfc800b76f08b43c2a9eda039476cd345ab1b19627af8c5385edc29ce91dc86d8083c6fdb0b74c136f18cd95202347cf60dcd294444ff4292bc9fe
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -35,9 +35,8 @@ to get a link to the pdf version of your page.
|
|
35
35
|
|
36
36
|
## Configuration
|
37
37
|
|
38
|
-
We ship a
|
39
|
-
title, author and date from the post.
|
40
|
-
versions.
|
38
|
+
We ship a latex template which is derived from the kramdown original to add
|
39
|
+
title, author and date from the post. See section below.
|
41
40
|
|
42
41
|
jekyll-latex-pdf uses `lualatex` as default engine. You can change this in
|
43
42
|
`_config.yml` by adding. There you can also set a default author:
|
@@ -46,10 +45,22 @@ jekyll-latex-pdf uses `lualatex` as default engine. You can change this in
|
|
46
45
|
pdf:
|
47
46
|
pdf_engine: pdflatex
|
48
47
|
author: Martin Kaffanke
|
48
|
+
template: myowntemplate
|
49
|
+
```
|
49
50
|
|
50
51
|
Just set up a ticket on https://gitlab.com/grauschnabel/jekyll-latex-pdf/issues
|
51
52
|
to add feature requests you need.
|
52
53
|
|
54
|
+
## Template
|
55
|
+
|
56
|
+
For the configuration above we need a template in the `_latex` directory, called
|
57
|
+
`myowntemplate.latex`. It could be a good way to start using the shiped
|
58
|
+
template and adjust it to your needs.
|
59
|
+
|
60
|
+
## TODO:
|
61
|
+
|
62
|
+
- Language support (date, babel, ...)
|
63
|
+
|
53
64
|
## Development
|
54
65
|
|
55
66
|
This packages is hardly in development at the moment. Feel free to add feature
|
@@ -30,23 +30,39 @@ module Jekyll
|
|
30
30
|
'template' => template,
|
31
31
|
'pdf_engine' => 'lualatex'
|
32
32
|
}
|
33
|
-
|
33
|
+
|
34
|
+
if @settings['template']
|
35
|
+
@settings['template'] = File.expand_path(File.join("_latex", @settings['template']))
|
36
|
+
unless @settings['template'].end_with?(".latex")
|
37
|
+
@settings['template'].concat(".latex")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
34
41
|
@options = defaults.merge( @settings.merge(self.data) )
|
42
|
+
puts @options
|
35
43
|
end
|
36
44
|
|
37
45
|
def write(dest)
|
38
46
|
path = File.join(dest, CGI.unescape(self.url))
|
47
|
+
tempdir = Dir.mktmpdir('jekyll-latex-pdf')
|
48
|
+
latexfile = File.join(tempdir, "texput.tex")
|
39
49
|
|
40
50
|
latex_string = Kramdown::Document.new(self.content, @options).to_latex
|
51
|
+
File.open(latexfile, "w:UTF-8") do |f|
|
52
|
+
f.write(latex_string)
|
53
|
+
end
|
41
54
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
55
|
+
stdout_str, status = Open3.capture2(@options['pdf_engine'], "--output-directory=#{tempdir}", "--output-format=pdf",
|
56
|
+
"--interaction=batchmode", latexfile)
|
57
|
+
#puts stdout_str
|
58
|
+
|
59
|
+
|
60
|
+
if (status == 0)
|
61
|
+
FileUtils.mv(File.join(tempdir, "texput.pdf"), path)
|
62
|
+
else
|
63
|
+
puts "Error when trying to run #{@options['pdf_engine']}. See #{tempdir}/texput.log"
|
49
64
|
end
|
65
|
+
|
50
66
|
end
|
51
67
|
end
|
52
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-latex-pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Kaffanke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|