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 one of three buttons will be shown:
will be shown at the top of the page if all dropdowns are closed. Clicking this button will open all dropdowns.
will be shown at the top of the page if all dropdowns are opened. Clicking this button will close all dropdowns.
- will be shown at the top of the page if some dropdowns are closed and some are opened. This button provides a menu on hover or click, which contains the previous two buttons.
After clicking one of the buttons, the button at the top of the page will reflect the current state of all dropdowns on the page.
If opening or closing a dropdown (in the main article) causes the current state to change, to the button at the top of the page will again directly reflect the new 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.