octopress-printable 0.1.0 → 0.1.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: fd9e2a03852c25c43786bc4abdaf7c06c004960d
4
- data.tar.gz: 1c60f2af5624021d08726aa7922e396ab5cfac74
3
+ metadata.gz: 3a053215d4f4864452208d8fb8d17d5c27c3234a
4
+ data.tar.gz: b155ab563874ed00e1b7f3d54e5577cc45595399
5
5
  SHA512:
6
- metadata.gz: 905463cfb008f7a3f38fd4ef8455fba3abef2e3faa81f7bfd043438fbaed30c65a1aa2da659eabd9de53418f65dd2bf016742dd2aef53f6cc6b68b833fd142e2
7
- data.tar.gz: b744b9067c15404fc5b960cc0799fe571e3435e3b3de85934d5f5929a452613eb76171ca0ac69d64ac499d98d2334e23b3b1a2f3196b24da4ce82ea110b56fb0
6
+ metadata.gz: 955994de683ca03fae3fb43eea7129936e423ec0ca8fe743be85907e019baf4d10c3906cc2841ec21b3b5c143879524ba003b73a2b7d383da20e7c1aca32a246
7
+ data.tar.gz: d05b348316ad44874e4a8fe02fdd4262303f361a4283540fd1bfac4bd54b3776049e87291f8dc1018a972019f98c8bd86d09ed27be57ddb436263c0efa1a31e8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1 - 2015-05-18
4
+ - Add online version link in pdf
5
+
3
6
  ## 0.1.0 - 2015-05-16
4
7
  - Using octopress-font-awesome
5
8
 
data/assets/config.yml CHANGED
@@ -1,17 +0,0 @@
1
- posts_dir: "_posts"
2
- printables_dir: "assets/printables"
3
- source_dir: "."
4
- blog_url: "http://example.com" # used in pdf post_links
5
- bibliography_dir: "_bibliography"
6
- bibliography: "references.bib"
7
-
8
- # only convert markdowns, without running pandoc and xelatex
9
- dry_run : false
10
-
11
- # debug files
12
- dump_tex_file: false
13
- dump_markdown_file: false
14
- dump_bib_file: false
15
- dump_cmds: false
16
- keep_tmp_files: false
17
-
@@ -1,6 +1,6 @@
1
1
  module Octopress
2
2
  module Printable
3
- class Plugin
3
+ class Config
4
4
 
5
5
  def self.default_config
6
6
  <<-CONFIG
@@ -1,5 +1,6 @@
1
1
  module Octopress
2
2
  module Printable
3
+ autoload :Config, 'octopress-printable/config'
3
4
  autoload :Converter, 'octopress-printable/converter'
4
5
  autoload :MathConverter, 'octopress-printable/math'
5
6
  autoload :ImgConverter, 'octopress-printable/img'
@@ -40,7 +41,8 @@ module Octopress
40
41
 
41
42
  if !File.exists?(pdf) || File.stat(post).mtime > File.stat(pdf).mtime
42
43
  puts "Converting #{post} to #{pdf}"
43
- gen_pdf(post, pdf, source_dir, posts_dir, blog_url, bib_dir, bib)
44
+ gen_pdf(post, pdf, source_dir, posts_dir, blog_url,
45
+ bib_dir, bib, p.url)
44
46
  if File.exists?(pdf)
45
47
  site.static_files << Jekyll::StaticFile.new(site,
46
48
  site.source, printables_dir, File.basename(pdf))
@@ -51,33 +53,11 @@ module Octopress
51
53
 
52
54
  def inject_configs
53
55
  @conf = self.config
54
- @conf = Jekyll::Utils.deep_merge_hashes(YAML.load(Plugin.default_config), @conf)
55
- end
56
-
57
- def self.default_config
58
- <<-CONFIG
59
- posts_dir: "_posts"
60
- printables_dir: "assets/printables"
61
- source_dir: "."
62
- blog_url: "http://example.com" # used in pdf post_links
63
- bibliography_dir: "_bibliography"
64
- bibliography: "references.bib"
65
-
66
- # only convert markdowns, without running pandoc and xelatex
67
- dry_run : false
68
-
69
- # debug files
70
- dump_tex_file: false
71
- dump_markdown_file: false
72
- dump_bib_file: false
73
- dump_cmds: false
74
- keep_tmp_files: false
75
-
76
- CONFIG
56
+ @conf = Jekyll::Utils.deep_merge_hashes(YAML.load(Config.default_config), @conf)
77
57
  end
78
58
 
79
59
  def gen_pdf(mdfile, pdffile, source_dir, posts_dir, blog_url,
80
- bib_dir, bib_file)
60
+ bib_dir, bib_file, post_url)
81
61
  pdfdir = File.dirname(pdffile)
82
62
  if ! File.exists?(pdfdir)
83
63
  FileUtils.mkdir_p pdfdir
@@ -133,6 +113,9 @@ CONFIG
133
113
  post.puts line
134
114
  end
135
115
  end
116
+
117
+ url = "#{blog_url}/#{post_url}".gsub(/([^:])\/\/+/, '\1/')
118
+ post.puts "\\renewcommand{\\thefootnote}{}\\footnotetext{Online version at \\url{#{url}}}"
136
119
  end
137
120
 
138
121
  cts = []
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Printable
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-printable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wang Jian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-16 00:00:00.000000000 Z
11
+ date: 2015-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler