mdprev 1.0.3 → 1.0.4

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 +4 -9
  2. metadata +2 -2
data/mdprev.rb CHANGED
@@ -4,12 +4,12 @@ require 'rubygems'
4
4
  require 'bluecloth'
5
5
 
6
6
  module MarkdownPreview
7
- VERSION = '1.0.3'
7
+ VERSION = '1.0.4'
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 = "#{Dir.pwd}/.preview.html"
12
- PREVIEW_PDF = "#{Dir.pwd}/.preview.pdf"
11
+ PREVIEW_HTML = "#{ENV['HOME']}/.mdprev.html"
12
+ PREVIEW_PDF = "#{ENV['HOME']}/.mdprev.pdf"
13
13
 
14
14
  def self.run(fnames, flags = {})
15
15
  html = File.open(PREVIEW_HTML, 'w')
@@ -24,13 +24,8 @@ 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)
30
27
  else
31
28
  `#{OPEN_HTML} #{PREVIEW_HTML}`
32
- sleep(1)
33
- File.delete(PREVIEW_HTML)
34
29
  end
35
30
  rescue StandardError => e
36
31
  puts e.message
@@ -108,7 +103,7 @@ fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td {
108
103
  font-style: inherit;
109
104
  vertical-align: baseline;
110
105
  }
111
- body { text-align: center; font-size: 11.5px; background: #e0e0e0;
106
+ body { text-align: center; font-size: 12px; background: #e0e0e0;
112
107
  line-height: 1.7em; color: #333; width: 100%; height: 100%;
113
108
  font-family: lucida grande, helvetica, sans-serif; }
114
109
  h1,h2,h3,h4,h5,h6 { font-weight: bold; font-family: Copperplate / Copperplate Gothic Light, sans-serif; }
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.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: .
11
11
  cert_chain: []
12
- date: 2012-04-28 00:00:00.000000000 Z
12
+ date: 2012-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bluecloth