Markowik 0.2

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, 18:55 GMT
license type:
MIT/X Consortium License 
developed by:
Oben Sonne
ROOT \ Text Editing&Processing \ Markup
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!
What's New in This Release:
  • Markowik now supports (and requires) PyMD ≥ 2.1. Next to minor API changes PyMD 2.1 also had some changes and improvements in its conversion process -- for details, check how tests have been adjusted for PyMD 2.1.
read full changelog

Add your review!