Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add details / collapsable / accordion markup #2909

Open
danlangford opened this issue May 12, 2023 · 0 comments
Open

add details / collapsable / accordion markup #2909

danlangford opened this issue May 12, 2023 · 0 comments

Comments

@danlangford
Copy link
Contributor

id like to propose a new markup tag that can collapse away a bunch of text. some frameworks call these "accordions". we could put this around long explanations, large spoilers, or giant quotes.

[details]a lot of text[/details]

[details=A Summary Or Title Here]a lot of text, probably tons of statistics that bagels likes to put in the forums[/details]

here is how it could look and work. (click the ▸ below)

a lot of text
A Summary Or Title Here a lot of text, probably tons of statistics that bagels likes to put in the forums

and fortunately all modern browsers already support this functionality that requires no CSS or JS

<details>a lot of text</details>

<details>
    <summary>A Summary Or Title Here</summary>
    a lot of text, probably tons of statistics that bagels likes to put in the forums
</details>

do arguments to a markup tag support spaces? if not, and this a summary/title being passed in is problematic then I might suggest alternative syntax

[details]a lot of text[/details]

[details=open]a lot of text, probably tons of statistics that bagels likes to put in the forums. this one will default to being open[/details]

which could work like this

a lot of text
a lot of text, probably tons of statistics that bagels likes to put in the forums. this one will default to being open

and would have a syntax like this

<details>a lot of text</details>

<details open>
a lot of text, probably tons of statistics that bagels likes to put in the forums. this one will default to being open
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants