Metadata-Version: 2.2
Name: pygments_djc
Version: 1.0.0
Summary: Pygments Lexers for django-components
Author-email: Juro Oravec <juraj.oravec.josefson@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/django-components/pygments-djc/
Keywords: django,components,pygments,lexer,html,js,css
Classifier: Framework :: Django
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <4.0,>=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygments>=2.15

# pygments-djc

[![PyPI - Version](https://img.shields.io/pypi/v/pygments-djc)](https://pypi.org/project/pygments-djc/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pygments-djc)](https://pypi.org/project/pygments-djc/) [![PyPI - License](https://img.shields.io/pypi/l/pygments-djc)](https://github.com/django-components/pygments-djc/blob/main/LICENSE) [![PyPI - Downloads](https://img.shields.io/pypi/dm/pygments-djc)](https://pypistats.org/packages/pygments-djc) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/django-components/pygments-djc/tests.yml)](https://github.com/django-components/pygments-djc/actions/workflows/tests.yml)

_[Pygments](https://pygments.org/) Lexers for [django-components](https://pypi.org/project/django-components/)._

## Installation

1. Install the package:
    ```bash
    pip install pygments-djc
    ```

2. Add the lexers to your Pygments configuration by simply importing `pygments_djc`
    ```python
    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:

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

The syntax highlight then looks like this:

![Django Components Python Lexer Example](./assets/demo.png)

## Release notes

Read the [Release Notes](https://github.com/django-components/pygments-djc/tree/main/CHANGELOG.md)
to see the latest features and fixes.

## Development

### Tests

To run tests, use:

```bash
pytest
```
