Skip to main content

A generic Django application to convert text with specific markup to html.

Project description

https://travis-ci.org/bartTC/django-markup.svg?branch=master https://codecov.io/github/bartTC/django-markup/coverage.svg?branch=master

django-markup

This app is a generic way to provide filters that convert text into html.

The documentation is available at https://docs.elephant.house/django-markup/

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
$ pipenv run ./runtests.py

You can also test against a variation of Django and Python versions using tox:

$ tox

Changelog

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-markup-1.4.1.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

django_markup-1.4.1-py2.py3-none-any.whl (15.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-markup-1.4.1.tar.gz.

File metadata

  • Download URL: django-markup-1.4.1.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for django-markup-1.4.1.tar.gz
Algorithm Hash digest
SHA256 bd2ca1c61555d92d329bd5e8c237c938ffe8eabea02fe0ebbba093d4ec524f67
MD5 39e91081db1e9d10e8bc99e78191fdce
BLAKE2b-256 7bb69a306aa5ce38ea37afa3d63fd82c506ca3a3b44f46867d84781e2ec6aacc

See more details on using hashes here.

File details

Details for the file django_markup-1.4.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_markup-1.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for django_markup-1.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6edfadaa56d139f8dab3496a99f3bb54972057317a53099ecaefa76f9264bfa1
MD5 7cab73f769caaeafa0a9dec67d7a60ce
BLAKE2b-256 46321c382d295fb45c34116e3705c7eb1d52533b08eee505d5c2ae35280e0615

See more details on using hashes here.

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