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.
- Host: GitHub
- URL: https://github.com/c-bata/django-pygments-renderer
- Owner: c-bata
- License: mit
- Created: 2019-05-05T05:04:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-08T12:51:59.000Z (over 4 years ago)
- Last Synced: 2025-03-10T22:57:55.112Z (11 months ago)
- Topics: django, pygments, syntax-highlight, template-tags
- Language: Python
- Homepage:
- Size: 78.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
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>`_ ).