Project: accessible-pygments

A collection of accessible pygments styles

Project Details

Latest version
0.0.4
Home Page
https://github.com/Quansight-Labs/accessible-pygments
PyPI Page
https://pypi.org/project/accessible-pygments/

Project Popularity

PageRank
0.0023013963754524983
Number of downloads
229147

Accessible pygments themes

conda version pip version conda-forge downloads pip downloads demo

This package includes a collection of accessible themes for pygments based on different sources.

Screenshot of all light themes side by side

Screenshot of all dark themes side by side

WCAG 2.1 - AAA compliant

The following themes are AAA compliant with WCAG 2.1 criteria for color contrast.

WCAG 2.1 - AA compliant

The following themes are AA compliant with WCAG 2.1 criteria for color contrast.

For a demo of all our themes please click here!

Installation

Our package is available in both conda and pip via,

conda install -c conda-forge accessible-pygments
pip install accessible-pygments

If you want to install it directly from source,

git clone git@github.com:Quansight-Labs/accessible-pygments.git
cd accessible-pygments
pip install .

Usage

Import it using the name identifier for the desired theme,

from pygments.formatters import HtmlFormatter
HtmlFormatter(style='a11y-light').style
<class 'accessible-pygments.A11yLight'>

Tests

Just open a terminal and run,

python test/run_tests.py

You will see the results under test/results in html format for each supported theme.

Acknowledgements

We want to thank the following sources for being the source of inspiration of one or more themes that are available in this repository,