Add commonmark processing filter to your Quart app.
Project description
quart-cmark
Add CommonMark processing filter to your Quart
app, using paka.cmark because why should I do any work?
paka.cmark
uses the commonmark/cmark reference implementation, so it should render anything outlined in the CommonMark Spec lickety-split.
Source code may be found at Gitlab.
Docs at readthedocs.
Installation
pip install Quart-Cmark
Usage
Script
from quart_cmark import Cmark
cm = Cmark(app)
or, if you are using factory pattern:
from quart_cmark import Cmark
cm = Cmark()
cm.init_app(app)
Create routes in the usual way:
@app.route("/markdown-fest")
async def markdown_fest():
mycm = u"Hello, *commonmark* block."
return await render_template("markdown-fest.html", mycm=mycm)
Template
Inline-style
<html>
{{mycm|commonmark}}
</html>
Block-style
<html>
{% filter commonmark %}
{{mycm}}
{% endfilter %}
</html>
Autoescape
Jinja2's autoescape works when declared at init. See tests for examples.
Tests
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Quart-Cmark-0.1.2.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file Quart-Cmark-0.1.2.tar.gz
.
File metadata
- Download URL: Quart-Cmark-0.1.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ad680c3959e10bf1704385dc3e51fcc37f69ee87cfb36303c0528276ba3fa1b |
|
MD5 | c194a7a5376b40beb2c5cb611b495444 |
|
BLAKE2b-256 | c29ddc59a84105e8aef039e17099b72788f29e3f6fe5f68ee66317c4c701c570 |
File details
Details for the file Quart_Cmark-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: Quart_Cmark-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec8cc8cfa8afbd32df0d55a5682cbf0f329e902061788b25d4bb1c36717e5d54 |
|
MD5 | 6b72478ad8717cf71843ef3b35940a86 |
|
BLAKE2b-256 | a2ac4bf3528db3dacc2267e22aa085575cbb4d9aaf593a2a98172223023c2f7d |