This django app provides some features for handling markdown in yout django based website:
template_tags for parsing Markdown code to html and cleaning it
A form field for editing markdown code and preview the html output
Installation
Dependencies
This app use misaka, a binding for hoedown that use CFFI. You may need to install some package in order to build cffi
On fedora (adapt for your on system or the version of python you xant to use)
dnf install libffi-devel python3-devel
# on fedora, you may need to install this
dnf install redhat-rpm-config
The actual installation
Just install it with pip
pip install django-ml_markdown
Usage
settings.py
Add the path to the configuration class in INSTALLED_APPS
INSTALLED_APP.append(
'ml_markdown.apps.MlMarkdownConfig'
)
you can also inherit this class for custom settings. See the documentation for details.
Use in templates
You can use one of this filters in your templates:
to_html: parse markdown code to html without cleaning it.
clean: clean html code with the white list provides as arguments or in the class used for configuration
to_cleaned_html: shortcut for| to_html | clean
Some over filter can be found in the documentation.
Release files for django-ml_markdown 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-ml_markdown-0.1.0.tar.gz | 4.6 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_ml_markdown-0.1.0-py3.5.egg | Legacy Egg format | - | - | Details |
| django_ml_markdown-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.2 kB
Release files / django-ml_markdown-0.1.0.tar.gz
| Download URL | django-ml_markdown-0.1.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3e29064ac06a02afea301d75dc0128e44c09eb298356bc967a668977865160f
|
|
BLAKE2b-256 checksum How to use checksums |
d963cd2f058ed1bfc3d3cccc61839f8d123afbc988fd1039fefbcf0895dfb1aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_ml_markdown-0.1.0-py3.5.egg
| Download URL | django_ml_markdown-0.1.0-py3.5.egg |
|---|---|
| Size | 11.1 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
db76a67654fd2958659bee30271e7fe48f8c1846e011405a522defe0456d6576
|
|
BLAKE2b-256 checksum How to use checksums |
b4a1973332c3376fabd6c5b7d158cd292e424442ffc8d95349539deca4c89ea0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_ml_markdown-0.1.0-py3-none-any.whl
| Download URL | django_ml_markdown-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23e3981ea037fb5b51ab8effb3aab913a50753f1f91db660f728b268e24e1420
|
|
BLAKE2b-256 checksum How to use checksums |
21cb5150ed7294c0305226e4c003e998f6620d5f1d1d9ad3a797a3c5bf9c093f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |