Revision 3 as of 2007-07-25 18:39:03

Clear message

PyTextile

[http://pypi.python.org/pypi/textile PyTextile] is a very easy to use text-to-HTML converter.

You can see [http://www.textism.com/tools/textile/ a demonstration of Textile,] which can convert this:

_This_ is a *test.*

* One
* Two
* Three

Link to "Slashdot":http://slashdot.org/

to this:

        <p><em>This</em> is a <strong>test.</strong></p>
 
 
<ul>
        <li>One</li>
        <li>Two</li>
        <li>Three</li>
</ul>
 
        <p>Link to <a href="http://slashdot.org/">Slashdot</a></p>

Using PyTextile

First, [http://dealmeida.net/code/textile-1.13.tgz download PyTextile 1.3.]

Untar it, and enter the textile directory. Start a python interpreter.

Type:

   1 import textile
   2 
   3 s = """
   4 _This_ is a *test.*
   5 
   6 * One
   7 * Two
   8 * Three
   9 
  10 Link to "Slashdot":http://slashdot.org/
  11 """
  12 
  13 html = textile.textile( s )
  14 
  15 print html

You'll see beautiful HTML on the other side, ready for inclusion in a web page. :)

See Also:

ReStructuredText is another text-to-HTML converter.

Discussion

(none yet!)

Unable to edit the page? See the FrontPage for instructions.