A Django template tag to highlight code with Pygments
Project description
Django Pygmentify is a Django template tag 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 %}">
{% pygmentify %}
<pre class="python">
print('Hello, world!')
</pre>
{% endpygmentify %}
Result:
<link rel="stylesheet" href="/static/pygmentify/css/default.min.css">
<div class="highlight"><pre class="python"><span></span><span class="k">print</span><span class="p">(</span><span class="s2">"Hello, world!"</span><span class="p">)</span>
</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
django-pygmentify-0.3.7.tar.gz
(52.7 kB
view hashes)
Built Distribution
Close
Hashes for django_pygmentify-0.3.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5562728b8fa5ecc5e48514c98827562a8c10d4455f83934579487983e032467 |
|
MD5 | 7b9489eea167ca26c4e040d852914bd7 |
|
BLAKE2b-256 | 10e6de5d1e0649acc562a6971a3cb3b92b2b5ab164870034097fd13812a02680 |