NOTE Markrundown now has a working draft implementation to be used with gitbook. See https://github.com/eliotsykes/gitbook-plugin-markrundown
Markrundown can be used to write a technical book that is a step-by-step guide to coding an application.
Markrundown allows you to write the book and the code for the book's example codebase in markdown.
Markrundown is intended for books that need to be regularly updated and rely on having an associated codebase that is stored in a git repo that the reader uses as a reference.
If the book is updated, markrundown will rebuild the book and the book's associated codebase git repo. Each new version of the book is tied to one new version of a git repo. This new git repo has no history from previous versions of the book. The git repo is built entirely from scratch at the same time the book is built from markdown into its output format.
To achive this, Markrundown is dependent on code patches written in the markdown document (you know the patches you get from running git diff
).
As the book is processed into its output format, these inlined code patches are applied to a new git repo to build the tutorial codebase patch-by-patch, bit-by-bit, just as the reader who follows your book's steps would build the app step-by-step.
Markrundown fenced code blocks have an info string on the same line as the opening fence. Here's what the keywords mean:
run
- run this code block (in the system shell if itsbash
too). Used to build the associated codebase for the book, and run tests on the codebase too.bash
- the code highlighting language is bash and if it has arun
on the same line, run ithide
- hide this code block from the final rendered HTML. Used for code that you need to run to build the book and associated codebase but don't want to show to the readerpatch
- apply this patch to the working directory. Used to build up the associated codebase for the book and show the code changes that a reader will need to make when following along the tutorial steps.patch
may need to eventually take extra options for helping with outputting the author's desired content which may be slightly different to what's needed in the patch.
See hello_world.md.txt
below for a sample of how a raw markrundown document would look.