An open API service indexing awesome lists of open source software.

https://github.com/c-bata/django-pygments-renderer

Provides functionality for syntax highlighting using Pygments.
https://github.com/c-bata/django-pygments-renderer

django pygments syntax-highlight template-tags

Last synced: 10 months ago
JSON representation

Provides functionality for syntax highlighting using Pygments.

Awesome Lists containing this project

README

          

django-pygments-renderer
========================

Provides functionality for syntax highlighting using `Pygments `_ .

.. figure:: ./example.png

Installation
------------

django-pygments-renderer requires python 3.6 or later and Django 2.2 or later.

.. code-block:: console

$ python3 -m pip install django-pygments-renderer

https://pypi.org/project/django-pygments-renderer/

Usage
-----

.. code-block:: python

INSTALLED_APPS += [
'pygments_renderer',
]

.. code-block:: html

{% load i18n %}
{% load pygmentize %}


{{ title }}
{% pygments_css %}




{{ code|pygmentize:"python3" }}



Similar projects
----------------

* https://github.com/richardcornish/django-pygmentify
* https://github.com/odeoncg/django-pygments
* https://github.com/sniku/django-pygments

Development
-----------

* lint: ``tox -e flake8`` or ``flake8``
* test: ``tox -e py39`` or ``DJANGO_SETTINGS_MODULE=test_settings python -m django test``

License
-------

This software is licensed under the MIT License (See `LICENSE <./LICENSE>`_ ).