#!C:/dev/python25/python.exe # coding: utf-8 """ >>> test_wordml(''' ... ***** ... Title ... ***** ... ... -------- ... Subtitle ... -------- ... ... :Author: Alan G. Isaac ... :Contact: aisaac@american.edu ... :Organization: Department of Economics, American University ... ... ... Introduction ... ************ ... ... Some text, up to a 'note'. [#note1]_ ... More text. ... ... Just unindent to see problem. Comment it out again by indenting. ... ... First Term ... Some definitional text without a note. ... No problem. ... ... Second Term ... Some definitional text with a note. ... This is a problem. ... [#problem]_ ... ... Another Section ... *************** ... ... A paragraph with a note containing a reference. ... No problem. [#notewithref]_ ... ... .. figure :: test3.png ... ... Two waves doing *something*. ... ... Conclusion ... ********** ... ... That's all folks. ... ... . Links ... ... .. _Python: http://www.python.org ... ... .. [#notewithref] ... Use Python_. ... ... .. [#note1] ... A detailed discussion of the note. ... ... .. [#problem] ... Details can be found in, ... which contains a much cited algorithm for the Mersenne Twister. ... ''') Title Subtitle Alan G. Isaac aisaac@american.edu Department of Economics, American University Introduction Some text, up to a 'note'. A detailed discussion of the note. More text. Just unindent to see problem. Comment it out again by indenting. First Term Some definitional text without a note. No problem. Second Term Some definitional text with a note. This is a problem. Details can be found in, which contains a much cited algorithm for the Mersenne Twister. Another Section A paragraph with a note containing a reference. No problem. Use Python . Figure 1 Two waves doing something . Conclusion That's all folks. . Links """ 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()