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.6.tar.gz
(52.7 kB
view hashes)
Built Distribution
Close
Hashes for django_pygmentify-0.3.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f142efec7983830bc52f2ca4de73830bb373806e4e4fc03ef115202af7456395 |
|
MD5 | 5a5055170a42fb8baa29c6e71c756246 |
|
BLAKE2b-256 | 8e716a5ae9ff4692aca89f12a86abec770b206c192d62b56ade8131d39ca70d8 |