mdprev 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. data/mdprev.rb +10 -5
  2. metadata +1 -1
data/mdprev.rb CHANGED
@@ -4,12 +4,12 @@ require 'rubygems'
4
4
  require 'bluecloth'
5
5
 
6
6
  module MarkdownPreview
7
- VERSION = '1.0.4'
7
+ VERSION = '1.0.5'
8
8
  OPEN_HTML = ENV['MDPREV_OPEN_HTML'] || 'open'
9
9
  OPEN_PDF = ENV['MDPREV_OPEN_PDF'] || 'open'
10
10
  CONVERT_PDF = ENV['MDPREV_CONVERT_PDF'] || 'wkhtmltopdf $input $output'
11
- PREVIEW_HTML = "#{ENV['HOME']}/.mdprev.html"
12
- PREVIEW_PDF = "#{ENV['HOME']}/.mdprev.pdf"
11
+ PREVIEW_HTML = "./.mdprev.html"
12
+ PREVIEW_PDF = "./.mdprev.pdf"
13
13
 
14
14
  def self.run(fnames, flags = {})
15
15
  html = File.open(PREVIEW_HTML, 'w')
@@ -24,8 +24,13 @@ module MarkdownPreview
24
24
  sub('$input', PREVIEW_HTML).
25
25
  sub('$output', PREVIEW_PDF)
26
26
  `#{command} && #{OPEN_PDF} #{PREVIEW_PDF}`
27
+ sleep(1)
28
+ File.delete(PREVIEW_HTML)
29
+ File.delete(PREVIEW_PDF)
27
30
  else
28
31
  `#{OPEN_HTML} #{PREVIEW_HTML}`
32
+ sleep(1)
33
+ File.delete(PREVIEW_HTML)
29
34
  end
30
35
  rescue StandardError => e
31
36
  puts e.message
@@ -158,9 +163,9 @@ p:last-child { margin-bottom: 0; }
158
163
  .section strong { border-bottom: 1px dashed #aaa; }
159
164
 
160
165
  #main-nav { position: fixed; top: 40px; text-align: left; list-style: none;
161
- text-align: right; margin-left: -170px; width: 240px; }
166
+ text-align: right; margin-left: -275px; width: 240px; }
162
167
  #main-nav li { margin-bottom: 4px; }
163
- .nav-layout #main { left: 100px; }
168
+ .nav-layout #main { left: 115px; }
164
169
 
165
170
  body.pdf-layout { background: #fff; line-height: 1.4em; font-size: 10px; }
166
171
  .pdf-layout #main { width: 420px; }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdprev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: