Tuesday, October 11, 2016

How to - Convert MkDocs to PDF


I has been requested to create website that will use as Term of Services and Privacy Policy on our services, I am dealing with future changes and I want people get alert and know what has been modified soon. I found out creating simple static page are more convinince. I'am using MkDocs - Project documentation with Markdown as the platform which is quite simple. This documentation site are using markdown and python. I recorded any changes using our private git as tracker. Simply just install Python and PIP then pull mkdocs via pip command. The problem is, MkDocs does't have any built in PDF converter so we need to install pandoc, mkdocs-pandoc and few Tex library to compile the documentation into PDF.

$ sudo pip install pandoc
$ sudo pip install mkdocs-pandoc
$ sudo apt-get install texlive-full

To convert written MkDocs into PDF just type this command :
$ mkdocs2pandoc > myFile.pd
$ pandoc --toc -f markdown+grid_tables+table_captions -o myFile.pdf myFile.pd

That all, Adios!

No comments:

Post a Comment