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 %}">
{% 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">"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
django-pygmentify-0.2.tar.gz
(3.6 kB
view details)
File details
Details for the file django-pygmentify-0.2.tar.gz
.
File metadata
- Download URL: django-pygmentify-0.2.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6785563b39a2adfc425130b39499a6992c36856bd8860467f414e9b1e83d425d |
|
MD5 | e448c810dfea64bf7685ecc1616a744a |
|
BLAKE2b-256 | 0d3d67aa41aae276b30cc8b3c0ab5f4b67d731fe1f9152a80b0c4a09bb507aaa |