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 hashes)
Built Distribution
Close
Hashes for Quart_Cmark-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec8cc8cfa8afbd32df0d55a5682cbf0f329e902061788b25d4bb1c36717e5d54 |
|
MD5 | 6b72478ad8717cf71843ef3b35940a86 |
|
BLAKE2b-256 | a2ac4bf3528db3dacc2267e22aa085575cbb4d9aaf593a2a98172223023c2f7d |