Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Last active February 24, 2024 15:16
Show Gist options
  • Save joyrexus/16041f2426450e73f5df9391f7f7ae5f to your computer and use it in GitHub Desktop.
Save joyrexus/16041f2426450e73f5df9391f7f7ae5f to your computer and use it in GitHub Desktop.
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")

@flakrat
Copy link

flakrat commented Jan 26, 2022

Whoop, thanks for posting this. Makes for a much more readable document when including lengthy output sections (like tracebacks, etc...)

@splaisan
Copy link

splaisan commented Feb 8, 2022

wonderful, I was looking for this for a long time.
THANKS

@jacobmoroni
Copy link

jacobmoroni commented Feb 21, 2022

I saw @antranapp's comment and figured out how to do it. here it is

<details open>

  <summary>click to collapse</summary>

  this one starts expanded because of the "open"

</details>
click to collapse

this one starts expanded because of the "open"

@akcasasent
Copy link

Is there a way to have this work with links without having to write the htlm directrly?

@darshan315
Copy link

@akcasasent

For mentioning links in Markdown, refer to this.

you can also use that in the collapsable section.

Click-Here

youtube

@iamramahibrah
Copy link

Check this out this is toggle list

@TukangM
Copy link

TukangM commented Sep 22, 2022

HHH

TESST

@oh-satyo-iswara
Copy link

hello world

@Laura-Novich-OBW
Copy link

Any advice on how to get it to work in GitHub Pages? In GitHub it looks beautiful.
on the rendered page, much less so.

@OliverEvans96
Copy link

@Laura-Novich-OBW - you probably want to check out the CSS sections of https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details

@abzrg
Copy link

abzrg commented Nov 21, 2022

$\color{darkgray}\text{Unit}_{\Large1}$

$\textit{\large 1. }\textbf{\color{lightyellow}abroad}$ ( $\textit{\color{darkgray}adv}$ )

  • $\textit{\color{lightblue}I would love to go abroad this year, perhaps to South of France.}$
  • $\textit{\color{lightcyan}...public opposition here and abroad...}$
  • $\textit{\color{lightblue}About 65 per cent of its sales come from abroad.}$
  • Definition

    in or to a foreign country. (= overseas)

$\textit{\large 2. }\textbf{\color{lightyellow}accustomed to}$ ( $\textit{\color{darkgray}adj}$ )

  • $\textit{\color{lightblue}I was accustomed to being the only child at a table full of adults...}$
  • $\textit{\color{lightcyan}We were accustomed to working together.}$
  • $\textit{\color{lightblue}Her eyes quickly became accustomed to the dark.}$
  • Definition

    If you are accustomed to something, you know it so well or have experienced it so often that it seems natural, unsurprising, or easy to deal with.

@mdrahmed
Copy link

mdrahmed commented Jun 9, 2023

click to collapse

this one starts expanded because of the "open"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment