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
boundaryEntry kinds
| Input | Outcome |
|---|---|
| A web address entry | An external link |
| A target with `.myst`, `.markdown` or the exact name | The target is found by those extensions |
boundaryCaption, hidden, reversed and size options
| Input | Outcome |
|---|---|
| `:caption: Guide` | A level-2 heading Guide appears above the list |
| `:hidden:` | Nothing is shown |
| `:reversed:` with three entries | They appear in reverse order |
| Three entries without `:reversed:` | They keep the written order |
| 501 entries | 500 are shown |
| 500 entries | All are shown |
The options are independent.
nominalGlob entries list the matching documents sorted
| Input | Outcome |
|---|---|
| `:glob:` with `chapters/*` matching three files | Three 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 file | It is not listed |
| A wildcard matching nothing | It 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
| Input | Outcome |
|---|---|
| A folder holding 250 matches | 200 are listed |
| A match inside `node_modules`, `.git`, `_build` or `out` | It is not listed |
| Folders beyond 400 or levels beyond 8 | They are not read |
refusalMissing documents show as warned text
| Input | Outcome |
|---|---|
| An entry naming a missing file | Its text shows without a link, in a warning style, with the tooltip Document not found: name |
| No document reader available | Every entry shows as missing |
No warning is added to the status region or the Problems view either way, and no diagnostic is raised.