Skip to main content

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


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)

Uploaded Source

Built Distribution

Quart_Cmark-0.1.2-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page