Skip to content

Commit 6a8c8a9

Browse files
committed
📚 DOCS: update docs about dropdown
1 parent 1d0e3dd commit 6a8c8a9

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

docs/source/syntax.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,28 @@ static int factorial(int n){
194194

195195
### Hide Content
196196

197-
The content of directives can be hidden using the `dropdown` class which is available through [Sphinx Book Theme](https://sphinx-book-theme.readthedocs.io/en/latest/index.html). For Sphinx projects, add `"sphinx_book_theme"` to your `html_theme` in the `conf.py` to activate the theme in your Sphinx configuration
197+
The content of directives can be hidden using the `dropdown` class which is available through [sphinx-togglebutton](https://sphinx-togglebutton.readthedocs.io/en/latest/). For Sphinx projects, add `"sphinx_togglebutton"` to your `extensions` list in `conf.py` to activate the extension
198198

199199
```python
200-
...
201-
html_theme = "sphinx_book_theme"
202-
...
200+
extensions = [
201+
...
202+
"sphinx_togglebutton"
203+
...
204+
]
203205
```
204206

205-
Jupyter Book's default theme is Sphinx Book Theme; therefore, Jupyter Book projects can utilize `dropdown` without having to activate the theme in your Sphinx configuration.
207+
For Jupyter Book projects, add `sphinx_togglebutton` under `extra_extensions`
206208

209+
```yaml
210+
sphinx:
211+
extra_extensions:
212+
- sphinx_togglebutton
213+
```
207214
208215
To hide the content, simply add `:class: dropdown` as a directive option.
209216

217+
For more use cases see [sphinx-togglebutton](https://sphinx-togglebutton.readthedocs.io/en/latest/#usage).
218+
210219
**Example**
211220

212221
```{exercise}

0 commit comments

Comments
 (0)