Skip to content

sebix/python-textile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

23e7746 · Jan 25, 2020
Jan 12, 2020
Jan 25, 2020
Jan 25, 2020
Apr 22, 2018
Jan 25, 2020
Jan 25, 2020
Jan 12, 2020
Jun 29, 2010
Apr 13, 2017
Jan 12, 2020
Jan 4, 2013
Nov 23, 2015
Jan 12, 2020
Jan 12, 2020

Repository files navigation

python-textile

python-textile is a Python port of Textile, Dean Allen’s humane web text generator.

Installation

pip install textile

Dependencies:

  • html5lib
  • regex (The regex package causes problems with PyPy, and is not installed as a dependency in such environments. If you are upgrading a textile install on PyPy which had regex previously included, you may need to uninstall it.)

Optional dependencies include:

  • PIL/Pillow (for checking image sizes). If needed, install via pip install 'textile[imagesize]'

Usage

import textile
>>> s = """
... _This_ is a *test.*
...
... * One
... * Two
... * Three
...
... Link to "Slashdot":http://slashdot.org/
... """
>>> html = textile.textile(s)
>>> print html
	<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>
>>>

Notes:

  • Active development supports Python 3.5 or later.