Requirements

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

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:

    1. Command line use is simplified.

    2. Default settings can be customised without changing the module file.