Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Commit

Permalink
Added doc_raptor to Gemfile and fixed rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Ocampo-Gooding committed Jun 20, 2012
1 parent 296b5c4 commit 038a7f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -2,4 +2,6 @@
source "https://rubygems.org"

gem "kitabu", :git => "https://github.com/jstorimer/kitabu"
gem "compass"
gem "compass"
gem "rake"
gem "doc_raptor"
9 changes: 9 additions & 0 deletions Gemfile.lock
Expand Up @@ -28,17 +28,24 @@ GEM
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
doc_raptor (0.3.2)
httparty (>= 0.7.0)
eeepub-with-cover-support (0.8.7)
builder
rubyzip
ffi (1.0.11)
fssm (0.2.9)
httparty (0.8.3)
multi_json (~> 1.0)
multi_xml
i18n (0.6.0)
multi_json (1.3.6)
multi_xml (0.4.4)
nokogiri (1.5.4)
notifier (0.2.1)
pygments.rb (0.2.12)
rubypython (~> 0.5.3)
rake (0.9.2.2)
rdiscount (1.6.8)
rubypython (0.5.3)
blankslate (>= 2.1.2.3)
Expand All @@ -53,4 +60,6 @@ PLATFORMS

DEPENDENCIES
compass
doc_raptor
kitabu!
rake
8 changes: 4 additions & 4 deletions Rakefile
@@ -1,15 +1,15 @@
task :default => :docraptor

desc "Creates PDF via DocRaptor"
task :docraptor do
print 'Creating Docraptor doc...'
require 'rubygems'
print 'Creating DocRaptor doc...'
require 'doc_raptor'

DocRaptor.api_key ENV['DRKEY']

pdf_html = File.read('output/Shopify-Developer-Book.pdf.html')
pdf_html = File.read('output/Shopify-Developer-Book.html').gsub(/[^[:ascii:]]/) {|c| "&#x%X;" % c.ord}

File.open("Shopify-Developer-Book.raptor.pdf", "w+b") do |f|
File.open("output/Shopify-Developer-Book.raptor.pdf", "w+") do |f|
f.write DocRaptor.create(:document_content => pdf_html,
:name => "Shopify Developer Book",
:document_type => "pdf",
Expand Down

0 comments on commit 038a7f6

Please sign in to comment.