A minimalistic make for pandoc
pandocmk: a minmalist make tool for Pandoc
Writers of complex Pandoc documents often run into three issues:
- Very long command-line options that they need to remember (or copy-paste) all the time
- Need for extensibility, which can be mostly solved via filters (at the cost of #1)
- Pre/post processing tools, which can be solved via more complex one-liners (
pandoc ... && SumatraPDF output.pdf && ...)
The goal of
pandocmk is to simplify using Pandoc, by helping with #1 and a little bit with #3 (#2 is covered by e.g.
panflute). It uses information from the YAML metadata field to build the command-line arguments, and also has extra arguments for extras I find useful (such as monitoring a file and auto-building as needed, auto-viewing in a PDF viewer, etc.).
There are several good existing tools:
panrun(Ruby; powers panwriter)
rmarkdown(R; powers bookdown and RStudio)
However, they don't completely fill my needs, which leads to this package.
pandocmk has a few custom command-line options. Everything else is forwarded to Pandoc (and overrides whatever is set in the YAML metadata). Thus, in practice this is just a Pandoc wrapper with a few extras.
pandocmk [OPTIONS] [FILES] --view open output file in a viewer such as SumatraPDF for .pdf --watch monitor the input files for changes, and rebuild as needed --tex save .tex output besides .pdf --timeit show build time --verbose show debugging information --draft NOT IMPLEMENTED. When building a Latex PDF, choose faster options (pdflatex, etc) Note: other options are passed to Pandoc
To install pandocmk, open the command line and type:
pip install pandocmk
Note: pandocmk requires Python 3.7 or higher.
pip uninstall pandocmk
After cloning the repo and opening the pandocmk folder:
python setup.py install: install the package locally
python setup.py develop: install locally with a symlink so changes are automatically updated
Dev Update PyPI:
python setup.py sdist bdist_wheel python -m twine upload dist/*
(Ensure README.md has unix line endings)
v0.1: use the
pandocmetadata to build the CLI arguments
v0.2: add support for the
- [ ]
v0.3: tweaks based on what we learned so far
- [ ]
v0.4: add support for styles (should we name them output, defaults, etc.?)
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pandocmk-0.2.1-py3-none-any.whl (9.6 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size pandocmk-0.2.1.tar.gz (8.0 kB)||File type Source||Python version None||Upload date||Hashes View hashes|