jgrassler / mkdocs-pandoc

[unmaintained] mkdocs -> pandoc converter: use this fork https://github.com/twardoch/mkdocs-combine
Apache License 2.0
107 stars 39 forks source link

DESCRIPTION

This module contains a set of filters for converting mkdocs style markdown documentation into a single pandoc(1) flavoured markdown document. This is useful for

Aside from the filters the module contains a converter class tying them together into a coherent whole and the command line converter mkdocs2pandoc.

PREREQUISITES

For generating PDF through pandoc(1) you will need to install a few things pip(1) won't handle, namely pandoc and the somewhat exotic LaTeX packages its default LaTeX template uses. On a Ubuntu 14.04 system this amounts to the following packages:

fonts-lmodern
lmodern
pandoc
texlive-base
texlive-latex-extra
texlive-fonts-recommended
texlive-latex-recommended
texlive-xetex

On a Windows system you can get them through Chocolatey. Once you have Chocolatey up and running the following commands should leave you with everything you need to create PDF output from Pandoc:

choco install python
choco install pandocpdf

INSTALLATION

Note: The following instructions apply to both Unixoid systems and Windows.

Make sure, you have pip installed, then issue the following command:

pip install mkdocs-pandoc

This will install the stable version. If you'd like to use the development version, use

pip install git+https://github.com/jgrassler/mkdocs-pandoc

instead. Note that if you are behind a proxy, you might need to add the --proxy option like this

pip --proxy=http[s]://user@mydomain:port install ...

USAGE

When executed in the directory where your documentation's mkdoc.yml and the docs/ directory containing the actual documentation resides, mkdocs2pandoc should print one long Markdown document suitable for pandoc(1) on standard output. This works under the following assumptions:

Usage example

cd ~/mydocs
mkdocs2pandoc > mydocs.pd
pandoc --toc -f markdown+grid_tables+table_captions -o mydocs.pdf mydocs.pd   # Generate PDF
pandoc --toc -f markdown+grid_tables -t epub -o mydocs.epub mydocs.pd         # Generate EPUB

BUGS

The following things are known to be broken:

COPYRIGHT

(C) 2015 Johannes Grassler johannes@btw23.de

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

You will also find a copy of the License in the file LICENSE in the top level directory of this source code repository. In case the above URL is unreachable and/or differs from the copy in this file, the file takes precedence.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.