Package creoleparser
[hide private]
[frames] | no frames]

Package creoleparser

source code

This is a Python implementation of a parser for the Creole wiki markup language. The specification of that can be found at http://wikicreole.org/wiki/Creole1.0

Basic Usage

>>> from creoleparser import text2html

Simply call the text2html() function with one argument (the text to be parsed):

>>> print text2html("Some real **simple** mark-up"),
<p>Some real <strong>simple</strong> mark-up</p>

To customize things a little, create your own dialect and parser:

>>> from creoleparser.dialects import Creole10
>>> from creoleparser.core import Parser
>>> my_dialect=Creole10(wiki_links_base_url='http://www.mysite.net/',
... interwiki_links_base_urls=dict(wikicreole='http://wikicreole.org/wiki/'))
>>> my_parser = Parser(dialect=my_dialect)
>>> print my_parser("[[Home]] and [[wikicreole:Home]]"),
<p><a href="http://www.mysite.net/Home">Home</a> and <a href="http://wikicreole.org/wiki/Home">wikicreole:Home</a></p>

If you want pure Creole 1.0 (i.e., no additions), use creole2html() instead of text2html().

Submodules [hide private]

Functions [hide private]
 
_test() source code
Variables [hide private]
  creole2html = Parser(dialect= Creole10(wiki_links_base_url= 'h...
This is a pure Creole 1.0 parser created for convenience
  creole_to_xhtml = Parser(dialect= Creole10(wiki_links_base_url...
Same as creole2html
  text2html = Parser(dialect= Creole10(wiki_links_base_url= 'htt...
This is a Creole 1.0 parser (+ additions) created for convenience
Variables Details [hide private]

creole2html

This is a pure Creole 1.0 parser created for convenience
Value:
Parser(dialect= Creole10(wiki_links_base_url= 'http://www.wikicreole.o\
rg/wiki/', interwiki_links_base_urls= {'Ohana': 'http://wikiohana.net/\
cgi-bin/wiki.pl/'}, use_additions= False, no_wiki_monospace= True))

creole_to_xhtml

Same as creole2html
Value:
Parser(dialect= Creole10(wiki_links_base_url= 'http://www.wikicreole.o\
rg/wiki/', interwiki_links_base_urls= {'Ohana': 'http://wikiohana.net/\
cgi-bin/wiki.pl/'}, use_additions= False, no_wiki_monospace= True))

text2html

This is a Creole 1.0 parser (+ additions) created for convenience
Value:
Parser(dialect= Creole10(wiki_links_base_url= 'http://www.wikicreole.o\
rg/wiki/', interwiki_links_base_urls= {'Ohana': 'http://wikiohana.net/\
cgi-bin/wiki.pl/'}, use_additions= True, no_wiki_monospace= False))