RPIC

link

rpic extension. link makes an object a hyperlink: its SVG shape group is wrapped in <a href="…">, so clicking the shape — label included — navigates to the URL. No JavaScript, no host wiring: it’s native SVG, and it works wherever the SVG is a real document (inline-embedded, <img src>, or opened directly).

Two forms write to the same hook — and since this page is a host document, these are live links (click them!):

.PS
box "rpic.dev" fit link "https://rpic.dev"     # inline, at creation

A: circle "GitHub" rad 0.42 at last box + (1.6, 0)
arrow from last box.e to A.w
link A "https://github.com/milkway/rpic-lang"  # statement: by label
.PE

The statement form uses pic’s native references — labels and ordinals — so it also reaches shapes drawn inside macros (circuit elements!), and lets link lines cluster at the end of a picture.

Rules

Thin strokes are small click targets

An open object (a line or arc) is only as clickable as its stroke is wide. For a generous hit area, link a filled shape near it, or thicken the stroke (thick 1.6).

Cross-linking a diagram

Fragments (#…) and relative URLs pass validation, so a picture can link into its own page — a table of contents that is also the system diagram:

.PS
B1: box "Rules" fit link "#rules"
arrow
B2: box "Cross-linking" fit link "#cross-linking-a-diagram"
.PE

Design notes: docs/extensions.md.