Documentation Status Github-CI Coverage Status

An exercise extension for Sphinx.

This package contains a Sphinx extension for producing exercise and solution directives.


sphinx-exercise 0.1.0 is in a development stage and may change rapidly.


The exercise directive is

  1. automatically numbered

  2. supports options such as class, label, and nonumber

  3. can easily be referenced through ref and numref roles

The solution directive

  1. supports options such as class and label

  2. can be referenced through ref role

Getting Started

To get started with sphinx-exercise, first install it through pip:

pip install -e.

Jupyter-Book Project

Add sphinx_exercise to your extra_extensions config in _config.yml

    - sphinx_exercise

you may then use jb build <project> and the extension will be used by your JupyterBook project.

Sphinx Project

Add sphinx_exercise to your sphinx extensions in the conf.py

extensions = ["sphinx_exercise"]

you may then build using make html and the extension will be used by your Sphinx project.