A collection of accessible pygments styles
Project description
Accessible pygments themes
This package includes a collection of accessible themes for pygments based on different sources.
WCAG 2.1 - AAA compliant
The following themes are AAA compliant with WCAG 2.1 criteria for color contrast.
a11y-dark
a11y-high-contrast-dark
pitaya-smoothie
- Colorblindness friendly.github-light
- Colorblindness friendly.github-dark
- Colorblindness friendly.github-light-colorblind
- Colorblindness friendly.github-dark-colorblind
- Colorblindness friendly.github-light-high-contrast
- Colorblindness friendly.github-dark-high-contrast
- Colorblindness friendly.gotthard-dark
- Colorblindness friendly.
WCAG 2.1 - AA compliant
The following themes are AA compliant with WCAG 2.1 criteria for color contrast.
a11y-light
a11y-high-contrast-light
gotthard-light
- Colorblindness friendly.blinds-light
- Colorblindness friendly.blinds-dark
- Colorblindness friendly.greative
- Accessible to most forms of colorblindness and low light settings.
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,
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
Built Distribution
Hashes for accessible-pygments-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0917b507646a6b3393eb49091a62506f6b2a3935f5d95e4d1249dc505f8a4eae |
|
MD5 | 4811f8e7fbbd92bcd09ed91717d7cd55 |
|
BLAKE2b-256 | c1dc7b23dca20691e69f5a43b2a4b06ff755f72b8f4e87de9c69c78d4e644c74 |
Hashes for accessible_pygments-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a643a2979b1f14fead79a8bbf51a6ae09e9df70d5ed60bb61a6eb9092cdcb81 |
|
MD5 | 491202b20d33b3993ee1c41fbddcb3ec |
|
BLAKE2b-256 | b3128b34b4ecf56bd4d30b100c0eed43ebe30394eeb063998a9b739dc8d46281 |