Skip to main content

UNKNOWN

Project description

django-pygmy is a little app that colorizes source codez in your Django templates.

It uses pygments for prettify the codez.

https://travis-ci.org/mattack108/django-pygmy.png

Installation

To install django-pygmy, simply run:

pip install django-pygmy

Then add the app to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...,
    'django_pygmy',
)

Usage

Render the awesomeness in your template:

{% load pygmy %}

{% pygmy object.code %}

It also takes the same options as HtmlFormatter class:

{% pygmy object.code nowrap='True' linenos='table' %}

Lexers

By default django-pygmy tries to guess which lexer to use based on the provided code.

If you wish you can define any lexer of Pygments lexers like so:

{% pygmy object.code lexer='python' %}

Dependencies

  • Python 2.6 - 3.3
  • Django 1.3 - 1.5
  • pygments >= 1.6

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-pygmy, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size django-pygmy-0.1.5.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page