Skip to main content

A Django template filter application to highlight code with Pygments

Project description

PyPI version Build status

Django Pygmentify is a Django template filter application to highlight code with Pygments.

It is an alternative to Django Pygments, which hasn’t been updated in several years.

Install

$ pip install django-pygmentify

Add to settings.py.

INSTALLED_APPS = [
    # ...
    'pygmentify',
]

Usage

{% load pygmentify_tags %}

<link rel="stylesheet" href="{% pygmentify_css %}">

{% filter pygmentify %}
<pre class="python"><code>
print('Hello, world!')
</code></pre>
{% endpygmentify %}

Result:

<div class="highlight"><pre class="python"><code><span></span><span class="k">print</span><span class="p">(</span><span class="s2">&quot;Hello, world!&quot;</span><span class="p">)</span>
</code></pre></div>

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-pygmentify-0.2.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file django-pygmentify-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-pygmentify-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e0ebb6b48be319a45442e16dae3a6d2ccfd2bd670a6dbea179fe98cbdad5b04f
MD5 d15f079d3fdde0d490ef4a32468f1544
BLAKE2b-256 5274a89e0a259275c612157813fa4eb8a96ae9285709b7a549a52eb2834066b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page