sphinx-exercise

Documentation Status Github-CI Coverage Status

An exercise extension for Sphinx.

This package contains a Sphinx extension for producing exercise and solution directives, for html and pdf outputs.

Features:

The exercise directive is:

  1. automatically numbered

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

  3. can be referenced through ref and numref roles

The solution directive

  1. supports options such as class, label, and hidden

  2. can be referenced through ref role

Getting Started

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

pip install sphinx-exercise

Jupyter-Book Project

Add sphinx_exercise to your extra_extensions config in _config.yml

sphinx:
  extra_extensions:
    - sphinx_exercise

you may then use jb build <project> and the extension will be used by your Jupyter Book 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.