Skip to content

django-components/pygments-djc

Repository files navigation

pygments-djc

PyPI - Version PyPI - Python Version PyPI - License PyPI - Downloads GitHub Actions Workflow Status

Pygments Lexers for django-components.

Installation

  1. Install the package:

    pip install pygments-djc
  2. Add the lexers to your Pygments configuration by simply importing pygments_djc

    import pygments_djc

Lexers

DjangoComponentsPythonLexer

Code blocks: djc_py / djc_python

This is the same as Python3 Lexer, but also highlights nested JS / CSS / HTML code blocks within Component classes:

class MyComponent(Component):
    template = """
      <div>Hello World</div>
    """

The syntax highlight then looks like this:

Django Components Python Lexer Example

Release notes

Read the Release Notes to see the latest features and fixes.

Development

Tests

To run tests, use:

pytest

About

Pygments Lexers for django-components

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages