Skip to content

Commit

Permalink
UPGRADE: sphinx-togglebutton v0.3.0 (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf authored Feb 10, 2022
1 parent 5f4b8f6 commit 82212cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 53 deletions.
53 changes: 2 additions & 51 deletions docs/use/hiding.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,58 +77,9 @@ points =ax.scatter(*data, c=data[0], s=data[0])

## Hide markdown cells

There are two ways to hide markdown cells. First, **you can add the `hide-input`**
cell metadata. This triggers the same hiding behavior described above for
code cells.
You cannot hide an entire markdown cell, but you can hide sections of markdown **content** by using roles and directives.

+++ {"tags": ["hide-input"]}

```{note}
This cell was hidden by adding a `hide-input` tag to it!
```

+++

You may also **use a Sphinx directive** to hide specific markdown content. This
is possible by adding the **`.toggle`** class to any block-level directive
that will allow for classes. For example, to the `container`, `note`, or `admonition`
directives.

For example, the hidden block below

```{admonition} This cell was hidden with the toggle class
:class: toggle
Wow, a hidden block! ✨✨
```

Is generated with the following code:

````
```{admonition} This cell was hidden with the toggle class
:class: toggle
Wow, a hidden block! ✨✨
```
````


`````{admonition} Don't add headings to toggle-able sections
Note that containers for markdown (like notes, or this `container`
directive) cannot have their own headings (ie, lines that start
with `#`. If you'd like to use headings, do one of the following:
* Use **bolded text** if you want to highlight sections of a
toggle-able section.
* Use an **admonition** directive to control the title of the
message box (that's what this message box uses). Like so:
````
```{admonition} my admonition title
My admonition content
```
````
`````

+++
For information on how to hide / toggle markdown content in Sphinx, see either [the `sphinx-togglebutton` documentation](https://sphinx-togglebutton.readthedocs.io/en/latest/) or the [`sphinx-design` dropdowns documentation](https://sphinx-design.readthedocs.io/en/latest/dropdowns.html).

(use/removing)=

Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ install_requires =
nbformat~=5.0
pyyaml
sphinx>=3.1,<5
sphinx-togglebutton~=0.2.2
sphinx-togglebutton~=0.3.0
python_requires = >=3.6
include_package_data = True
zip_safe = True
Expand Down Expand Up @@ -94,7 +94,8 @@ testing =
# TODO: 3.4.0 has some warnings that need to be fixed in the tests.
matplotlib~=3.3.0
numpy
pandas
# TODO: 1.4.0 has some warnings that need to be fixed in the tests.
pandas<1.4
pytest~=5.4
pytest-cov~=2.8
pytest-regressions
Expand Down

0 comments on commit 82212cf

Please sign in to comment.