# Documenter.jl and collapsible Markdown?

**URL:** <https://discourse.julialang.org/t/documenter-jl-and-collapsible-markdown/50898>\
**Category:** General Usage\
**Tags:** documenter, markdown\
**Created:** [November 28, 2020, 12:37pm UTC](https://discourse.julialang.org/t/documenter-jl-and-collapsible-markdown/50898 "2020-11-28T12:37:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [November 28, 2020, 12:37pm UTC](https://discourse.julialang.org/t/documenter-jl-and-collapsible-markdown/50898/1 "2020-11-28T12:37:57Z")

</div>

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

Here is an example:  
[https://gist.github.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f](https://gist.github.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f)

---

<div class="post-metadata">

**Author:** ![mortenpi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mortenpi/32/158_2.png) [@mortenpi](https://discourse.julialang.org/u/mortenpi)\
**Post date:** [November 29, 2020, 11:33pm UTC](https://discourse.julialang.org/t/documenter-jl-and-collapsible-markdown/50898/2 "2020-11-29T23:33:30Z")

</div>

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:

````markdown
## collapsible markdown?

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

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

````

---

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [November 30, 2020, 10:53pm UTC](https://discourse.julialang.org/t/documenter-jl-and-collapsible-markdown/50898/3 "2020-11-30T22:53:31Z")

</div>

> [@mortenpi](#):
>
> ````julia
> ## collapsible markdown?
> 
> ```@raw html
> <details><summary>CLICK ME</summary>
> 
> ````
> 
> #### yes, even hidden code blocks!
> 
> ```python
> print("hello world!")
> 
> ```
> 
> ```julia
> </details>
> 
> ```
> 
> ```julia
> 
> ```

Cool, thank you very much. This works perfectly.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/f/7fcd591c999b9da21e2a85a83226d693dad5fcc2.png)

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

````julia
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`?

---

<div class="post-metadata">

**Author:** ![mortenpi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mortenpi/32/158_2.png) [@mortenpi](https://discourse.julialang.org/u/mortenpi)\
**Post date:** [December 1, 2020, 1:56am UTC](https://discourse.julialang.org/t/documenter-jl-and-collapsible-markdown/50898/4 "2020-12-01T01:56:47Z")

</div>

> [@uwechsler](#):
>
> But could I also use this to load the content of a file and then hide the content inside the collapsible?

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

---

<div class="post-metadata">

**Author:** ![moble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moble/32/23535_2.png) [@moble](https://discourse.julialang.org/u/moble)\
**Post date:** [July 16, 2026, 2:15pm UTC](https://discourse.julialang.org/t/documenter-jl-and-collapsible-markdown/50898/5 "2026-07-16T14:15:52Z")

</div>

Sorry to resurrect a dead thread, but this is still the thread that shows up when you search for this topic. In the intervening years (I think around v1.0 in late 2023), Documenter has made it much easier to add a collapsible section with a [“details” admonition](https://documenter.juliadocs.org/stable/showcase/#Details-admonition):

```md
!!! details "Title goes here"

    This text gets collapsed.

```
