Last Updated: July 25, 2019
· chuckbutler

Hack out distributable notes in markdown

Using ruby to convert your markdown to a consistent, styled, and distributable PDF is super simple. I use this particular hack to convert everything from company memos to my resume

require 'redcarpet'
require 'pdfkit'

file =[0], "rb")
contents =

options = [:hard_wrap => true, :space_after_headers => true, :autolink => true, :fenced_code => true, :gh_blockcode => true]

markdown =, *options)

kit =,
             :page_size => 'Letter')

if ARGV[1]
kit.stylesheets << ' #{ARGV[1]}'

saved_pdf = kit.to_file(ARGV[0] + ".pdf")

Use of the script: convertthis path/to/stylesheet