Requirements¶
Python version 2.7 or newer.
Download¶
There are no file releases. You get the most up to date version from the Git repository.
PyLit¶
Download the repository snapshot as zip file or the single files
- pylit.py
The actual PyLit module.
- pylit
A simple starter and configuration wrapper (see section Installation below).
- pylit_test.py
unit tests for the pylit module
Tools¶
Docutils or Sphinx for conversion of reStructuredText to HTML or PDF (not strictly required by PyLit but needed for “pretty printing” the text source)
pylit mode for the JED editor
Installation¶
As PyLit is a pure Python module, installation is straightforward:
Put pylit.py in Python’s Module Search Path.
You can now call the script with
python -m pylit OPTIONS INFILE [OUTFILE]
or
python -m pylit --help
Easier invocation is possible with a small executable wrapper in the binary PATH. On Unix you can use a script like pylit:
#!/usr/bin/env python # Load the pylit module:: import pylit # Configure default settings, e.g. :: ## pylit.defaults.code_block_marker['c++'] = '.. code-block:: c++' ## pylit.defaults.languages['.def'] = 'latex' ## pylit.defaults.languages['.dfu'] = 'latex' # call the text <--> code converter:: pylit.main()
This has two advantages:
Command line use is simplified.
Default settings can be customised without changing the module file.