Behaviour SwRS-MDOKFSTUDIO-DIAG-068
A {uml} directive renders a PUML file as a render dependency
When a {uml} directive or a {plantuml} directive without a body names a file, the extension SHALL render the diagram stored in that file, using the file text as the diagram and as the expandable source and recording the file name on the diagram element, record the file as a dependency of the render, or show the reason it cannot be read in place of the diagram.
Step 1 of path 2 in StRS-MDOKFSTUDIO-DIAG-009: from “A uml directive names a PUML file” to “The diagram of the file is drawn”.
Scenarios 8
The situations the tests check; open one to read it.
nominalFile diagram
boundaryOptions only
nominalDependency
a {plantuml} directive with a body
the preview is rendered
no file dependency is recorded for it
refusalFiles that are not read
The refusal message replaces the diagram, no diagram figure is produced and one warning is reported for the line.
| Input | Outcome |
|---|---|
| Path outside the allowed folders (outside the workspace; Restricted Mode keeps to the document's folder) | a message says the file is outside the folders the preview reads |
| Absolute path (a Windows drive path such as C:\diagrams\a.puml included) or URL | the message says the path must be a relative path to a local file |
| File larger than 5 MiB | the message says the file is larger than the 5 MiB preview limit |
refusalMissing file
the file is created afterwards
the preview renders again
the diagram appears
refusalBudget exhausted
boundaryDirectives without file or body
| Input | Outcome |
|---|---|
| {uml} with no argument and no body | the message The {uml} directive needs a diagram file path or a diagram body. appears in place of the diagram and a warning is reported |
| {plantuml} with no argument and no body | no such message; the diagram is an empty figure |
nominalInclude base of nested diagrams
A diagram that comes from an included document or from a {uml} file resolves its !include lines next to that file.
| Input | Outcome |
|---|---|
| plantuml fence in a document included by {include} | data-plantuml-base equal to the included document |
| {uml} diagram in an included document | data-plantuml-base equal to its own file |
| plantuml fence in the previewed document itself | no data-plantuml-base; includes resolve next to the document |
Implemented in 2
Tested by 4
Known limits (1)
- Directive options such as :caption: are accepted but not shown.