octopress-tex2img 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/octopress-tex2img/tags.rb +8 -3
- data/lib/octopress-tex2img/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: 751b491d67c85fac067a83bfe2b97fa34935429a
|
4
|
+
data.tar.gz: bcd1ec05e0f0091b871b99e6122b374592d4f305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2b80ef6ebb3352c98948f004b111c32017b2c19e6d3706b2565b495aaf42a3732090dfdfc4c169a03ab00e8f8918a6aabad3fc3165c7b8d7d2bc611200c9303
|
7
|
+
data.tar.gz: 9f334ee44a22e140fc9721c29b6e883372f4642ecf1d710207203c9aafed5cdf543c161091b373938f02f78727077cffe21b836c04388d5b1d9370a407099203
|
data/CHANGELOG.md
CHANGED
@@ -10,9 +10,6 @@ module OctopressTex2img
|
|
10
10
|
def initialize(tag_name, markup, tokens)
|
11
11
|
super
|
12
12
|
@texpath, *params = markup.strip.split(/\s/)
|
13
|
-
if !File.exists?(@texpath)
|
14
|
-
raise ArgumentError.new("texfile[#{@texpath}] does not exist!")
|
15
|
-
end
|
16
13
|
@imgtag = Octopress::Tags::ImageTag::Tag.new(tag_name, params.join(" "), tokens)
|
17
14
|
end
|
18
15
|
|
@@ -21,6 +18,9 @@ module OctopressTex2img
|
|
21
18
|
site = context.registers[:site]
|
22
19
|
pngpath = File.join(site.source, attributes['src'])
|
23
20
|
@texpath = File.join(site.source, @texpath)
|
21
|
+
if !File.exists?(@texpath)
|
22
|
+
raise ArgumentError.new("texfile[#{@texpath}] does not exist!")
|
23
|
+
end
|
24
24
|
|
25
25
|
if !File.exists?(pngpath) || File.stat(@texpath).mtime > File.stat(pngpath).mtime
|
26
26
|
puts "Generating #{pngpath} from #{@texpath}"
|
@@ -31,6 +31,11 @@ module OctopressTex2img
|
|
31
31
|
pdf = @texpath.sub(/.tex$/, '.pdf')
|
32
32
|
system "xelatex -output-directory=#{texdir} --interaction=nonstopmode #{base} >/dev/null"
|
33
33
|
system "convert -density 300 #{pdf} -quality 90 #{pngpath}"
|
34
|
+
if File.exists?(pngpath)
|
35
|
+
site.static_files << Jekyll::StaticFile.new(site,
|
36
|
+
site.source, File.dirname(attributes['src']),
|
37
|
+
File.basename(pngpath))
|
38
|
+
end
|
34
39
|
|
35
40
|
FileUtils.rm_f("#{base}.aux")
|
36
41
|
FileUtils.rm_f("#{base}.log")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-tex2img
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wang Jian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|