I want to put code chunks 'inside' the 'details' section.
Just like the one link. If you click 'Click to expand!' there comes a code.
At first I just did as usual,
<details>
<summary>BlahBlah</summary>
blahblah2
Tried to put code chunks here starts with '```'
blahblah3
</details>
And it fails. Code chunks are not inside the 'details' section.
Parts starting from code chunks to 'blahblah3' all pop up.
Any help will be appreciated. Thanks in advance.
The Python markdown lib has an extension for this, md_in_html:
<details markdown="1"><summary>code</summary>
```python
print('Hello World!')
```
</details>
https://github.com/Python-Markdown/markdown/blob/master/docs/extensions/md_in_html.md
This worked for me on Kramdown:
{::options parse_block_html="true" /}
<details><summary markdown="span">code</summary>
```python
print('Hello World!')
```
</details>
{::options parse_block_html="false" /}
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With