Skip to main content

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

Project description

Python-Waterloo Lexer

License Version Python Source

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.1.tar.gz (9.7 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.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_waterloo_lexer-0.6.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for python_waterloo_lexer-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b0e6a24695f07e061a24a14e3261629ce643d247b6a011b6c6a9961b236b02cd
MD5 3f8bcbd1db8ea1f6fb56e6aad59a3760
BLAKE2b-256 2a3aa5d2eec13732f1c769676d70c860a8e853e9390dcca98bc8185e0cc2d0f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_waterloo_lexer-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca079396a1fa6f30a3f2d4c7f58beab5ca3c78e290d2b77e26109f5568a6a1a7
MD5 163ca4ed7539aed042efe95bf6b15fb5
BLAKE2b-256 9edfbc0fef4901bab9adb611586d2ca0513b4bd09e14613e4a25fab452a936fa

See more details on using hashes here.

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