Socket
Socket
Sign inDemoInstall

django-pygments-renderer

Package Overview
Dependencies
2
Maintainers
1
Alerts
File Explorer

Install Socket

Protect your apps from supply chain attacks

Install

django-pygments-renderer

Provides functionality for syntax highlighting using Pygments.

    0.0.1

Maintainers
1

Readme

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

Provides functionality for syntax highlighting using `Pygments <http://pygments.org/>`_ .

.. figure:: ./example.png


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

django-pygments-renderer requires python 3.6 or later and Django 2.0 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 %}
   <html>
   <head>
       <title>{{ snippet.title}} - djangosnippets</title>
       <style>{% pygments_css %}</style>
       <!-- other header tags -->
   </head>

   <body>
      <div class="container">
          <h2 class="title">{{ snippet.title }} by {{ snippet.created_by.username }}</h2>

          <div class="sourcecode">
              {{ snippet.code|pygmentize:"python3" }}
          </div>

          <div>
              {{ snippet.description }}
          </div>
      </div>
   </body>
   </html>


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 py37`` or ``DJANGO_SETTINGS_MODULE=test_settings python -m django test``

License
-------

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


FAQs


Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc