Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Register now
Support Admonition Boxes in Markdown Rendering
The current plan is to support [GitHub's syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts). I've already seen it implemented in several packages, including `markdown-it` and `pandoc`. I do plan on extending it to support an optional title. For example, ``` > [!NOTE] > Useful information that users should know, even when skimming content. ``` is their syntax and is implemented with the word `Note` being displayed. I'll add an optional title such that ``` > [!NOTE] Keep in mind > Useful information that users should know, even when skimming content. ``` would get displayed with `Keep in mind` rather than `Note`. Allows for some level of customization and/or internationalization. I'm also hoping to extend our multiline block quotes to support this. So you could use ``` >>> [!NOTE] A large, multiblock note. >>> ``` --- ### Problem Currently it is not possible to call out specific items when writing issue/merge request/epic descriptions/comments which may be an important concept or an admonition to the user for a common pitfall. ### Usecase When writing documentation it is useful to call out specific items which may be an important concept or an admonition to the user for a common pitfall. ### Examples Sphinx allows this functionality via custom theming of admonitions; [see this presentation slide 13 for an example](https://www.slideshare.net/iktakahiro/sphinx-material-design-theme-pd-pycon-mini-sapporo). Another example from [StackOverflow](https://stackoverflow.com/questions/29354305/sphinx-resume-list-numbering-after-a-note-section). ![7z5AI](https://gitlab.com/gitlab-org/gitlab-ce/uploads/a820790d193e3fb9656d347e83672ab0/7z5AI.png) ### Proposal Support Admonition Boxes in Markdown Rendering Add a feature to the GitLab markdown that treats admonitions like labels. Users can add their own with the attributes `name`, `header_color`, `header_text`, `body_color`. They could be used in markdown in the same way as codeblocks, except using >>>_NAME_ instead of ```_LANGUAGE_. In the example given as an inline image, the values would be: | field | value | |-------|-------| | name | Note | | header_color | _HEX_DARKER_BLUE_ | | header_text | _EMPTY_ | | body_color | _HEX_LIGHTER_BLUE_ | The MarkDown would look like: ```markdown >>>Note ``` Let's say the writer wanted the box header to be "Awesome Note" instead of "Note", then the header_text field could be filled in and that would change all occurrences in documentation as well as keep the notation required short.
issue