whitedown 0.0.0

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 (3) hide show
  1. data/bin/whitedown +30 -0
  2. data/lib/whitedown.rb +0 -0
  3. metadata +49 -0
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ ########################################################################
3
+
4
+ def print_usage
5
+ puts "Usage: whitedown inputFile.md [optional]outputFile.pdf"
6
+ end
7
+
8
+ if ARGV[0] == nil
9
+ print_usage
10
+ exit 1
11
+ end
12
+
13
+ source = File.open(ARGV[0], "rb").read
14
+ options = [ :hard_wrap => true,
15
+ :autolink => true,
16
+ :fenced_code => true,
17
+ :fenced_code_blocks => true,
18
+ :tables => true
19
+ ]
20
+
21
+ md = Redcarpet::Markdown.new(Redcarpet::Render::HTML, *options)
22
+ pdf = PDFKit.new(md.render(source), :page_size => "Letter")
23
+ pdf.stylesheets << "./style.css"
24
+
25
+ dest = ARGV[0] + ".pdf"
26
+ if ARGV[1]
27
+ dest = ARGV[1]
28
+ end
29
+
30
+ pdf.to_file(dest)
File without changes
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: whitedown
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Myles Hathcock
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-25 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Ruby command line utility that makes it easy to generate beautiful Whitepapers
15
+ as HTML and PDFs, using whitedown, a superset of Github Flavored Markdown.
16
+ email: myles.hathcock@gmail.com
17
+ executables:
18
+ - whitedown
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/whitedown.rb
23
+ - bin/whitedown
24
+ homepage: http://darthmuffins.github.io/whitedown
25
+ licenses: []
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 1.8.23
45
+ signing_key:
46
+ specification_version: 3
47
+ summary: Generate beautiful Whitepapers as HTML and PDFs from whitedown
48
+ test_files: []
49
+ has_rdoc: