# Accessible pygments themes
[![conda version](https://img.shields.io/conda/vn/conda-forge/accessible-pygments?color=0553F2&style=flat.svg)](https://anaconda.org/conda-forge/accessible-pygments)
[![pip version](https://img.shields.io/pypi/v/accessible-pygments?color=0553F2&flat.svg)](https://pypi.org/project/accessible-pygments/)
[![conda-forge downloads](https://img.shields.io/conda/dn/conda-forge/accessible-pygments?color=0553F2&label=conda-forge%20downloads%20&flat.svg)](https://anaconda.org/conda-forge/accessible-pygments)
[![pip downloads](https://img.shields.io/pypi/dm/accessible-pygments?color=0553F2&label=PyPI%20downloads&flat.svg)](https://pypi.org/project/accessible-pygments/)
[![accessible-pygments demo page](https://img.shields.io/badge/Demo-Click%20this%20badge!%20✨-blueviolet?flat.svg)](https://quansight-labs.github.io/accessible-pygments/)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./LICENSE)
## Table of contents
- [Accessible pygments themes](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#accessible-pygments-themes)
- [Table of contents](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#table-of-contents)
- [Accessibility details ♿️](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#accessibility-details-️)
- [WCAG 2.1 - AAA compliant](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#wcag-21---aaa-compliant)
- [WCAG 2.1 - AA compliant](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#wcag-21---aa-compliant)
- [Documentation 📖](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#documentation-)
- [Installation 💻](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#installation-)
- [Using the themes directly in your code or app](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#using-the-themes-directly-in-your-code-or-app)
- [Using the themes in your Sphinx documentation](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#using-the-themes-in-your-sphinx-documentation)
- [Development and contribution 🌱](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#development-and-contribution-)
- [Acknowledgments 🤝](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#acknowledgments-)
- [License 📑](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#license-)
This package includes a collection of accessible themes for [pygments](https://pygments.org/) based on multiple open-source syntax highlighting themes. The images below show all the themes side by side.
![Display of all the light themes side by side](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./docs/light_themes.png)
![Display of all dark themes side by side](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./docs/dark_themes.png)
:sparkles: To see examples of the themes in action [visit our online demo](https://quansight-labs.github.io/accessible-pygments/) :sparkles:
## Accessibility details ♿️
> [!Note]
> What do we mean by accessible? In this context we are specifically referring to themes which meet the [WCAG 2.1 criteria for color contrast](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).
> Some themes included are also color-blind friendly.
### WCAG 2.1 - AAA compliant
The following themes are AAA compliant with [WCAG 2.1 criteria for color contrast](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html).
- [`a11y-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_dark)
- [`a11y-high-contrast-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_high_contrast_dark)
- [`pitaya-smoothie`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/pitaya_smoothie) - Color-blind friendly.
- [`github-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_light) - Color-blind friendly.
- [`github-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_dark) - Color-blind friendly.
- [`github-light-colorblind`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_light_colorblind) - Color-blind friendly.
- [`github-dark-colorblind`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_dark_colorblind) - Color-blind friendly.
- [`github-light-high-contrast`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_light_high_contrast) - Color-blind friendly.
- [`github-dark-high-contrast`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_dark_high_contrast) - Color-blind friendly.
- [`gotthard-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/gotthard_dark) - Color-blind friendly.
### WCAG 2.1 - AA compliant
The following themes are AA compliant with [WCAG 2.1 criteria for color contrast](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html).
- [`a11y-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_light)
- [`a11y-high-contrast-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_high_contrast_light)
- [`gotthard-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/gotthard_light) - Color-blind friendly.
- [`blinds-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/blinds_light) - Color-blind friendly.
- [`blinds-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/blinds_dark) - Color-blind friendly.
- [`greative`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/greative) - Accessible to most forms of colorblindness and low light settings.
## Documentation 📖
### Installation 💻
`accessible-pygments` is available through pip and conda.
You can install it through the following commands:
```bash
conda install -c conda-forge accessible-pygments
# if you prefer using mamba
mamba install -c conda-forge accessible-pygments
```
```bash
pip install accessible-pygments
```
If you prefer to install the themes directly from the source:
```bash
# clone the repository
git clone git@github.com:Quansight-Labs/accessible-pygments.git
cd accessible-pygments
pip install .
```
### Using the themes directly in your code or app
If you want to directly use the themes in your code, you can do so by importing the theme and passing it to the `style` argument of the `HtmlFormatter` class.
```python
from pygments.formatters import HtmlFormatter
HtmlFormatter(style='a11y-light').style
<class 'accessible-pygments.A11yLight'>
```
### Using the themes in your Sphinx documentation
1. You will need to add `accessible-pygments` as a dependency to your documentation:
```toml
# for example if using a pyproject.toml file
dependencies=["accessible-pygments"]
```
2. Modify your `conf.py` file to specify the `accessible-pygments` style:
```python
"pygments_style": "a11y-light"
```
3. Build your documentation as usual.
## Development and contribution 🌱
You can find our contribution guides on [CONTRIBUTING.md](https://github.com/Quansight-Labs/accessible-pygments/tree/main/CONTRIBUTING.md).
We aim to build a safe and inclusive community, so we have a [Code of Conduct](https://github.com/Quansight-Labs/accessible-pygments/tree/main/CODE_OF_CONDUCT.md) that we ask everyone to follow.
## Acknowledgments 🤝
We want to thank the following sources for being the source of inspiration for one or more themes that are available in this repository,
- [a11y dark and light syntax highlighting](https://github.com/ericwbailey/a11y-syntax-highlighting).
- [pitaya smoothie VSCode theme](https://github.com/trallard/pitaya_smoothie).
- [github VSCode themes](https://github.com/primer/github-vscode-theme).
- [gotthard VSCode themes](https://github.com/janbiasi/vscode-gotthard-theme/).
- [blinds VSCode themes](https://github.com/orbulant/blinds-theme).
- [greative VSCode theme](https://github.com/SumanKhdka/Greative-vscode-Theme).
## License 📑
`accessible-pygments` is licensed under the [OSI BSD-3 Clause license](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "accessible-pygments",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Gabriel Fouasnon <gabriel@fouasnon.com>",
"keywords": "Sphinx, WCAG, a11y, accessibility, pygments",
"author": null,
"author_email": "Stephannie Jimenez Gacha <steff456@hotmail.com>, Tania Allard <trallard@bitsandchips.me>",
"download_url": "https://files.pythonhosted.org/packages/bc/c1/bbac6a50d02774f91572938964c582fff4270eee73ab822a4aeea4d8b11b/accessible_pygments-0.0.5.tar.gz",
"platform": null,
"description": "# Accessible pygments themes\n\n[![conda version](https://img.shields.io/conda/vn/conda-forge/accessible-pygments?color=0553F2&style=flat.svg)](https://anaconda.org/conda-forge/accessible-pygments)\n[![pip version](https://img.shields.io/pypi/v/accessible-pygments?color=0553F2&flat.svg)](https://pypi.org/project/accessible-pygments/)\n[![conda-forge downloads](https://img.shields.io/conda/dn/conda-forge/accessible-pygments?color=0553F2&label=conda-forge%20downloads%20&flat.svg)](https://anaconda.org/conda-forge/accessible-pygments)\n[![pip downloads](https://img.shields.io/pypi/dm/accessible-pygments?color=0553F2&label=PyPI%20downloads&flat.svg)](https://pypi.org/project/accessible-pygments/)\n[![accessible-pygments demo page](https://img.shields.io/badge/Demo-Click%20this%20badge!%20\u2728-blueviolet?flat.svg)](https://quansight-labs.github.io/accessible-pygments/)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./LICENSE)\n\n## Table of contents\n\n- [Accessible pygments themes](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#accessible-pygments-themes)\n - [Table of contents](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#table-of-contents)\n - [Accessibility details \u267f\ufe0f](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#accessibility-details-\ufe0f)\n - [WCAG 2.1 - AAA compliant](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#wcag-21---aaa-compliant)\n - [WCAG 2.1 - AA compliant](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#wcag-21---aa-compliant)\n - [Documentation \ud83d\udcd6](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#documentation-)\n - [Installation \ud83d\udcbb](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#installation-)\n - [Using the themes directly in your code or app](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#using-the-themes-directly-in-your-code-or-app)\n - [Using the themes in your Sphinx documentation](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#using-the-themes-in-your-sphinx-documentation)\n - [Development and contribution \ud83c\udf31](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#development-and-contribution-)\n - [Acknowledgments \ud83e\udd1d](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#acknowledgments-)\n - [License \ud83d\udcd1](https://github.com/Quansight-Labs/accessible-pygments/tree/main/#license-)\n\nThis package includes a collection of accessible themes for [pygments](https://pygments.org/) based on multiple open-source syntax highlighting themes. The images below show all the themes side by side.\n\n![Display of all the light themes side by side](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./docs/light_themes.png)\n\n![Display of all dark themes side by side](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./docs/dark_themes.png)\n\n:sparkles: To see examples of the themes in action [visit our online demo](https://quansight-labs.github.io/accessible-pygments/) :sparkles:\n\n## Accessibility details \u267f\ufe0f\n\n> [!Note]\n> What do we mean by accessible? In this context we are specifically referring to themes which meet the [WCAG 2.1 criteria for color contrast](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n> Some themes included are also color-blind friendly.\n\n### WCAG 2.1 - AAA compliant\n\nThe following themes are AAA compliant with [WCAG 2.1 criteria for color contrast](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html).\n\n- [`a11y-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_dark)\n- [`a11y-high-contrast-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_high_contrast_dark)\n- [`pitaya-smoothie`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/pitaya_smoothie) - Color-blind friendly.\n- [`github-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_light) - Color-blind friendly.\n- [`github-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_dark) - Color-blind friendly.\n- [`github-light-colorblind`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_light_colorblind) - Color-blind friendly.\n- [`github-dark-colorblind`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_dark_colorblind) - Color-blind friendly.\n- [`github-light-high-contrast`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_light_high_contrast) - Color-blind friendly.\n- [`github-dark-high-contrast`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/github_dark_high_contrast) - Color-blind friendly.\n- [`gotthard-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/gotthard_dark) - Color-blind friendly.\n\n### WCAG 2.1 - AA compliant\n\nThe following themes are AA compliant with [WCAG 2.1 criteria for color contrast](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html).\n\n- [`a11y-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_light)\n- [`a11y-high-contrast-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/a11y_high_contrast_light)\n- [`gotthard-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/gotthard_light) - Color-blind friendly.\n- [`blinds-light`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/blinds_light) - Color-blind friendly.\n- [`blinds-dark`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/blinds_dark) - Color-blind friendly.\n- [`greative`](https://github.com/Quansight-Labs/accessible-pygments/tree/main/a11y_pygments/greative) - Accessible to most forms of colorblindness and low light settings.\n\n## Documentation \ud83d\udcd6\n\n### Installation \ud83d\udcbb\n\n`accessible-pygments` is available through pip and conda.\n\nYou can install it through the following commands:\n\n```bash\nconda install -c conda-forge accessible-pygments\n\n# if you prefer using mamba\nmamba install -c conda-forge accessible-pygments\n```\n\n```bash\npip install accessible-pygments\n```\n\nIf you prefer to install the themes directly from the source:\n\n```bash\n# clone the repository\ngit clone git@github.com:Quansight-Labs/accessible-pygments.git\ncd accessible-pygments\n\npip install .\n```\n\n### Using the themes directly in your code or app\n\nIf you want to directly use the themes in your code, you can do so by importing the theme and passing it to the `style` argument of the `HtmlFormatter` class.\n\n```python\nfrom pygments.formatters import HtmlFormatter\nHtmlFormatter(style='a11y-light').style\n<class 'accessible-pygments.A11yLight'>\n```\n\n### Using the themes in your Sphinx documentation\n\n1. You will need to add `accessible-pygments` as a dependency to your documentation:\n\n ```toml\n # for example if using a pyproject.toml file\n dependencies=[\"accessible-pygments\"]\n ```\n\n2. Modify your `conf.py` file to specify the `accessible-pygments` style:\n\n ```python\n \"pygments_style\": \"a11y-light\"\n ```\n\n3. Build your documentation as usual.\n\n## Development and contribution \ud83c\udf31\n\nYou can find our contribution guides on [CONTRIBUTING.md](https://github.com/Quansight-Labs/accessible-pygments/tree/main/CONTRIBUTING.md).\nWe aim to build a safe and inclusive community, so we have a [Code of Conduct](https://github.com/Quansight-Labs/accessible-pygments/tree/main/CODE_OF_CONDUCT.md) that we ask everyone to follow.\n\n## Acknowledgments \ud83e\udd1d\n\nWe want to thank the following sources for being the source of inspiration for one or more themes that are available in this repository,\n\n- [a11y dark and light syntax highlighting](https://github.com/ericwbailey/a11y-syntax-highlighting).\n- [pitaya smoothie VSCode theme](https://github.com/trallard/pitaya_smoothie).\n- [github VSCode themes](https://github.com/primer/github-vscode-theme).\n- [gotthard VSCode themes](https://github.com/janbiasi/vscode-gotthard-theme/).\n- [blinds VSCode themes](https://github.com/orbulant/blinds-theme).\n- [greative VSCode theme](https://github.com/SumanKhdka/Greative-vscode-Theme).\n\n## License \ud83d\udcd1\n\n`accessible-pygments` is licensed under the [OSI BSD-3 Clause license](https://github.com/Quansight-Labs/accessible-pygments/tree/main/./LICENSE).\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A collection of accessible pygments styles",
"version": "0.0.5",
"project_urls": {
"Bug Reports": "https://github.com/Quansight-Labs/accessible-pygments/issues",
"Homepage": "https://github.com/Quansight-Labs/accessible-pygments"
},
"split_keywords": [
"sphinx",
" wcag",
" a11y",
" accessibility",
" pygments"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8d3f95338030883d8c8b91223b4e21744b04d11b161a3ef117295d8241f50ab4",
"md5": "d87c8d8faa343d24c5705efbe915b5a8",
"sha256": "88ae3211e68a1d0b011504b2ffc1691feafce124b845bd072ab6f9f66f34d4b7"
},
"downloads": -1,
"filename": "accessible_pygments-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d87c8d8faa343d24c5705efbe915b5a8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 1395903,
"upload_time": "2024-05-10T11:23:08",
"upload_time_iso_8601": "2024-05-10T11:23:08.421378Z",
"url": "https://files.pythonhosted.org/packages/8d/3f/95338030883d8c8b91223b4e21744b04d11b161a3ef117295d8241f50ab4/accessible_pygments-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bcc1bbac6a50d02774f91572938964c582fff4270eee73ab822a4aeea4d8b11b",
"md5": "3b3ce27e8340fad9f60cb3a633265566",
"sha256": "40918d3e6a2b619ad424cb91e556bd3bd8865443d9f22f1dcdf79e33c8046872"
},
"downloads": -1,
"filename": "accessible_pygments-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "3b3ce27e8340fad9f60cb3a633265566",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1377899,
"upload_time": "2024-05-10T11:23:10",
"upload_time_iso_8601": "2024-05-10T11:23:10.216775Z",
"url": "https://files.pythonhosted.org/packages/bc/c1/bbac6a50d02774f91572938964c582fff4270eee73ab822a4aeea4d8b11b/accessible_pygments-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-10 11:23:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Quansight-Labs",
"github_project": "accessible-pygments",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "accessible-pygments"
}