A Django template filter application to highlight code with Pygments
Project description
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>
{% endfilter %}
Result:
<div class="highlight"><pre class="python"><code><span></span><span class="k">print</span><span class="p">(</span><span class="s2">"Hello, world!"</span><span class="p">)</span>
</code></pre></div>
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
File details
Details for the file django-pygmentify-0.2.3.tar.gz
.
File metadata
- Download URL: django-pygmentify-0.2.3.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02122bb39a58b1f7a1df6500041b36758bb20685b5b29cc070218c1f1256501a |
|
MD5 | e2d649b9d35857ac9d86225f21cbbb71 |
|
BLAKE2b-256 | d797c966b1b0aab2a57412d7d9d3a71281e47d6a7c5ac3fc91c5f5bf7df74ec9 |