Artifacts in Markdown
When to Use
Embedding self-contained renderable content (diagrams, HTML widgets, SVG, formatted docs) into a markdown file.
Prerequisites
- Target markdown file exists in the workspace
- Content is fully self-contained (no placeholders, no external references, no “see above”)
Procedure
- Choose the artifact
typefrom the supported types table below. - Pick a stable
identifierin kebab-case. Reuse the same identifier to update an existing artifact in place. - Write the artifact block using the syntax below.
- Set
display:panel(default — preview card, click opens side panel) orinline(renders in the document). Useinlineonly for short snippets. - Verify the body is complete and self-contained — no placeholders, no ellipses, no cross-references to surrounding text.
Syntax
Supported Types
type | content |
|---|---|
text/markdown | Full markdown text |
text/html | Full HTML document |
image/svg+xml | Full <svg xmlns="…">…</svg> |
application/vnd.mermaid | Mermaid source only — no ```mermaid fence |
application/vnd.markdown-file | Workspace path only (e.g. Forge/Output/foo.md) — not file body |
Rules
- No placeholders. Every artifact body must be complete and renderable on its own.
- Reuse identifiers. Same identifier = update in place. Different identifier = new artifact.
- No Mermaid fences. For
application/vnd.mermaid, provide raw Mermaid source without a```mermaidcode fence. - Markdown-file type = path only. For
application/vnd.markdown-file, the body is a workspace-relative file path, not the file contents. - Default display is
panel. Only useinlinefor short content that benefits from in-document rendering.