Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-CORE-012

An include is expanded in place and mapped to its directive

When a trusted document holds an `{include}` directive for a Markdown file inside its folder or the workspace root, the extension SHALL render that file's content in place of the directive, map every included block to the lines of the directive and leave an unsupported include form as an unresolved placeholder.

Step 1 of path 1 in StRS-MDOKFSTUDIO-CORE-002: from “A trusted document holds an include directive” to “The included content is shown in place”.

Part of StRS-MDOKFSTUDIO-CORE-003, outside the paths drawn on its map.

Scenarios 7

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

nominalExpand an include in place
Givena directive including `part.md` that starts with frontmatter
Whenit is rendered
Thenthe content of `part.md` appears at the directive position without its frontmatter
boundaryThe class option expands and a missing file stays a placeholder
Givenan include with the `:class:` option, and another naming a missing file
Whenit is rendered
Thenthe first still expands and the second stays in place as a placeholder
refusalKeep unsupported include forms as placeholders
InputOutcome
an `{include}` with the `:literal:` optionthe directive shows as a placeholder, not expanded
an `{include}` with an option other than `:class:` and `:label:`the directive stays an unresolved placeholder
an `{include}` with an empty argumentthe directive stays a placeholder with a warning on its line, and the rest of the document renders
an `{include}` with only `:class:`the file is expanded
a plain include or an include with `:label:`the file is expanded
nominalMap included blocks to the include directive
Givenan include on line 7 of the host document
Whenit is rendered
Thenevery block of the included file carries line 7 and the included mark
boundaryNested includes carry the outer directive line
Givenan included file that includes another file
Whenit is rendered
Thenblocks of the inner file carry the outer directive line and the included mark
nominalRead a repeated include once per render
Givena file included three times, by directives on different lines
Whenit is rendered
Thenthe file is read once and each copy maps to its own directive line
nominalExpand alerts in included files and context tags
InputOutcome
an included file with a `> [!NOTE]` alertthe alert renders as a note panel
an alert in a grouped context tagthe alert renders as a note panel

Implemented in 3

Tested by 3

Replaces

SwRS-MDOKFSTUDIO-CORE-014Keep unsupported include forms as placeholders superseded superseded by SwRS-MDOKFSTUDIO-CORE-012 Markdown file
SwRS-MDOKFSTUDIO-CORE-015Map included blocks to the include directive superseded superseded by SwRS-MDOKFSTUDIO-CORE-012 Markdown file
SwRS-MDOKFSTUDIO-CORE-017Read a repeated include once per render superseded superseded by SwRS-MDOKFSTUDIO-CORE-012 Markdown file
SwRS-MDOKFSTUDIO-CORE-045Expand alerts in included files and context tags superseded superseded by SwRS-MDOKFSTUDIO-CORE-012 Markdown file