Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-MYST-057

Toctree lists linked documents and marks missing ones

When a document holds a `{toctree}`, the extension SHALL list its documents as links that open in the preview, labelled by the given title, else the first level-1 heading, else the file name, expand glob entries in sorted order and show a document that cannot be found as warned text without a link.

Step 1 of path 1 in StRS-MDOKFSTUDIO-MYST-012: from “A document holds a `{toctree}`” to “The linked documents are listed”.

Scenarios 6

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

nominalEntries render as labelled preview links
Givenentries a Title followed by the target in angle brackets and a bare target
Whenthe preview renders
Thenthe first uses Title and the second the target's first level-1 heading, skipping frontmatter and code fences, else the file name
boundaryEntry kinds
InputOutcome
A web address entryAn external link
A target with `.myst`, `.markdown` or the exact nameThe target is found by those extensions
boundaryCaption, hidden, reversed and size options
InputOutcome
`:caption: Guide`A level-2 heading Guide appears above the list
`:hidden:`Nothing is shown
`:reversed:` with three entriesThey appear in reverse order
Three entries without `:reversed:`They keep the written order
501 entries500 are shown
500 entriesAll are shown

The options are independent.

nominalGlob entries list the matching documents sorted
InputOutcome
`:glob:` with `chapters/*` matching three filesThree links appear in sorted order
A folder with `b.md` and `a.md` and the glob `*`a.md is listed before b.md
A non-Markdown fileIt is not listed
A wildcard matching nothingIt shows as a missing entry

A glob entry uses `*`, `**`, `?` or `[abc]` and lists the matching `.md`, `.markdown` and `.myst` documents below the folder.

boundaryGlob scan limits
InputOutcome
A folder holding 250 matches200 are listed
A match inside `node_modules`, `.git`, `_build` or `out`It is not listed
Folders beyond 400 or levels beyond 8They are not read
refusalMissing documents show as warned text
InputOutcome
An entry naming a missing fileIts text shows without a link, in a warning style, with the tooltip Document not found: name
No document reader availableEvery entry shows as missing

No warning is added to the status region or the Problems view either way, and no diagnostic is raised.

Implemented in 2

Tested by 4

Replaces

SwRS-MDOKFSTUDIO-CORE-054List documents matching a toctree glob superseded superseded by SwRS-MDOKFSTUDIO-MYST-057 Markdown file
SwRS-MDOKFSTUDIO-CORE-055Bound the toctree glob scan superseded superseded by SwRS-MDOKFSTUDIO-MYST-057 Markdown file
SwRS-MDOKFSTUDIO-MYST-058Toctree caption and hidden options superseded superseded by SwRS-MDOKFSTUDIO-MYST-057 Markdown file
SwRS-MDOKFSTUDIO-MYST-059Toctree glob entries list matching documents sorted superseded superseded by SwRS-MDOKFSTUDIO-MYST-057 Markdown file
SwRS-MDOKFSTUDIO-MYST-060Toctree reversed option flips the order superseded superseded by SwRS-MDOKFSTUDIO-MYST-057 Markdown file
SwRS-MDOKFSTUDIO-MYST-061Toctree shows at most 500 entries superseded superseded by SwRS-MDOKFSTUDIO-MYST-057 Markdown file
SwRS-MDOKFSTUDIO-MYST-062Missing toctree documents show as warned text superseded superseded by SwRS-MDOKFSTUDIO-MYST-057 Markdown file