A little hack to make formatted documents from markdown using PanDoc https://pandoc.org/
To create a new book, go into the pan-book-machine
and type:
./cli_createBook.sh
Here you can provide
- the folder name for the new book
- decide if you want sample content (possibly a good idea if you want to play with pan-doc-machine)
No edit the file inside the newly created folder:
CONFIG/book.conf
Each option (like PDF or DOCX you can set to TRUE or FALSE)
Finally, edit the file:
CONFIG/metadata-info.yaml
To make the output match your information (title and the like)
All the markdown files with an ending .md
are merged into one big file in alphanumerical order.
Then this one master file is used to create the book.
Including images
If you want to use images in a subfolder, do so inside the CONTENT
folder.
pan-book-machine
will work with relative paths from inside that folder.
Inside your book folder, run the command:
./cli_pandocEbook.sh
The resulting files will be placed in the book directory.
DO NOT edit the files in the folder 00-PanBookMachine-boilerplate
unless you want
to contribute new code to the git repo. All the files you need to edit are inside the folder of your
new book directory.
Renaming all files to .jpg and .png
rename 's/\.jpeg/\.jpg/' *.jpeg; rename 's/\.JPG/\.jpg/' *.JPG; rename 's/\.JPEG/\.jpg/' *.JPEG; rename 's/\.PNG/\.png/' *.PNG
On linux systems, you can convert all .png files into .jpg file with quality 90 with this command:
for f in *.png; do convert -quality 90 "$f" "${f/%png/jpg}"; done