Provides functionality for syntax highlighting using Pygments.
Project description
Provides functionality for syntax highlighting using Pygments .
Installation
django-pygments-renderer requires python 3.6 or later and Django 2.0 or later.
$ python3 -m pip install django-pygments-renderer
Usage
INSTALLED_APPS += [ 'pygments_renderer', ]
{% load i18n %} {% load pygmentize %} <html> <head> <title>{{ snippet.title}} - djangosnippets</title> <style>{% pygments_css %}</style> <!-- other header tags --> </head> <body> <div class="container"> <h2 class="title">{{ snippet.title }} by {{ snippet.created_by.username }}</h2> <div class="sourcecode"> {{ snippet.code|pygmentize:"python3" }} </div> <div> {{ snippet.description }} </div> </div> </body> </html>
Similar projects
Development
- lint: tox -e flake8 or flake8
- test: tox -e py37 or DJANGO_SETTINGS_MODULE=test_settings python -m django test
License
This software is licensed under the MIT License (See LICENSE ).
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size django_pygments_renderer-0.0.1-py3-none-any.whl (3.9 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size django-pygments-renderer-0.0.1.tar.gz (3.1 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for django_pygments_renderer-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de503a87162e6bd0241fe164018108c484ff7a904ecb5759087c31f91541c3b6 |
|
MD5 | deff8067984627276571f370ebd8bed6 |
|
BLAKE2-256 | f5bc8de080c5094143ce2ecb06b6fa9886bdec49c166ca68607510c775a1f35d |
Close
Hashes for django-pygments-renderer-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5548e94ea13271b87d2425768ec76f8062ea62032191999dbbe227a72cc1259 |
|
MD5 | f8ed9aaf18958d4d0b82973b88f6c621 |
|
BLAKE2-256 | 649184a73b7f112af7ba11dcd24e14aa4e4ff02d3bedcd0b1a2b4c36a84b9c1e |