Skip to content

Instantly share code, notes, and snippets.

@ibrahimcesar
Forked from cferdinandi/pandoc-cheatsheet.md
Created April 20, 2022 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibrahimcesar/0c150fe285f97a4269d05e3a82c8b22c to your computer and use it in GitHub Desktop.
Save ibrahimcesar/0c150fe285f97a4269d05e3a82c8b22c 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