A generic Django application to convert text with specific markup to html.
Project description
📖 Full documentation on https://django-markup.readthedocs.io/en/latest/
django-markup
This app is a generic way to provide filters that convert text into html.
Compatibility Matrix:
Py/Dj |
3.7 |
3.8 |
3.9 |
3.10 |
3.11 |
---|---|---|---|---|---|
3.2 (LTS) |
✓ |
✓ |
✓ |
✓ |
✓ |
4.0 |
✓ |
✓ |
✓ |
✓ |
|
4.1 |
✓ |
✓ |
✓ |
✓ |
|
4.2 (LTS) |
✓ |
✓ |
✓ |
✓ |
Quickstart
Download and install the package from the python package index (pypi):
$ pip install django-markup
Note that django-markup ships with some filters ready to use, but the more complex packages such as Markdown or ReStructuredText are not part of the code. Please refer the docs which packages are used for the built-in filter.
An alternative is to install django-markup with all filter dependencies right away. Do so with:
$ pip install django-markup[all_filter_dependencies]
Then add it to the INSTALLED_APPS list:
INSTALLED_APPS = ( ... 'django_markup', )
Use it in the template:
{% load markup_tags %} {{ the_text|apply_markup:"markdown" }}
Or in Python code:
from django_markup.markup import formatter formatter('Some *Markdown* text.', filter_name='markdown')
Testsuite
To run the testsuite install the project with pipenv and run it:
% pipenv install --dev $ pipenv run test
You can also test against a variation of Django and Python versions using tox:
$ tox
Changelog
v1.8 (2023-10-07):
Drop support for Python <3.8.
Added support for Python 3.12 and Django 5.0.
Type Annotations.
v1.7.2 (2023-05-01):
Fixed a setup.cfg bug that defined the minimal Django version to be v3.7 which does not exist. The correct version is 3.2.
v1.7.1 (2023-04-25):
Fixed Python classifiers in setup.cfg.
v1.7 (2023-04-25):
Django 4.2 compatibility and tests.
Python 3.11 compatibility and tests.
v1.6 (2022-08-14):
Dropped support for Django <3.2 and Python <3.7.
Django 3.2 (LTS) compatibility and tests.
Django 4.0 compatibility and tests.
Django 4.1 compatibility and tests.
Python 3.9 compatibility and tests.
Python 3.10 compatibility and tests.
v1.5 (2020-06-12):
Dropped support for Django <=1.11 and Python <=3.5.
Python 3.8 compatibility and tests.
Django 3.0 compatibility and tests.
bleach-whitelist dependency is no longer necessary as tags are now shipped with the built-in markdown filter.
Uses pytest for testing.
v1.4 (2019-03-15):
Markdown’s safe_mode was deprecated and no longer functional, it’s behavior was replaced with bleach.
Pipfile support for local development and general code cleanup.
v1.3 (2018-09-07):
Python 3.6 and 3.7 compatibility and tests.
Django 2.0 and 2.1 compatibility and tests.
The package setup script now provides the ability to install all filter dependencies automatically. See the installation Readme for details.
v1.2 (2017-03-18):
Django 1.10 compatibility and tests.
Updated all filter dependencies. most notably SmartyPants to v2.0 which changed it’s API, so your project dependencies need to update it as well.
v1.1 (2016-05-02):
The Markdown filter has the safe_mode option enabled by default.
The RestructuredText filter has the file and raw content inclusion disabled by default.
v1.0 (2016-01-02):
Removed some 5 year old dust
Django 1.8+ compatible
Tests
Backwards incompatible changes:
Removed Pygments highlighting in the Markdown and RestructuredText filter.
Removed CreoleParser library in favor of a pypi package.
Removed Lightbox filter.
The RestructuredText filter now renders level 1 and 2 headers. See Github Issue 14 for details and a backwards compatible workaround.
v0.4 (2011-06-01):
Added a widont filter
MarkupField is South compatible.
Tested with Django 1.3
v0.3 (2009-07-29):
django-markup now ships with a builtin creole parser. Advantage is, that the recently used Creoleparser library needs the Genshi lib, which needs a c-compiler and so on. The builtin creole parser is a pure python library without any dependencies and follows the wikicreole.org specifications. django-markup uses the WikiCreole library.
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
Built Distribution
File details
Details for the file django-markup-1.8.tar.gz
.
File metadata
- Download URL: django-markup-1.8.tar.gz
- Upload date:
- Size: 39.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a729b9c68a5552c3f94e029cd437f9ac44af6f58fb73301521fd49c6d3b6198a |
|
MD5 | 9a16130e2ca7547b025039978a5931fa |
|
BLAKE2b-256 | 68712669c3d61799c3d47b29cef54ad93301c4f44f982bde6c78c8f69b5b4da8 |
File details
Details for the file django_markup-1.8-py2.py3-none-any.whl
.
File metadata
- Download URL: django_markup-1.8-py2.py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee208c3256a90a4d32af6d0535d2a0bbe30b40b891d0c25dd93f26c0a4ca5d2f |
|
MD5 | ddf3e1c2a8b319332f63ace198e1b94c |
|
BLAKE2b-256 | e9a868ea677180d561b9f56a4eae314148e754a93e035adc6539760651e671c7 |