The Python port of Dean Allen's humane web text generator packaged for use with Flask.
pip install flask-textile
Import into our project:
from flask_textile import Textile
And then...
app = Flask(__name__)
textile = Textile(app)
Or, if one prefers, with an application factory:
textile = Textile()
def create_app(config_class=Config):
app = Flask(__name__)
app.config.from_object(config_class)
textile.init_app(app)
#...
Simple usage within a Jinja2 template:
{{ text|textile }}
Or use as a filter:
{% filter textile %}
h2. Textile
* is a _shorthand syntax_ used to generate valid HTML
* is *easy* to read and *easy* to write
* can generate complex pages, including: headings, quotes, lists, tables and figures
Textile integrations are available for "a wide range of platforms":/article/.
{% endfilter %}
Additionally, Flask-Textile offers a static method, parse(), which returns a raw HTML sting from Textile input—i.e. the direct output of python-textile. (Useful for working with Textile outside of a template):
from flask_textile import Textile
Textile.parse(text)
# Or if you already have an instance laying around...
app = Flask(__name__)
textile = Textile(app)
#...
textile.parse(text)
Metadata
Release files for Flask-Textile 0.4.1.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-Textile-0.4.1.post1.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_Textile-0.4.1.post1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.7 kB
Release files / Flask-Textile-0.4.1.post1.tar.gz
| Download URL | Flask-Textile-0.4.1.post1.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88045821b61b36a575ef86c130459b98426d2f060e94ed8b7c312d654b9f7af5
|
|
BLAKE2b-256 checksum How to use checksums |
ee77eed21ce49ce73c99a25482b08a0a2934aebf8e19312dc214f9f37a570792
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
|
Release files / Flask_Textile-0.4.1.post1-py3-none-any.whl
| Download URL | Flask_Textile-0.4.1.post1-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a53e5ef3c080baa8d097414f75634ef23d82a73527b1608ec1eb4724a022274d
|
|
BLAKE2b-256 checksum How to use checksums |
2b401b863f597909e3ac5555dfb6e1a3f84a22adbe7403683c72290e7d0afeb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
|