django-pygmy-0.1.5
توضیحات
UNKNOWN
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | django-pygmy-0.1.5 |
| نام | django-pygmy |
| نسخه کتابخانه | 0.1.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Matt Lenc |
| ایمیل نویسنده | matt.lenc@gmail.com |
| آدرس صفحه اصلی | https://github.com/mattack108/django-pygmy/ |
| آدرس اینترنتی | https://pypi.org/project/django-pygmy/ |
| مجوز | UNKNOWN |
django-pygmy
============
django-pygmy is a little app that colorizes source codez in your `Django <http://djangoproject.com/>`_ templates.
It uses `pygments <http://pygments.org/>`_ for prettify the codez.
.. image:: https://travis-ci.org/mattack108/django-pygmy.png
:target: https://travis-ci.org/mattack108/django-pygmy
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 <http://pygments.org/docs/formatters/#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 <http://pygments.org/docs/lexers/>`_ like so: ::
{% pygmy object.code lexer='python' %}
Dependencies
^^^^^^^^^^^^
- Python 2.6 - 3.3
- Django 1.3 - 1.5
- pygments >= 1.6
نحوه نصب
نصب پکیج whl django-pygmy-0.1.5:
pip install django-pygmy-0.1.5.whl
نصب پکیج tar.gz django-pygmy-0.1.5:
pip install django-pygmy-0.1.5.tar.gz