Skip to content

Commit e1da2f8

Browse files
committed
DOCS: Improve documentation
1 parent eb21421 commit e1da2f8

File tree

5 files changed

+363
-235
lines changed

5 files changed

+363
-235
lines changed

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# Add any Sphinx extension module names here, as strings. They can be
3939
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4040
# ones.
41-
extensions = ["sphinx_togglebutton"]
41+
extensions = ["myst_nb", "sphinx_design", "sphinx_togglebutton"]
4242

4343
# Add any paths that contain templates here, relative to this directory.
4444
templates_path = ["_templates"]
@@ -78,13 +78,15 @@
7878
# html_theme = "alabaster"
7979

8080
html_theme_options = {
81-
"single_page": True,
8281
"repository_url": "https://github.com/executablebooks/sphinx-togglebutton",
8382
"use_repository_button": True,
8483
"use_issues_button": True,
8584
"use_edit_page_button": True,
85+
"home_page_in_toc": True,
8686
}
8787

88+
myst_enable_extensions = ["colon_fence"]
89+
8890
# Add any paths that contain custom static files (such as style sheets) here,
8991
# relative to this directory. They are copied after the builtin static files,
9092
# so a file named "default.css" will overwrite the builtin "default.css".

docs/index.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# `sphinx-togglebutton`
2+
3+
A small sphinx extension to add "toggle button" elements to sections of your page.
4+
This allows you to:
5+
6+
- Collapse admonitions (notes, warnings, etc) so that their content is hidden
7+
until users click a toggle button. See {ref}`dropdown-admonitions`.
8+
- Collapse arbitrary chunks of content on your page with a `toggle` directive.
9+
See {ref}`toggle-directive`.
10+
11+
:::{admonition} For example, click the "+" button to the right:
12+
:class: dropdown
13+
14+
Here's a toggled note! You can put all kinds of stuff in here!
15+
:::
16+
17+
You can also add a toggle button to arbitrary chunks of content.
18+
For example, click the toggle button to the right just below.
19+
20+
::::{toggle}
21+
:::{admonition} Wow!
22+
:class: tip
23+
24+
It's a code block!
25+
26+
```python
27+
a = "wow, very python"
28+
```
29+
:::
30+
::::
31+
32+
See {ref}`usage` for more information.
33+
34+
:::{admonition} Check out sphinx-panels as well!
35+
:class: tip
36+
37+
For a bootstrap-based "dropdown" directive that uses pure CSS, check out
38+
[Sphinx Panels](https://sphinx-panels.readthedocs.io/en/latest/#dropdown-usage)
39+
:::
40+
41+
```{toctree}
42+
use
43+
reference
44+
```
45+
46+
## Installation
47+
48+
You can install `sphinx-togglebutton` with `pip`:
49+
50+
```bash
51+
pip install sphinx-togglebutton
52+
```
53+
54+
Then, activate it in your `sphinx` build by adding it to your `conf.py` configuration
55+
file, like so:
56+
57+
E.g.:
58+
59+
```python
60+
extensions = [
61+
...
62+
'sphinx_togglebutton'
63+
...
64+
]
65+
```
66+
67+
See {ref}`usage` for information about how to use `sphinx-togglebutton`.

docs/index.rst

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)