
HIGHLIGHT PYTHON BINDING - README

The higlight module allows the easy usage of highlight from withon Python scripts.
The module requires Python 2.3 and above.


Installation:
-------------

a) Run "python2.3 setup.py build" to compile it and place the module 
   library in a new subdirectory (optional)
b) Run "python2.3 setup.py install" as root to compile it (if build 
   was not run) and place the module library in the site-packages 
   directory of the Python installation


Overview of methods and constants:


Constructor:
------------

CodeGenerator(int outputformat, string stylepath, string cssinfile, string cssoutfile, 
              bool includecss, bool attachanchors, bool fopcompatible, bool replacequotes)
	      
	      

    @param   outputformat Output text format 
                         (range= highlight.HTML, highlight.HTML, highlight.XHTML, 
			         highlight.TEX,  highlight.LATEX, highlight.XSL,  
                                 highlight.RTF, highlight.ANSI)
    @param   stylepath Path to highlight colour theme definition

    Optional parameters:

    @param   cssinfile      Path to file to be included in cssoutfile (only HTML, XHTML) 
    @param   cssoutfile     Path to external css file (only HTML, XHTML)  
    @param   includecss     Switch to include CSS inevery output document 
                            (default: false) (only HTML, XHTML) 
    @param   attachanchors  Switch to attach HTML anchors to line numbers
                            (default: false) (only HTML, XHTML)
    @param   fopcompatible  Switch to generate FO code for Apache FOP  
                            (default: false) (only XSL)
    @param   replacequotes  Switch to replace quotes by /dq{}
                            (default: false) (only LATEX)                                
    @param printlinenumbers Switch to enable line number output (default: false)     
    @param fillzeroes       Switch to fill leading spyce of line numbers with zeroes 
                            (default: false)
    @param fragment         Switch to omit header and footer of the output document
                            (default: false)
    @param numberspaces     Number of spaces which replace a tab 
                            (range: 0..8; default: 2)
    @param wrappingstyle    Line wrapping style (range: highlight.WRAP_DISABLED,  
                            highlight.WRAP_SIMPLE, highlight.WRAP_DEFAULT;
                            default: highlight.WRAP_DISABLED)


Methods:
--------

int initLanguage(string langDef)

    @param   langDef Path of highlight language definition
    @return  highlight.LOAD_FAILED: definition not found   
             highlight.LOAD_NEW:    definition loaded successfully   
	         highlight.LOAD_NONE:   reload not necessary
             highlight.MODULE_ERROR: function call failed 

----------------------------------------------------------------------

int initIndentationScheme(string scheme)

    @param   scheme Path of highlight indentation scheme
    @return  true : success
             false: failure

----------------------------------------------------------------------

bool printOutput(string inFile, string outFile, [ bool printlinenumbers, bool fillzeroes,
                 bool fragment, int numberspaces, int wrappingstyle ] )

     @param inFile Input source file (uses stdin if empty)
     @param outFile Destination file (uses stdout if empty)
     
     @return highlight.PARSE_OK,           success
             highlight.PARSE_BAD_INPUT,    could not write inFile 
             highlight.PARSE_BAD_OUTPUT,   could not write outFile 
             highlight.PARSE_BAD_STYLE     stylePath not found
             highlight.MODULE_ERROR:       function call failed 

----------------------------------------------------------------------

bool printExternalStyle(string cssOut)
     @param cssOut Destination css file
     @return True if successful

----------------------------------------------------------------------    

int getOutputFormat()

    @return output format
    


Constants:
----------

HTML XHTML TEX LATEX XSL RTF ANSI

VERSION

WRAP_DISABLED WRAP_SIMPLE WRAP_DEFAULT

LOAD_FAILED LOAD_NEW LOAD_NONE

PARSE_OK PARSE_BAD_INPUT PARSE_BAD_OUTPUT PARSE_BAD_STYLE

MODULE_ERROR
