Skip to content

Authoring Stories

  • The .d2 file defines the structure and labels of the diagram.
  • The .story.yaml file defines narration, step order, and optional overlays such as detail panels or edge tooltips.
  • DiaScope treats the story file as the source of truth for walkthrough behavior.

nodes: values must match the D2 node names exactly, including nested paths.

D2 sourceStory nodes: value
ClientClient
System.ClientSystem.Client
"My Service"My Service

If a referenced node is missing in the rendered SVG, diascope build warns you before writing the final HTML.

Use # @step <id> markers when you want diascope init to scaffold the sidecar automatically.

# @step ingress
Client -> API Gateway
# @step inference
API Gateway -> Inference Service

Use detail_panels when you want node-specific explanatory content on click.

detail_panels:
Server: |
<p>Handles auth and routing.</p>
<ul>
<li>Rate limited: 1000 req/s</li>
</ul>

Use edge_tooltips when specific arrows need extra context.

edge_tooltips:
"POST /api/data": "Authenticated with Bearer token"
  • Keep each step focused on one beat.
  • Avoid inventing node IDs in the story file.
  • Prefer short, high-signal narration over prose blocks.
  • Run diascope build after any story edit to catch broken node references early.