# Use @example within expandable block in Documenter.jl

**URL:** <https://discourse.julialang.org/t/use-example-within-expandable-block-in-documenter-jl/106436>\
**Category:** General Usage\
**Tags:** question, documentation, documenter\
**Created:** [November 19, 2023, 1:19pm UTC](https://discourse.julialang.org/t/use-example-within-expandable-block-in-documenter-jl/106436 "2023-11-19T13:19:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [November 19, 2023, 1:19pm UTC](https://discourse.julialang.org/t/use-example-within-expandable-block-in-documenter-jl/106436/1 "2023-11-19T13:19:34Z")

</div>

I am using Documenter.jl and would like to place an @example block inside an expandable code block. Here is what I am trying to do ( sorry for the screenshot; the code does not properly display) :

![Screenshot from 2023-11-19 08-16-08](https://global.discourse-cdn.com/julialang/original/3X/7/a/7a00c113056931b4faa5bc04d2870d20610d3e38.png)

This does not work. Is there an escape character I need to use to execute the @example block?

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [November 19, 2023, 1:42pm UTC](https://discourse.julialang.org/t/use-example-within-expandable-block-in-documenter-jl/106436/2 "2023-11-19T13:42:31Z")

</div>

I think you can use two `raw` blocks. I use details tags a bit in docs, eg [here](https://github.com/cormullion/Karnak.jl/blob/507205e50c70ab7e3a293386acb46dff3a99ab64/docs/src/basics.md?plain=1#L309).

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [November 19, 2023, 2:38pm UTC](https://discourse.julialang.org/t/use-example-within-expandable-block-in-documenter-jl/106436/3 "2023-11-19T14:38:01Z")

</div>

Thank you. That’s exactly what I needed.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [February 14, 2025, 10:59am UTC](https://discourse.julialang.org/t/use-example-within-expandable-block-in-documenter-jl/106436/4 "2025-02-14T10:59:10Z")

</div>

Hello, the workaround works but it is a bit… tricky… As you can pass a js script using the “assets” keyword in `HTML()`, I wonder if it possible to use js to visualize everything inside a `details` tag (independently of its open/close nature) except `code.language-julia` that should behave normally…
