forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new guide for use of collapsed sections (github#22517)
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...king-with-advanced-formatting/organizing-information-with-collapsed-sections.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: Organizing information with collapsed sections | ||
intro: 'You can streamline your Markdown by creating a collapsed section with the `<details>` tag.' | ||
versions: | ||
fpt: '*' | ||
ghes: '*' | ||
ghae: '*' | ||
ghec: '*' | ||
shortTitle: Collapsed sections | ||
--- | ||
## Creating a collapsed section | ||
|
||
You can temporarily obscure sections of your Markdown by creating a collapsed section that the reader can choose to expand. For example, when you want to include technical details in an issue comment that may not be relevant or interesting to every reader, you can put those details in a collapsed section. | ||
|
||
Any Markdown within the `<details>` block will be collapsed until the reader clicks {% octicon "triangle-right" aria-label="The right triange icon" %} to expand the details. Within the `<details>` block, use the `<summary>` tag to create a label to the right of {% octicon "triangle-right" aria-label="The right triange icon" %}. | ||
|
||
```markdown | ||
<details><summary>CLICK ME</summary> | ||
<p> | ||
|
||
#### We can hide anything, even code! | ||
|
||
```ruby | ||
puts "Hello World" | ||
``` | ||
|
||
</p> | ||
</details> | ||
``` | ||
|
||
The Markdown will be collapsed by default. | ||
|
||
 | ||
|
||
After a reader clicks {% octicon "triangle-right" aria-label="The right triange icon" %}, the details are expanded. | ||
|
||
 | ||
|
||
## Further reading | ||
|
||
- [{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/) | ||
- "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax)" |