abapa-chapter01

Say you want to write a book about Rake.

Maybe you start with a Markdown file. Call it `book.md`.

Markdown is nice for writing, but it isn’t ideal for reading. Eventually
you’d like to deliver the book in a variety of formats: EPUB, for
e-readers. KF8, for Kindle. PDF, for printing. And maybe an HTML version
for reading online.

For now, you’ll settle for HTML as a proof-of-concept.

`pandoc` is a multipurpose tool for converting between document formats.

“`shell
$ pandoc -o book.html book.md
“`

That works nicely.

This command is short. You could type it out every time you update
the book.

But who wants to do that? You don’t want to have to remember that it’s a
`-o` flag to set the output filename every time. You want *automation.*

So you make a script, `build.sh`.

“`bash
#!/bin/sh
pandoc -o book.html book.md
“`

For now, this is good enough. And you call it a night.

Scroll to Top