Skip to main content

Sphinx extension that provides accessibility features.

Project description

Adding accessibility to Sphinx

Sphinx extension that provides accessibility features.

Introduction

This Sphinx extension provides various accessibility features to enhance the usability of Sphinx-generated books. Features include:

  • Support for dyslexic-friendly fonts
  • High contrast mode

Installation

To install the Sphinx-Accessibility extension, follow these steps:

Step 1: Install the Package

Install the Sphinx-Accessibility package using pip:

pip install sphinx-accessibility

Step 2: Add to requirements.txt

Make sure that the package is included in your project's requirements.txt to track the dependency:

sphinx-accessibility

Step 3: Enable in _config.yml

In your _config.yml file, add the extension to the list of Sphinx extra extensions:

sphinx: 
    extra_extensions:
        - sphinx_accessibility

Features

Accessibility Menu

The accessibility menu provides a centralized location for users to adjust various accessibility settings, including font size, contrast, and more. The icon for this menu is .

Support for dyslexic-friendly fonts

This feature allows users to switch to the dyslexic-friendly font OpenDyslexic, improving readability for individuals with dyslexia. The font can be toggled on and off using the button in the accessibility menu .

High contrast mode

This feature allows users to switch to a high contrast mode, improving visibility for individuals with visual impairments. The mode can be toggled on and off using the button in the accessibility menu .

The high-contrast mode tries to apply the following changes to the CSS:

  • Change text and border colors to black in light-mode and white in dark-mode.
  • Change background colors to white in light-mode and black in dark-mode.
  • Makes all colors twice as intense.
  • In dark-mode only: increases contrast with factor 1.5.

Example

You can see how the accessibility features work in this example book.

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

sphinx_accessibility-1.0.1.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_accessibility-1.0.1-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file sphinx_accessibility-1.0.1.tar.gz.

File metadata

  • Download URL: sphinx_accessibility-1.0.1.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sphinx_accessibility-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a2e1b882fb573cb36d7d145fc924c9014c8e4c5b9204ca7d1d9d2c14f71179df
MD5 dcd0b385af04f239e0e5f595c99ebe6a
BLAKE2b-256 49dda9a4ea6d9221d7e21ae0fcfe151105d1edcebcc3e6dc316b1e5283d6a0a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_accessibility-1.0.1.tar.gz:

Publisher: python-publish.yml on TeachBooks/Sphinx-Accessibility

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_accessibility-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_accessibility-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d58d65c821e3854b31b35ae9fb90fd88ec1ced3943bdf2c5070e1930b96d03d0
MD5 1869c2cc61cbd5e6b1a9619973de962c
BLAKE2b-256 5c606bf80661f1fc2573c6485819dc6daafa9e80b26fc60559e3cdba7552716d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_accessibility-1.0.1-py3-none-any.whl:

Publisher: python-publish.yml on TeachBooks/Sphinx-Accessibility

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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