{{ Toc( float='right' ) }}

h3. Overview

EazyText is a wiki processor that translates wiki text to html. It is built
using formal parser grammar, making it both robust and clean. By default
the processor supports dynamic text (text that are translated based on
context), inspite of which it is insanely fast. It is available as,
* Stand-alone command line tool
* Library package usable by python programs

h3. Installation

Installing via package management

{{{ Code bash
  # -Z to do unzipped install. The reason for installing it in un-zipped form
  #    is to make use of the command line tool.
  # -U to upgrade install
  easy_install -Z -U eazytext
}}}

''Source code''

Download the latest tar.gz from http://pypi.python.org/pypi/eazytext

Check out from bazaar repository,
{{{ Code bash
  bzr branch lp:eazytext
}}}

h3. Command line usage

Make sure that eazytext package is installed in your environment (using
easy_install) or available via //PYTHONPATH//. 
''eazytext/eztext.py'' script under eazytext-package can be used as command
line tool. Either invoke it from its original path, or create a symbolic link
to a bin/ directory.

script-file:    <site-package>/eazytext/eztext.py

symbolic link to your binary path, like,

{{{ Code bash

    ln -s <site-package>/eazytext/eztext.py $(HOME)/bin/eztext.py
    # or,
    ln -s <site-package>/eazytext/eztext.py /usr/bin/eztext.py

}}}

Once `eztext.py` is available as an executable command and `eazytext` module 
in your python path, use the command-line tool, like,

{{{ Code bash

  eztext.py -o <out-file> <wiki-file>
  # For more help, try
  eztext.py -h

}}}
   
h3. Using it as python library

{{{ Code python
    from   eazytext  import Translate

    # To translate a wiki-file, 
    t = Translate( etxloc=wikifile, etxconfig=etxconfig )
    # To translate a wiki-text (incase it is not present in a file),
    t = Translate( etxtext=wikitext, etxconfig=etxconfig )
    # In both the cases the configuration parameters can passed via `etxconfig`
    # as a dictionary

    # Get the translated html,
    html = t( context=context )
    codecs.open( htmlfile, mode='w', encoding=encoding).write( html )
}}}
  
By browsing the source-doc you can learn more about development with EazyText.

h3. Development

It is always better to setup the development tree under a virtual environment.
To begin with, first checkout the source tree from the latest repository tree
and then use the ''make'' command to create a development environment.

{{{ Code sh
  cd eazytext
  make develop
}}}

which,
* sets-up a virtual environment under // eazytext-env/ // directory.
* Installs eazytext under the virtual environment in development mode,
  [<PRE python ./setup.py develop >]

To start using the eazytext package, enter the virtual environment by doing,
``{c} source ./eazytext-env/bin/activate ``

''To create egg packages'',

{{{ Code bash

  make bdist_egg        # For creating binary distribution
  make sdist            # For creating source distribution

}}}

The .egg package will be available under dist/ directory

''To test the package'',

{{{ Code bash

  source eazytext-env/bin/activate
  make test

}}}

''Finally, Build the egg and upload it into pypi''

{{{ Code bash

  make upload

}}}

-----

{{{ Nested 
# { 'font-size' : 'small', 'color' : 'gray' }
Document edited using Vim <br>
/* vim: set filetype=etx : */
}}}

