Documenter.jl and collapsible Markdown?

Is it possible to have collapsible markdown elements in a documentation page (or even the navigation bar) created with Documenter?

Here is an example:

2 Likes

I’m not sure how well it works with Documenter’s CSS, but it should be possible to use the at-raw blocks for this, as long as you don’t mind writing some HTML:

## collapsible markdown?

```@raw html
<details><summary>CLICK ME</summary>
```
#### yes, even hidden code blocks!

```python
print("hello world!")
```
```@raw html
</details>
```
5 Likes

Cool, thank you very much. This works perfectly.

But could I also use this to load the content of a file and then hide the content inside the collapsible?

So far I used

using Markdown
Markdown.parse("""
```
$(String(read(file_path)))
```
""")

to load the content of my files. Is it possible to integrate this code with @raw html?

Yep, should just work if you put the at-raw blocks around the at-example/eval.

1 Like