Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-MYST-006

Admonitions nest, collapse and map as one block

When an admonition directive contains another directive, the extension SHALL render the inner panel inside its parent panel, keep inner fences as literal code under a longer outer fence, collapse a dropdown under its title (a dropdown admonition or a dropdown directive), and map each admonition as one block from its opening line to its closing fence.

Step 2 of path 1 in StRS-MDOKFSTUDIO-MYST-015: from “The admonition is drawn as a panel” to “Nested directives are drawn as panels inside their parent”.

Scenarios 5

The situations the tests check; open one to read it.

nominalAdmonitions nest inside each other
Given`::::{note}` around `:::{tip}`, and a palette-written warning around a note
Whenthe preview renders
Thenthe tip panel sits inside the note panel and the note panel stays inside the warning panel, the inner panel being a descendant of the outer one
boundaryThe fence length decides which fence closes the directive
Givena four-colon admonition holding a literal `markdown` code fence, and an outer fence not longer than the inner one
Whenthe preview renders
Thenthe outcomes of the table hold
Outer fenceInner fenceOutcome
longer than the inner one`markdown` code fence or inner admonitionthe inner fence shows as literal code inside the panel
not longer than the inner oneanythe inner fence closes the outer one as Markdown defines
nominalAn admonition is one mapped block over its whole directive
Givena three-line admonition at lines 5 to 7, and an admonition nested in another
Whenthe preview renders
Thenthe panel carries data-line 5 and data-end-line 7, and the outer panel of the nested pair spans the whole outer directive
boundaryDropdown admonitions collapse under their title
Givenan admonition with `:class: dropdown` or with an `:open:` option
Whenthe preview renders
Thena collapsible section (the native details element) shows the title as its summary, as the table gives
OptionsState
`:class: dropdown` without `:open:`closed
`:class: dropdown` with `:open: true`open
`:open: true` without `:class: dropdown`collapsible section, open
nominalThe dropdown directive keeps its title and body
Given`:::{dropdown} Title` and a backtick `{dropdown}` fence with `:open:`, each with a body, and one `{dropdown}` with no title
Whenthe preview renders
Theneach is a collapsible section (details element, classes admonition and dropdown) whose summary is the title (Details when none), whose body text shows, which is closed unless `:open:` is given, and which carries data-line and data-end-line from its opening to its closing fence

Implemented in 3

Tested by 4

Replaces

SwRS-MDOKFSTUDIO-MYST-003Admonition galleries keep one title line per panel without sideways scroll superseded superseded by SwRS-MDOKFSTUDIO-MYST-006 Markdown file
SwRS-MDOKFSTUDIO-MYST-007A longer outer fence keeps inner fences as literal code superseded superseded by SwRS-MDOKFSTUDIO-MYST-006 Markdown file
SwRS-MDOKFSTUDIO-MYST-008An admonition is one mapped block over its whole directive superseded superseded by SwRS-MDOKFSTUDIO-MYST-006 Markdown file
SwRS-MDOKFSTUDIO-MYST-009Dropdown admonitions collapse under their title superseded superseded by SwRS-MDOKFSTUDIO-MYST-006 Markdown file
SwRS-MDOKFSTUDIO-MYST-052The MyST gallery renders without sideways scroll superseded superseded by SwRS-MDOKFSTUDIO-MYST-006 Markdown file