This is a fork of Bookmarkdown made by Steve Losh.
Its purpose is to let publish book easier with Markdown file.
However this software was coded in 2000 and no longer maintained which means it supports Python2 only instead of Python3, so there are some tricks to get it running.
/usr/local/bin/python -m pip install baker
/usr/local/bin/python -m pip install jinja2
/usr/local/bin/python -m pip install Markdown
/usr/local/bin/python -m pip install pyquery=1.4.0
Then add the following lines into Markdown and put it after "import sys", or it will encounter "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 2: ordinal not in range(128). -- Note: Markdown only accepts unicode input!":
vim ~/.local/lib64/python2.7/site-packages/markdown/core.py
reload(sys)
sys.setdefaultencoding('utf-8')
Your book should have similar structure as below:
+chapters
++++chapter00.md
++++chapter01.md
+preface.md
+license.md
+knowledgement.md
+config.py
+build.sh
title = 'book title'
author = 'the author name'
author_url = 'link'
#!/usr/bin/env bash
set -e
python ../bookmarkdown/bookmarkdown/bookmarkdown build
Put this software into the same directory with your book.
- Build the html file by change to your book directory and type command
bash ./build.sh
, then the rendered file will be in the directory named build - Type command to run a simple server
python ../bookdown/bookdown/bookdown serve
- Fire a browser and type address http://127.0.0.1:8000