Git Product home page Git Product logo

accessible-pygments's Introduction

Accessible pygments themes

conda version pip version conda-forge downloads pip downloads accessible-pygments demo page License

Table of contents

This package includes a collection of accessible themes for pygments 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

Display of all dark themes side by side

✨ To see examples of the themes in action visit our online demo

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. 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.

WCAG 2.1 - AA compliant

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

Documentation 📖

Installation 💻

accessible-pygments is available through pip and conda.

You can install it through the following commands:

conda install -c conda-forge accessible-pygments

# if you prefer using mamba
mamba install -c conda-forge accessible-pygments
pip install accessible-pygments

If you prefer to install the themes directly from the source:

# clone the repository
git clone [email protected]: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.

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:

    # for example if using a pyproject.toml file
    dependencies=["accessible-pygments"]
  2. Modify your conf.py file to specify the accessible-pygments style:

    "pygments_style": "a11y-light"
  3. Build your documentation as usual.

Development and contribution 🌱

You can find our contribution guides on CONTRIBUTING.md. We aim to build a safe and inclusive community, so we have a Code of Conduct 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,

License 📑

accessible-pygments is licensed under the OSI BSD-3 Clause license.

accessible-pygments's People

Contributors

gabalafou avatar mgorny avatar pre-commit-ci[bot] avatar steff456 avatar trallard avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.