Skip to content

Repository files navigation

TeachBooks Favourites

A collection of our favourite Sphinx extensions for use in JupyterBooks.

Introduction

This Sphinx extension provides a single extension that includes and activates our favourite Sphinx extensions for use in JupyterBooks:

The following extension is nice, but is not compatible with all setups (dependency clash) so is not included in TeachBooks-Favourites:

Installation

To install TeachBooks-Favourites, follow these steps:

Step 1: Install the Package

Install the teachbooks-favourites package using pip:

pip install git+https://github.com/TeachBooks/TeachBooks-Favourites

Step 2: Add to requirements.txt

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

git+https://github.com/TeachBooks/TeachBooks-Favourites

Step 3: Enable in _config.yml

In your _config.yml file, add the extension to the list of Sphinx extra extensions (important: underscore, not dash this time):

sphinx: 
    extra_extensions:
        - teachbooks_favourites

Usage

For using the various packages we refer to the different manuals linked above.

All extensions are loaded with their default settings.

Configuration

By default, all extensions in TeachBooks-Favourites are activated. You can customise which extensions are loaded by setting either teachbooks_favourites_include or teachbooks_favourites_exclude in your _config.yml. Setting both at the same time will raise an error.

Exclude specific extensions

Use teachbooks_favourites_exclude to disable one or more extensions while keeping all others. For example, to disable the tippy hover-over feature:

sphinx:
  config:
    teachbooks_favourites_exclude:
      - teachbooks_sphinx_tippy

Include only specific extensions

Use teachbooks_favourites_include to activate only the extensions you need, disabling everything else:

sphinx:
  config:
    teachbooks_favourites_include:
      - sphinx_exercise
      - sphinx_proof
      - sphinx.ext.todo

The extension names to use are the Extension name values listed for each extension in the introduction above.

Please not that TeachBook's 'Sphinx-Thebe' and the TeachBook's fork of 'Sphinx toggle button' are always included as they override packages which are already imported by JupyterBooks.

Contribute

Do you think we missed an extension that should really be included? Let us know by either

  • creating a fork of this repository and submitting a pull request, in which you added the extension to the files
    • README.md
    • pyproject.toml
    • src\teachbooks_favourites\__init__.py
  • opening an issue.

About

A collection of our favorite Sphinx extensions for use in JupyterBooks.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages