Behaviour SwRS-MDOKFSTUDIO-CORE-022
Build-dependent constructs show an inert placeholder with a warning
When a document holds a construct that only a full project build can resolve (an unknown directive, `toc`, an unexpanded `{include}`, `{embed}`, `{glossary}`, a known directive that renders nothing, a `{cite}` role, a `{bibliography}` directive, a `#tbl:` notebook output reference or an unexecuted `{code-cell}` output), the extension SHALL render an inert, muted placeholder that shows the name, arguments and body as text and list a warning for a directive, a notebook output or a code cell output while the render stays successful.
Step 1 of path 2 in StRS-MDOKFSTUDIO-CORE-003: from “The preview shows a good render” to “A placeholder with a warning stands in its place”.
Step 1 of path 1 in StRS-MDOKFSTUDIO-MYST-005: from “A document holds a construct that only a full project build can resolve” to “A muted placeholder is drawn and the render stays successful”.
Scenarios 6
The situations the tests check; open one to read it.
nominalUnknown directive
the status region lists one warning "Directive {foo} is not available outside a full build." with line 4 and the status is "Preview ready"
boundaryDirectives that only a build resolves
| Input | Outcome |
|---|---|
| `toc` | the same placeholder and the same warning |
| `{embed}` | the same placeholder and the same warning |
| `{glossary}` | the same placeholder and the same warning |
| an unexpanded `{include}` | the same placeholder and the same warning |
| a known directive that renders to nothing | the placeholder is shown, not an empty gap, with the warning |
| a supported directive (admonitions, figure, image, tables, grid, toctree, math, code family, mermaid, uml, include) | no placeholder and no such warning |
| a document with no unresolved directive | no such warning is listed |
boundaryCitations
| Input | Outcome |
|---|---|
| `{cite}`smith2020`` | `[smith2020]` in muted text with the tooltip "Unresolved citation: smith2020"; an inert citation placeholder; no warning is listed |
| `{cite}`a,b,c`` in a paragraph, a list and an admonition | the group stays in its paragraph with every key kept and no warning is listed |
| a document without a `{bibliography}` | no bibliography is appended |
nominalBibliography directive
a document without the directive shows no such note
nominalNotebook output and code cell output
a `#tbl:` notebook output reference shows a note "Notebook output #tbl:... is only available in a full project build." with a warning on its line
nominalInert styling
| Placeholder | Style |
|---|---|
| unresolved directive | muted text in a dashed box |
| citation | muted text with a dotted underline and a help cursor |
| notebook output | muted text |
| bibliography | muted text |