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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a737aeb75c5bf4341c37833d7e6e7cb6bd51968
4
- data.tar.gz: 3846bef0d7656169b8aff77026e0b285364ab3f7
3
+ metadata.gz: 9ff894a61d241f55b32b7537b01595a4defdc7d9
4
+ data.tar.gz: d9c51b26b7822cc404d2f906acb0f8550f3eeb75
5
5
  SHA512:
6
- metadata.gz: 4f9ef3d40712ace907e58ef4c647a55d1047d87bb32cf084eec2ce3ccc2eceb993c96437f32627907784ab05816fb7aeab8b1c1545c21adff7d2818e9c17af57
7
- data.tar.gz: 74b082a6f6f51e729ccd4aa59c70fb22af8e43c680883d219abd39d8b8b1fc317197c6e4b864122d6a74a11d60280c120214802429c054aa30a5270f874a4e94
6
+ metadata.gz: 90ff22f6542d267d08c18bbfd19dc216af5c5564195c9b743b80c514a9fadfb0456e92189ace912e31433f90e1da75b912e25b1a69eacdc797c95d99ce8c8af2
7
+ data.tar.gz: 5bbc99017f8020994c77a8081141d0c90be513acda274f45db994082f7ad7705903cfa45663664b65052a61be5b801126b2e4a2f17485cf12276585dd801ed99
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.1]
4
+ ### Added
5
+ - Configurable latex and tikz cache.
6
+
7
+ ### Bugfix
8
+ - trying to restore non used LiquidTags.
9
+
3
10
  ## [0.5.0]
4
11
  ### Added
5
12
  - Adding support for the jekyll-figure package.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-latex-pdf (0.5.0)
4
+ jekyll-latex-pdf (0.5.1)
5
5
  jekyll (~> 3.8.5)
6
6
  kramdown (~> 1.17)
7
7
 
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` and maybe `.tikz-cache` to your
47
- `.gitignore`. This is where we store the latex projects for faster recompiling
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 | Description |
82
- |-----------------+---------------------------------------------------------------------|
83
- | `pdf_engine` | Defaults to `lualatex` and can be changed to pdflatex, xelatex, ... |
84
- | `bib_engine` | Defaults to `biber` and is used when `jekyll-scholar` is present. |
85
- | `template` | Defaults to `jekyll-latex-pdf` |
86
- | `template_path` | Is where we look for your own templates. Defaults to `_latex`. |
87
- | `date_as_note` | Is `false` by default. See apa6 |
88
- | `tikz_path` | Defaults to `assets/tikz_svg`. See tikz section. |
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
@@ -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"
@@ -26,6 +26,9 @@ module Jekyll
26
26
 
27
27
  # Set the path where the rendered svg files should be stored.
28
28
  "tikz_path" => "assets/tikz",
29
+
30
+ # Directory where the latex files will be keept.
31
+ "latex_cache_path" => ".latex-cache",
29
32
  }
30
33
  class << self
31
34
 
@@ -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
- # (class <<self; include Jekyll::Scholar::Utilities; end)
42
- # getting bibtex files
43
- # @config = Jekyll::Scholar.defaults.dup
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"].concat [".latex-cache" + File::SEPARATOR, ".tikz-cache" + File::SEPARATOR]
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, ".latex-cache", basename)
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, ".tikz-cache", File.basename(context["page"]["url"], ".*"))
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
@@ -3,7 +3,7 @@
3
3
  module Jekyll
4
4
  module Latex
5
5
  module Pdf
6
- VERSION = "0.5.0"
6
+ VERSION = "0.5.1"
7
7
  end
8
8
  end
9
9
  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.5.0
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-04-30 00:00:00.000000000 Z
11
+ date: 2019-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler