Markowik

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

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
Caveats.

Programmatic

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:

Note that the meta extension has to be enabled explicitly, i.e. by default
Markowik does not recognize page pragmas.

Caveats

GCW cannot express all markup possible in Markdown. This means Markdown source
files should be written with the following limitations in mind.

URLs in Links and Images

URLs used for links or image sources have to be absolute and must have a
specific protocol to get recognized by GCW. In particular, any URL must start
with http://, https://, or ftp://. Markowik aborts the conversion
if it finds URLs not matching these requirements.

Typefacing in Link Names

GCW does not support typefacing in link names. For instance GCW renders the
link name in [http://foo.com _Foo_] literally, i.e. as _Foo_. However,
GCW recognizes typefacing in HTML links, i.e. <a
href="http://foo.com">_Foo_</a&gt; is emphasized properly. For this reason
Markdown links with nested typefacing like [*Foo*](http://foo.com) will be
converted to HTML links. As a result, link labels with certain special
characters which have to be escaped in GCW using backtick (`) markers will
also result in HTML links.

Nested Paragraphs

GCW does not really support multiple nested paragraphs (e.g. in lists or
blockquotes). Markowik simulates multiple nested paragraphs by separating them
with a <br/> (which visually mimics paragraphs but does not break the
nesting environment).

Images

Markdown allows to express alternative and title texts for images. GCW's image
syntax does not support this. The only way to preserve these texts is to use
plain HTML <img> tags. The option --html-images enables this
workaround.

Abbreviations

GCW has no markup for abbreviations nor does it support the HTML tag
<abbr>. Markowik converts abbreviations to <span>-elements which kind
of mimics abbreviations (in a limited fashion of course).

HTML

Any plain HTML occurring in a Markdown source ends up literally in GCW (with
the exception of the content of span-level tags). This means the Markdown
source should only contain HTML supported by GCW. Another implication is
that URLs used in plain HTML tags are not checked for GCW compatibility. In
other words: when using raw HTML you are on your own!

Every fix or new feature should include one or more corresponding test cases
(check the existing tests for how tests should look like). Please also post
an issue describing your fix or enhancement.

Markowik uses Buildout to easily set up the development environment.
Buildout automates the process of downloading and installing requirements to
use and develop Markowik. Requirements are installed local to the project
source directory, i.e. it does not clutter the system Python installation.

Version 0.2

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.

Version 0.1.2

Explicitly require PyMD 2.0.3 (this is a temporary fix until
markowik correctly works with PyMD 2.1). Note: If this
conflicts with requirements of other Python packages, run markowik in its
own buildout as described above.