Collapsing text in Redmine issues and wiki pages (collapse/details)
There are two ways to collapse text in Redmine.
1. Using the Redmine wiki macro collapse
Enclose the text that you want to collapse between {{collapse(Title) and }}. Title is the heading that is visible while the text is collapsed. When you click this part, the content is displayed.
Example:
{{collapse(Hello world)
``` c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello, world.\n");
return 0;
}
```
}}
2. Using the details tag (for CommonMark Markdown)
If the text formatting is CommonMark Markdown, you can use the HTML details tag.
Enclose the text that you want to collapse between <details> and </details>. Enclose the heading between <summary> and </summary> and write it inside <details> and </details>.
You can use this method only when Administration > Settings > General > Text formatting is CommonMark Markdown.
Example:
<details>
<summary>Hello world</summary>
``` c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello, world.\n");
return 0;
}
```
</details>
