Skip to main content

flask-commonmark

Add CommonMark processing filter to your Flask app.

One may notice a similarity to Dan Colish's Flask-Markdown, from which I shamelessly copied a bunch of this. Does not have all the nice provisions for extension baked in, but probably does what you need.

Source code may be found at Gitlab.

Docs at readthedocs.

Installation

pip install Flask-Commonmark

If pip is not available on your system, use:

easy_install Flask-Commonmark

Usage

Script

from flask_commonmark import Commonmark
cm = Commonmark(app)

or, if you are using factory pattern:

cm = Commonmark()
cm.init_app(app)

Create routes in the usual way:

@app.route("/commonmark")
def display_commonmark():
    mycm = u"Hello, *commonmark* block."
    return render_template("commonmark.html", mycm=mycm) 

Template

Inline-style

<html>
{{mycm|commonmark}}
</html>

Block-style

<html>
{% filter commonmark %}
{{mycm}}
{% endfilter %}
</html>

Autoescape

Jinja2's autoescape works as expected. See tests for examples.

Tests

python setup.py test or nosetests

Metadata

Release files for Flask-Commonmark 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-Commonmark 1.0.4
File Size Uploaded Provenance
Flask-Commonmark-1.0.4.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-Commonmark 1.0.4
File Interpreter ABI Platform
Flask_Commonmark-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / Flask-Commonmark-1.0.4.tar.gz

Download URL Flask-Commonmark-1.0.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9cc24bd74d9f2611a3869c5b311a6efc6287f5dbb4b2ff67511776fb14fa2914
BLAKE2b-256 checksum
How to use checksums
0ffc94259ecee4d39ed98b641d1c67a3bc2ddcd9c07e1bbcfc9440e7937840a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.3

Release files / Flask_Commonmark-1.0.4-py3-none-any.whl

Download URL Flask_Commonmark-1.0.4-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03ab495bc331c51dacaa3e92e2e8c62427f0b4053ec327f5058528bc8d28db1a
BLAKE2b-256 checksum
How to use checksums
df1796e55c4909ce0c6f8655f3d1abcb7d850ce361b46717235f195a5bc767a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.3

Security for Flask-Commonmark 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page