Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created December 12, 2017 14:48
Show Gist options
  • Save nelstrom/a33841b51813bee958c3e8e698f9ead0 to your computer and use it in GitHub Desktop.
Save nelstrom/a33841b51813bee958c3e8e698f9ead0 to your computer and use it in GitHub Desktop.
Simple rake script to automate building a PDF from markdown (via .tex)
require 'rake'
require 'rake/clean'
task :default => :pdf
task :pdf => "book-draft1.pdf"
file "book-draft1.tex" => "book-draft1.md" do
sh "pandoc book-draft1.md -s -o book-draft1.tex"
end
file "book-draft1.pdf" => "book-draft1.tex" do
sh "pandoc book-draft1.tex -s -o book-draft1.pdf"
end
CLEAN.include("book-draft1.tex")
CLOBBER.include("book-draft1.pdf")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment