Goal: set up Visual Studio Code for Spec Loop artifacts:
- PlantUML diagrams render inside Markdown preview.
glossary.adocopens with an AsciiDoc viewer when the project uses a glossary.
This document provides two supported approaches:
- Option A (Server-based, minimal local installs): uses VS Code’s built-in Markdown Preview +
myml.vscode-markdown-plantuml-preview(renders via a PlantUML server). - Option B (Local-only, no server): uses Markdown Preview Enhanced + local
plantuml.jar(renders locally).
Install:
- Markdown PlantUML Preview (
myml.vscode-markdown-plantuml-preview) https://marketplace.visualstudio.com/items?itemName=myml.vscode-markdown-plantuml-preview
This extension renders diagrams by sending them to a PlantUML server.
Setting:
markdown.plantuml.server
Default:
https://www.plantuml.com/plantuml
If you use a self-hosted server, set markdown.plantuml.server to your server base URL.
Use a fenced code block with language plantuml, including @startuml and @enduml:
This section intentionally starts with a nested code block.
The outer four-backtick fence is only for showing literal Markdown.
Copy only the inner fenced plantuml block.
```plantuml
@startuml
Alice -> Bob: hello
@enduml
```
Render check (plain plantuml block):
@startuml
Alice -> Bob: hello
@endumlIf PlantUML rendering is enabled, the additional block above should render as a diagram in Markdown Preview. If rendering is not enabled, it will appear as a code block.
Open the built-in preview:
- Command Palette → Markdown: Open Preview
- or Markdown: Open Preview to the Side
If the server is reachable, the diagram renders in the preview.
VS Code’s built-in Markdown Preview does not provide local PlantUML rendering by itself. For local rendering in Markdown, you use an extension that provides its own Markdown preview renderer.
PlantUML requires Java.
- Verify after installation:
java -version
PlantUML prerequisites overview: https://plantuml.com/starting
Many PlantUML diagram types require Graphviz (dot) for layout.
- Verify after installation:
dot -V
Graphviz / dot notes: https://plantuml.com/graphviz-dot
Download plantuml.jar and store it in a stable location.
Download: https://plantuml.com/download
Example locations:
- Windows:
C:\Tools\PlantUML\plantuml.jar - macOS:
~/tools/plantuml/plantuml.jar - Linux:
~/tools/plantuml/plantuml.jar
Install:
- Markdown Preview Enhanced (
shd101wyy.markdown-preview-enhanced) https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced
Set this VS Code setting to the absolute path of your plantuml.jar:
markdown-preview-enhanced.plantumlJarPath
This is the key configuration for PlantUML rendering in Markdown Preview Enhanced. Reference (common failure + fix): shd101wyy/vscode-markdown-preview-enhanced#1738
Examples:
-
Windows:
{ "markdown-preview-enhanced.plantumlJarPath": "C:\\\\Tools\\\\PlantUML\\\\plantuml.jar" } -
macOS:
{ "markdown-preview-enhanced.plantumlJarPath": "/Users/<you>/tools/plantuml/plantuml.jar" } -
Linux:
{ "markdown-preview-enhanced.plantumlJarPath": "/home/<you>/tools/plantuml/plantuml.jar" }
Same Markdown content as Option A:
This section intentionally starts with a nested code block.
The outer four-backtick fence is only for showing literal Markdown.
Copy only the inner fenced plantuml block.
```plantuml
@startuml
Alice -> Bob: hello
@enduml
```
Render check (plain plantuml block):
@startuml
Alice -> Bob: hello
@endumlIf PlantUML rendering is enabled, the additional block above should render as a diagram in preview. If rendering is not enabled, it will appear as a code block.
Use Markdown Preview Enhanced preview (its preview command/UI), not the built-in Markdown preview.
-
You see code instead of a diagram:
- Confirm the code fence language is exactly
plantumland the block contains@startuml/@enduml. - Confirm
myml.vscode-markdown-plantuml-previewis installed and enabled.
- Confirm the code fence language is exactly
-
Rendering fails:
- The URL in
markdown.plantuml.serveris unreachable (network/proxy/blocked host).
- The URL in
Extension page: https://marketplace.visualstudio.com/items?itemName=myml.vscode-markdown-plantuml-preview
-
Nothing renders:
markdown-preview-enhanced.plantumlJarPathis missing or points to a non-existent file.
-
Some diagrams fail or layout is broken:
- Java is missing (
java -versionmust work). - Graphviz is missing for that diagram type (
dot -Vmust work).
- Java is missing (
PlantUML prerequisites: https://plantuml.com/starting Graphviz/dot notes: https://plantuml.com/graphviz-dot
If your project uses glossary.adoc, AsciiDoc support in VS Code is
required.
Install:
- AsciiDoc (
asciidoctor.asciidoctor-vscode) https://marketplace.visualstudio.com/items?itemName=asciidoctor.asciidoctor-vscode
Open the .adoc file normally in VS Code. The extension provides
AsciiDoc editing support and preview support for glossary files.
-
Markdown PlantUML Preview (server-based): https://marketplace.visualstudio.com/items?itemName=myml.vscode-markdown-plantuml-preview
-
Markdown Preview Enhanced (local renderer option): https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced
-
MPE configuration reference (
markdown-preview-enhanced.plantumlJarPath): shd101wyy/vscode-markdown-preview-enhanced#1738 -
PlantUML prerequisites / getting started: https://plantuml.com/starting
-
PlantUML download (
plantuml.jar): https://plantuml.com/download -
Graphviz / dot notes: https://plantuml.com/graphviz-dot
-
VS Code AsciiDoc extension: https://marketplace.visualstudio.com/items?itemName=asciidoctor.asciidoctor-vscode