You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/syntax.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,19 +194,28 @@ static int factorial(int n){
194
194
195
195
### Hide Content
196
196
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
198
198
199
199
```python
200
-
...
201
-
html_theme ="sphinx_book_theme"
202
-
...
200
+
extensions = [
201
+
...
202
+
"sphinx_togglebutton"
203
+
...
204
+
]
203
205
```
204
206
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`
206
208
209
+
```yaml
210
+
sphinx:
211
+
extra_extensions:
212
+
- sphinx_togglebutton
213
+
```
207
214
208
215
To hide the content, simply add `:class: dropdown` as a directive option.
209
216
217
+
For more use cases see [sphinx-togglebutton](https://sphinx-togglebutton.readthedocs.io/en/latest/#usage).
0 commit comments