Skip to main content

A pygments lexer derived from the Python lexer, for Waterloo docstrings

Project description

Python-Waterloo Lexer

License Version Python GitHub

The python-waterloo-lexer package provides a Pygments lexer for Python files that contain Waterloo docstrings.

The Waterloo Docstrings project defines a structured docstring format with explicit section semantics, normativity rules, and multiple render targets. The project is designed so that the same source docstring can be consumed by humans, LLM-assisted tooling, and renderers without losing structural meaning. This lexer provides syntax highlighting that preserves those conventions in editors, terminals, and preview tools.

It can be used with pygmentize and other tools that load Pygments lexers via entry points.

What it provides

  • a python-waterloo Pygments lexer alias
  • syntax highlighting for Python files with Waterloo docstrings
  • installation via PyPI, local checkout, or Git URL

Installation

pip install python-waterloo-lexer

Quick test

After installation, the lexer is available under the alias python-waterloo.

pygmentize -l python-waterloo -f terminal16m <file.py>

You can also check whether Pygments lists the lexer:

pygmentize -L lexers | grep -i waterloo || true

Terminal viewer

For a quick terminal preview, a less alias can be handy:

alias lessh='LESSOPEN="| pygmentize -O style=monokai %s" less -M -R'

Then open files with:

lessh <file.py>

Source repository

Development happens in the Waterloo repository:

The repository also contains related tooling, documentation, and editor integrations for Waterloo docstrings.

Preview

ExtensionPreview

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_waterloo_lexer-0.6.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_waterloo_lexer-0.6.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file python_waterloo_lexer-0.6.2.tar.gz.

File metadata

  • Download URL: python_waterloo_lexer-0.6.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for python_waterloo_lexer-0.6.2.tar.gz
Algorithm Hash digest
SHA256 de1571267fbdb85f04d85bf0b51544b504c49cd4a9e434dc06357bac8a64f2db
MD5 db9cb8a3dafc612f52707550ff300e47
BLAKE2b-256 40bd136e75cb45391f5f3ceed0c10322781299b465b2f1e74134f885f9346e61

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_waterloo_lexer-0.6.2.tar.gz:

Publisher: publish_pypi.yaml on uwe-at-sdv/sdv_doc_waterloo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_waterloo_lexer-0.6.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_waterloo_lexer-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb991ac6c02b68dc2b85a44c3136856ea8da3a24bb45d88d92aab20f86b406c8
MD5 c999c0d72a244e8d9b6333968f40186f
BLAKE2b-256 a57c77d961184b131507baa0281b901fcaa5d06033d0f491bd3b64c3778ebf7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_waterloo_lexer-0.6.2-py3-none-any.whl:

Publisher: publish_pypi.yaml on uwe-at-sdv/sdv_doc_waterloo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page