Skip to content

Instantly share code, notes, and snippets.

@copolycube
Forked from cferdinandi/pandoc-cheatsheet.md
Created June 1, 2021 19:24
Show Gist options
  • Save copolycube/cb7583db009c700bafa06a8c659d817f to your computer and use it in GitHub Desktop.
Save copolycube/cb7583db009c700bafa06a8c659d817f to your computer and use it in GitHub Desktop.
CLI cheats for creating a markdown ebook with Pandoc.

epub

pandoc assets/metadata.yml chapters/*.md -o book.epub -S

pdf

Using WKHTMLtoPDF (no page numbers)

pandoc assets/title.md chapters/*.md -o book.pdf -t html5 -S -V papersize:"letter" -c assets/pandoc.css

Using LaTeX (no CSS)

pandoc chapters/*.md -o book.pdf -V geometry:paperheight=8in -V geometry:paperwidth=5.25in

mobi (Kindle)

ebook-convert book.epub book.mobi

YAML

---
title:
- type: main
  text: The Web Developer Career Guide
- type: subtitle
  text: How to stay relevant, hack the hiring process, and grow your salary
creator:
- role: author
  text: Chris Ferdinandi
publisher:  Go Make Things, LLC
date: v0.2.0
rights: Copyright 2016 Chris Ferdinandi, All Rights Reserved
stylesheet: assets/pandoc.css
# cover-image: assets/cover.jpg
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment