sphinx-exercise
Contents
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
, andhidden
can be referenced through
ref
andnumref
roles
The solution directive
supports options such as
class
,label
, andhidden
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.