0.2 MIT/X Consortium License    
  not rated
Convert Markdown to Google Code Wiki





Markowik is a Python app that converts Markdown formatted text to Google Code Wiki.

Markowik is able to convert most Markdown constructs to its Google Code Wiki (GCW) equivalents. Instead of listing all supported conversions, please have a look at Markowik's test suite and its show case.



pip install markowik


easy_install markowik

You can also use Markowik without installation, as described under Contribute.

Command Line Usage

From the help output:

usage: markowik [-h] [--mx [MX [MX ...]]] [--image-baseurl URL]
 [--html-images] [--encoding ENCODING] [--quiet]

Convert Markdown to Google Code Wiki.

positional arguments:
 INFILE markdown file
 OUTFILE wiki file (default: stdout)

optional arguments:
 -h, --help show this help message and exit
 --mx [MX [MX ...]] markdown extensions to activate
 --image-baseurl URL base URL to prepend to relative image locations
 --html-images always use HTML for images
 --encoding ENCODING encoding of input and output (default: UTF8)
 --quiet disable info messages

Markdown extensions may be given similarly as to the Python Markdown (PyMD) command line tool, with the exception that individual extensions must be separated by a space:

markowik INPUT --mx tables def_list

The currently supported (i.e. tested) extensions are abbr, tables, and def_list. Other extensions generally should work too but might yield unexpected results in the converted wiki text.

Concerning the option --html-images, see the explanations below at Limitations.

Programmatic Usage

Markowik is implemented in Python. The markowik module provides a function named convert. Semantically it is similar to the command line interface (keyword arguments correspond to command line options). Here's a short usage example:

>>> import markowik
>>> markowik.convert("Some *markdown* text ...", mx=['tables'])
u'Some _markdown_ text ...'

Page Pragmas

GCW page pragmas can be set in Markdown source files as meta data in the format defined by the PyMD meta extension:

>>> src = """Summary: page summary
... Labels: some, labels
... Here starts the *page* ..
... """
>>> print markowik.convert(src, mx=['meta'])
#summary page summary
#labels some, labels
Here starts the _page_ ..

Note that the meta extension has to be enabled explicitly, i.e. by default Markowik does not recognize page pragmas.
Last updated on January 24th, 2012

0 User reviews so far.