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
There are two ways to hide markdown cells. First, **you can add the `hide-input`**
81
-
cell metadata. This triggers the same hiding behavior described above for
82
-
code cells.
80
+
You cannot hide an entire markdown cell, but you can hide sections of markdown **content** by using roles and directives.
83
81
84
-
+++ {"tags": ["hide-input"]}
85
-
86
-
```{note}
87
-
This cell was hidden by adding a `hide-input` tag to it!
88
-
```
89
-
90
-
+++
91
-
92
-
You may also **use a Sphinx directive** to hide specific markdown content. This
93
-
is possible by adding the **`.toggle`** class to any block-level directive
94
-
that will allow for classes. For example, to the `container`, `note`, or `admonition`
95
-
directives.
96
-
97
-
For example, the hidden block below
98
-
99
-
```{admonition} This cell was hidden with the toggle class
100
-
:class: toggle
101
-
Wow, a hidden block! ✨✨
102
-
```
103
-
104
-
Is generated with the following code:
105
-
106
-
````
107
-
```{admonition} This cell was hidden with the toggle class
108
-
:class: toggle
109
-
Wow, a hidden block! ✨✨
110
-
```
111
-
````
112
-
113
-
114
-
`````{admonition} Don't add headings to toggle-able sections
115
-
116
-
Note that containers for markdown (like notes, or this `container`
117
-
directive) cannot have their own headings (ie, lines that start
118
-
with `#`. If you'd like to use headings, do one of the following:
119
-
120
-
* Use **bolded text** if you want to highlight sections of a
121
-
toggle-able section.
122
-
* Use an **admonition** directive to control the title of the
123
-
message box (that's what this message box uses). Like so:
124
-
````
125
-
```{admonition} my admonition title
126
-
My admonition content
127
-
```
128
-
````
129
-
`````
130
-
131
-
+++
82
+
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).
0 commit comments