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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 806258a82f4f85512aa7017e8ee68d772c777625
4
- data.tar.gz: 8c0dcd7e490e2e4cd80ba295cc47ef9d45714292
3
+ metadata.gz: 751b491d67c85fac067a83bfe2b97fa34935429a
4
+ data.tar.gz: bcd1ec05e0f0091b871b99e6122b374592d4f305
5
5
  SHA512:
6
- metadata.gz: 6ebd8381f9f598ad08c57b507f07c96f74208cc849de55ce2c26c3d189adf0e45e8a67632a1eea96b31324da62ce58ed3109f14dfa8a62f3874cef3333c58d78
7
- data.tar.gz: d1c5bd04f126aaaf72b48bed130691afe23e0aeb84812112aaa1c31875b846647bfc3e1b03efd5ad0b1dd61d865f20c309599b98aff62da2bcb8a0d858c8866a
6
+ metadata.gz: b2b80ef6ebb3352c98948f004b111c32017b2c19e6d3706b2565b495aaf42a3732090dfdfc4c169a03ab00e8f8918a6aabad3fc3165c7b8d7d2bc611200c9303
7
+ data.tar.gz: 9f334ee44a22e140fc9721c29b6e883372f4642ecf1d710207203c9aafed5cdf543c161091b373938f02f78727077cffe21b836c04388d5b1d9370a407099203
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1 - 2015-07-29
4
+ - Add generating png file to static files of jekyll
5
+
3
6
  ## 0.1.0 - 2015-07-28
4
7
  - Initial release
@@ -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")
@@ -1,3 +1,3 @@
1
1
  module OctopressTex2img
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-29 00:00:00.000000000 Z
11
+ date: 2015-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler