sphinx-exercise#
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:
automatically numbered
supports options such as
class,label,nonumber, andhiddencan be referenced through
refandnumrefroles
The solution directive
supports options such as
class,label, andhiddencan be referenced through
refrole
Internationalization:
sphinx-exercise supports 27 languages including Chinese, Japanese, Korean, Arabic, Hindi, Spanish, French, German, and more. The extension automatically uses the appropriate language based on your Sphinx project’s language configuration.
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.