MichaelCurrin / dev-cheatsheets

A collection of code snippets and CLI guides for quick and easy reference while coding
https://michaelcurrin.github.io/dev-cheatsheets/
MIT License
76 stars 26 forks source link

Collapsible items in Markdown #52

Open pvanheus opened 6 months ago

pvanheus commented 6 months ago

A quick tip - you state in https://michaelcurrin.github.io/dev-cheatsheets/cheatsheets/markdown/collapsible-items.html that "when Jekyll will renders the code it keeps the Markdown as plain text and does not render it as formatted Markdown".

If you're using the kramdown engine as is common with Jekyll, you can specific markdown="1" on a HTML attribute. E.g.

<details markdown="1">
<summary><b>Preview title</b></summary>

_Markdown is valid, but add empty lines to separate from the HTML tags._

- Bullet
- Points

</details>

and then the inner Markdown gets rendered. For details on this, see the HTML Blocks section of the kramdown syntax guide.

Best wishes!

MichaelCurrin commented 6 months ago

Great, thanks for sharing!