Skip to content

Commit

Permalink
📚 DOCS:: Update for dropdown class (#19)
Browse files Browse the repository at this point in the history
- I was trying to use this extension, and got confused because the
  readme wasn't updated for the new `dropdown` class and
  `toggle-shown` semantics (as opposed to being shown by default with
  toggle-hidden as an option).  Ref: 8cebb39, #13
- I fixed it to save others some time, since this took quite a while
  to figure out...
- Review: make sure it's correct, I didn't miss anywhere, this is what
  the future is.
  - also fix the "container" part at the bottom - should this be
    updated to the toggle directive or is that still true?
  • Loading branch information
rkdarst committed Sep 12, 2020
1 parent ceb80a8 commit 2d500cf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,26 @@ extensions = [
]
```
Now, whenever you wish for an admonition to be toggle-able, add the
`:class: toggle` parameter to the admonition directive that you use.
`:class: dropdown` parameter to the admonition directive that you use.

For example, this code would create a toggle-able "note" admonition:
For example, this code would create a toggle-able "note" admonition
that starts hidden:

```rst
.. note::
:class: toggle
:class: dropdown
This is my note.
```

Clicking on the toggle button will toggle the item's visibility.

You may also **hide the content by default**. To do so, add the `toggle`
class *as well as* a `toggle-hidden` class, like so:
You may also **show the content by default**. To do so, add the `dropdown`
class *as well as* a `toggle-shown` class, like so:

```rst
.. note::
:class: toggle, toggle-hidden
:class: dropdown, toggle-shown
This is my note.
```
Expand Down

0 comments on commit 2d500cf

Please sign in to comment.