Metadata-Version: 2.1
Name: Quart-Cmark
Version: 0.1.1
Summary: Add commonmark processing filter to your Quart app.
Home-page: https://gitlab.com/doug.shawhan/quart-cmark
Author: Doug Shawhan
Author-email: doug.shawhan@gmail.com
Maintainer: Doug Shawhan
Maintainer-email: doug.shawhan@gmail.com
License: Copyright 2019 Doug Shawhan
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        
Project-URL: Bug Tracker, https://gitlab.com/doug.shawhan/quart-cmark/issues
Project-URL: Source Code, https://gitlab.com/doug.shawhan/quart-cmark/tree/master
Project-URL: Development Version, https://gitlab.com/doug.shawhan/quart-cmark/tree/dev
Project-URL: Documentation, https://quart-cmark.readthedocs.io
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE

# quart-cmark

Add [CommonMark](https://commonmark.org/) processing [filter](http://jinja.pocoo.org/docs/2.10/templates/#filters) to your `Quart` app, using [paka.cmark](https://github.com/kapyshin/paka.cmark) because why should I do any work?

`paka.cmark` uses the [commonmark/cmark](https://github.com/commonmark/cmark) reference implementation, so it should render anything outlined in the [CommonMark Spec](https://spec.commonmark.org/) lickety-split. 

Source code may be found at [Gitlab](https://gitlab.com/doug.shawhan/quart-cmark).

Docs at [readthedocs](https://quart-cmark.readthedocs.io).

# Installation

```bash
pip install Quart-Cmark
```

# Usage

## Script

```python
from quart_cmark import Cmark
cm = Cmark(app)
```

or, if you are using factory pattern:

```python
from quart_cmark import Cmark
cm = Cmark()
cm.init_app(app)
```

Create routes in the usual way:
```python
@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
<html>
{{mycm|commonmark}}
</html>
```

### Block-style

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

## Autoescape

Jinja2's autoescape works when declared at init. See [tests](https://gitlab.com/doug.shawhan/quart-cmark/blob/master/tests/test_cmark.py) for examples.

## Tests

`pytest`
