#!C:/dev/python25/python.exe # coding: utf-8 """ >>> test_wordml(''' ... ---------- ... Table Test ... ---------- ... ... This document contains a table and is meant to test the spans and what not. ... ... Title ... ----- ... ... +---------+--------+--------+--------+ ... | Cell 1 | Cell 2 | Cell 3 | Cell 4 | ... +---------+--------+--------+--------+ ... | This | is a test of | joined | ... + +--------+--------+--------+ ... | cells | and ho | they | work | ... +---------+--------+--------+--------+ ... ... This is some closing text just to surround the table with something for effect. ... ... This is *emphasized text*. ... ... This is a footnote reference [#]_. ... ... .. [#] This is a footnote text. ... ''') Table Test This document contains a table and is meant to test the spans and what not. Title Cell 1 Cell 2 Cell 3 Cell 4 This cells is a test of joined and ho they work This is some closing text just to surround the table with something for effect. This is emphasized text . This is a footnote reference This is a footnote text. . """ from docutils import core, io def test_wordml( input_string ): overrides = { 'template' : '../template.xml' } parts = core.publish_string( input_string, writer_name='docutils_wordml', settings_overrides=overrides ) print parts def _test(): import doctest doctest.testmod() if __name__ == "__main__": _test()