The Markbook script
The Markbook files are converted to HTML using a script called bin/markbook.
The script takes two arguments the source directory containing the Markdown files, and the destination directory, which should already exist.
bin/markbook example_book example_output
The script performs the following operations.
- Convert all
mdfiles tohtmlappending headers and footers and replacing variables from the meta data. - Create tocs.
- Copies static content from
.img/and.css/to the destination directoriesimg/andcss/. - Copies any
htmlfiles overriding the generated files.
A Markdown page is generated as follows.
- cat the
.head.htmlfile to the new destination file, created with extension.html. - Convert the
.header.mdfile from Markdown to HTML and append it to the HTML file. - Convert the main Markdown data from Markdown to HTML and append it to the file.
- Convert the
.footer.mdfile from Markdown to HTML and append it to the file. - cat the
.tail.htmlfile appending to the destination file.
All files are optional, if .head.html or .tail.html do not exists defaults from markbook/lib/html are used.
If .css/ does not exist markbook/lib/css is copied to the output.
If .img/ does not exist markbook/lib/css is copied to the output.