jekyll-latex-pdf 0.5.0 → 0.5.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/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/README.md +14 -14
- data/lib/jekyll/latex/pdf.rb +0 -8
- data/lib/jekyll/latex/pdf/defaults.rb +3 -0
- data/lib/jekyll/latex/pdf/document.rb +10 -4
- data/lib/jekyll/latex/pdf/generator.rb +1 -1
- data/lib/jekyll/latex/pdf/latex.rb +1 -1
- data/lib/jekyll/latex/pdf/tikz/tikz-html.rb +4 -1
- 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: 9ff894a61d241f55b32b7537b01595a4defdc7d9
|
4
|
+
data.tar.gz: d9c51b26b7822cc404d2f906acb0f8550f3eeb75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ff22f6542d267d08c18bbfd19dc216af5c5564195c9b743b80c514a9fadfb0456e92189ace912e31433f90e1da75b912e25b1a69eacdc797c95d99ce8c8af2
|
7
|
+
data.tar.gz: 5bbc99017f8020994c77a8081141d0c90be513acda274f45db994082f7ad7705903cfa45663664b65052a61be5b801126b2e4a2f17485cf12276585dd801ed99
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -43,9 +43,9 @@ biblatex to see how it works.
|
|
43
43
|
If you want to use the `tikz` environment you additionally need to install
|
44
44
|
`pdf2svg` and `graphicsmagick`.
|
45
45
|
|
46
|
-
You may want to add `.latex-cache`
|
47
|
-
`.gitignore`. This is where we store the latex
|
48
|
-
if needed.
|
46
|
+
You may want to add `.latex-cache` (or whatever you set in your
|
47
|
+
`latex_cache_path`) to your `.gitignore`. This is where we store the latex
|
48
|
+
files for faster recompiling if needed.
|
49
49
|
|
50
50
|
## Usage
|
51
51
|
|
@@ -57,7 +57,8 @@ In your post template use
|
|
57
57
|
<a href="{{ page.pdf_url }}" target="_blank">PDF</a>
|
58
58
|
```
|
59
59
|
|
60
|
-
to get a link to the pdf version of your page.
|
60
|
+
to get a link to the pdf version of your page. Maybe you want to surround this
|
61
|
+
in an if clause if you have posts which should not be rendered to pdf too.
|
61
62
|
|
62
63
|
## Configuration
|
63
64
|
|
@@ -78,16 +79,15 @@ All this variables can also be adjusted in the yaml header of your post.
|
|
78
79
|
|
79
80
|
Variables to customize are:
|
80
81
|
|
81
|
-
| Variable
|
82
|
-
|
83
|
-
| `pdf_engine`
|
84
|
-
| `bib_engine`
|
85
|
-
| `template`
|
86
|
-
| `template_path`
|
87
|
-
| `date_as_note`
|
88
|
-
| `tikz_path`
|
89
|
-
|
90
|
-
|
82
|
+
| Variable | Description |
|
83
|
+
|:------------------|:------------------------------------------------------------------------|
|
84
|
+
| `pdf_engine` | Defaults to `lualatex` and can be changed to pdflatex, xelatex, ... |
|
85
|
+
| `bib_engine` | Defaults to `biber` and is used when `jekyll-scholar` is present. |
|
86
|
+
| `template` | Defaults to `jekyll-latex-pdf` |
|
87
|
+
| `template_path` | Is where we look for your own templates. Defaults to `_latex`. |
|
88
|
+
| `date_as_note` | Is `false` by default. See apa6 |
|
89
|
+
| `tikz_path` | Defaults to `assets/tikz_svg`. See tikz section. |
|
90
|
+
| `latex_cache_dir` | Path where we hold the latex files. Default: `.latex_cache` |
|
91
91
|
|
92
92
|
Just set up a ticket on
|
93
93
|
(issues)[https://gitlab.com/grauschnabel/jekyll-latex-pdf/issues] to add feature
|
data/lib/jekyll/latex/pdf.rb
CHANGED
@@ -5,14 +5,6 @@ require "jekyll/latex/pdf/kramdown_data"
|
|
5
5
|
require "jekyll/latex/pdf/utilities"
|
6
6
|
require "jekyll/latex/pdf/liquid"
|
7
7
|
|
8
|
-
if Jekyll::External.require_if_present "jekyll/scholar"
|
9
|
-
require "jekyll/latex/pdf/scholar"
|
10
|
-
end
|
11
|
-
|
12
|
-
if Jekyll::External.require_if_present "jekyll/figure"
|
13
|
-
require "jekyll/latex/pdf/figure"
|
14
|
-
end
|
15
|
-
|
16
8
|
require "jekyll/latex/pdf/tikz"
|
17
9
|
|
18
10
|
require "jekyll/latex/pdf/latex"
|
@@ -34,20 +34,26 @@ module Jekyll
|
|
34
34
|
@kramdowndata.add(site.config["pdf"] || {})
|
35
35
|
|
36
36
|
check_scholar
|
37
|
+
check_figure
|
37
38
|
end
|
38
39
|
|
39
40
|
def check_scholar
|
40
41
|
if @site.config["plugins"].include? "jekyll-scholar"
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
# config = @site.config["scholar"]
|
42
|
+
|
43
|
+
require "jekyll/latex/pdf/scholar"
|
44
|
+
|
45
45
|
@kramdowndata.add(bibtex_files: bibtex_files.map do |bibfile|
|
46
46
|
File.join(@site.config["scholar"]["source"], bibfile)
|
47
47
|
end)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
def check_figure
|
52
|
+
if site.config["plugins"].include? "jekyll-figure"
|
53
|
+
require "jekyll/latex/pdf/figure"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
51
57
|
def permalink
|
52
58
|
data.key?("permalink") ? (data["permalink"] + ext) : nil
|
53
59
|
end
|
@@ -17,7 +17,7 @@ module Jekyll
|
|
17
17
|
@site, @config = site, Defaults.defaults.merge(site.config["pdf"] || {})
|
18
18
|
|
19
19
|
@site.config["pdf"].merge! @config
|
20
|
-
@site.config["exclude"].
|
20
|
+
@site.config["exclude"] << @site.config["pdf"]["latex_cache_path"].to_s + File::SEPARATOR
|
21
21
|
|
22
22
|
@site.posts.docs.each do |post|
|
23
23
|
@site.pages << Document.new(@site, post) if post.data["pdf"]
|
@@ -82,7 +82,7 @@ module Jekyll
|
|
82
82
|
prepare_latex
|
83
83
|
|
84
84
|
basename = File.basename(@name, ".*")
|
85
|
-
@tempdir = File.join(Dir.pwd,
|
85
|
+
@tempdir = File.join(Dir.pwd, @site.config["pdf"]["latex_cache_path"], "pdf", basename)
|
86
86
|
FileUtils.mkdir_p @tempdir
|
87
87
|
@latexfile = basename + ".tex"
|
88
88
|
|
@@ -58,7 +58,10 @@ module Jekyll
|
|
58
58
|
|
59
59
|
tikz_code = @header + super + @footer
|
60
60
|
|
61
|
-
tmp_directory = File.join(Dir.pwd,
|
61
|
+
tmp_directory = File.join(Dir.pwd,
|
62
|
+
@site.config["pdf"]["latex_cache_path"],
|
63
|
+
"tikz",
|
64
|
+
File.basename(context["page"]["url"], ".*"))
|
62
65
|
tex_path = File.join(tmp_directory, "#{@file_name}.tex")
|
63
66
|
pdf_path = File.join(tmp_directory, "#{@file_name}.pdf")
|
64
67
|
FileUtils.mkdir_p tmp_directory
|
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.5.
|
4
|
+
version: 0.5.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-
|
11
|
+
date: 2019-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|