This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
jinja2-highlight
################

About
=====

A simple Jinja2 extension that uses Pygments to highlight code blocks.


.. image:: https://travis-ci.org/tlatsas/jinja2-highlight.svg?branch=master
:target: https://travis-ci.org/tlatsas/jinja2-highlight


Source
======

Github: https://github.com/tlatsas/jinja2-highlight

Pypi: http://pypi.python.org/pypi/jinja2-highlight


Requirements
============

* Jinja2 >= 2.4
* Pygments >= 1.5


Highlight examples
=================
::

{% highlight 'language' %}
your-awesome-code-here
{% endhighlight %}

Replace `language` with the appropriate Pygments lexer short name: http://pygments.org/docs/lexers/

Line numbering can be turned on using `lineno='inline'` or `lineno='table'` depending on the style of line numbering you want (as per Pygment's documentation: http://pygments.org/docs/formatters/#HtmlFormatter)

::

{% highlight 'language', lineno='inline' %}
your-awesome-code-here
{% endhighlight %}

This can also be used without a language setting

::

{% highlight lineno='table' %}
your-awesome-code-here
{% endhighlight %}

Optional settings
================

By default Pygments renders the code block inside a div with the class 'highlight', if you want to change the name you can set the environment variable `jinja2_highlight_cssclass` to the class name you would like.

In jinja this can be done after you've created your environment;
::

env = Environment(extensions=['jinja2_highlight.HighlightExtension'])
# Set the css class name to 'codehilite'
env.extend(jinja2_highlight_cssclass = 'codehilite')

In Flask this can be done with the following (after creating your app):
::

app.jinja_env.extend(jinja2_highlight_cssclass = 'codehilite')



Using with Flask
================

See the example at: https://github.com/tlatsas/jinja2-highlight/tree/master/examples/flask

Release History

Release History

0.6.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jinja2-highlight-0.6.1.tar.gz (3.4 kB) Copy SHA256 Checksum SHA256 Source Sep 13, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting