Dropdown Toggle#
Introduction#
This Sphinx extension adds a button to open/close all dropdowns simultaneously, provided at least one dropdown is present.
Installation#
To install the Sphinx-Dropdown-Toggle, follow these steps:
Step 1: Install the Package
Install the Sphinx-Dropdown-Toggle
package using pip
:
pip install sphinx-dropdown-toggle
Step 2: Add to requirements.txt
Make sure that the package is included in your project’s requirements.txt
to track the dependency:
sphinx-dropdown-toggle
Step 3: Enable in _config.yml
In your _config.yml
file, add the extension to the list of Sphinx extra extensions:
sphinx:
extra_extensions:
- sphinx_dropdown_toggle
Contribute#
This tool’s repository is stored on GitHub. The MANUAL.md
of the branch main
is also part of the TeachBooks manual as a submodule. If you’d like to contribute, you can create a fork and open a pull request on the GitHub repository. To update the MANUAL.md
shown in the TeachBooks manual, create a fork and open a merge request for the GitHub repository of the manual.
Usage#
When dropdowns are included on a page, initially will be shown at the top of the page near the other symbols. Clicking this will toggle all dropdowns on the page, opening them all at once.
At this point the button wil change to and clicking it again will close all dropdowns, including initially open ones, and revert the button to its original state.
Reference examples#
A proof
First we consider \(x_-=-ai\) and take its square:
This shows that \(x_-=-ai\) is indeed a solution to the equation \(x^2=-a^2\).
We repeat the same for \(x_+=ai\):
We also find that \(x_+=ai\) is a solution to the equation \(x^2=-a^2\).
Grasple Exercise 2
Just to compute a cross product.