From 6462e5865094500873b45eaa45c9c3d6443f335e Mon Sep 17 00:00:00 2001 From: ChristopherPHolder Date: Sat, 7 Nov 2026 14:01:33 +0100 Subject: [PATCH] docs: callout icons, line highlights, diffs and copy-link anchors Callouts get an icon per kind. Fenced blocks accept a {1,3-4} attribute that highlights lines, and diff blocks mark added and removed lines (copying a diff gives the resulting file). Heading anchors become a link icon that copies the section's URL and confirms with a small toast. Content: the recorder export steps highlight the lines they add, and the init page shows the rc file change as a diff. Closes #319 --- packages/docs/src/app/docs/_doc-overlays.scss | 48 +++++++++++ packages/docs/src/app/docs/doc-page.html | 15 ++++ packages/docs/src/app/docs/doc-page.ts | 35 +++++++- packages/docs/src/app/docs/markdown.ts | 83 ++++++++++++++++++- packages/docs/src/content/cli/init.md | 16 ++++ .../content/user-flows/recorder-exports.md | 4 +- packages/docs/src/styles.scss | 56 ++++++++++++- 7 files changed, 247 insertions(+), 10 deletions(-) diff --git a/packages/docs/src/app/docs/_doc-overlays.scss b/packages/docs/src/app/docs/_doc-overlays.scss index 249ae37b..c31852e7 100644 --- a/packages/docs/src/app/docs/_doc-overlays.scss +++ b/packages/docs/src/app/docs/_doc-overlays.scss @@ -316,3 +316,51 @@ transform: scale(0.92) translateY(8px); } } + +/* A small confirmation that rises from the bottom, e.g. after copying a link. */ +.toast { + position: fixed; + z-index: 40; + left: 50%; + bottom: var(--space-6); + display: inline-flex; + align-items: center; + gap: var(--space-2); + padding: var(--space-2) var(--space-4); + border-radius: var(--radius-full); + background: var(--color-neutral-900); + color: var(--color-neutral-50); + box-shadow: var(--shadow-lg); + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 500; + opacity: 0; + translate: -50% 12px; + pointer-events: none; + transition: + opacity var(--duration-base) ease-out, + translate var(--duration-base) var(--ease-out); + + svg { + width: 1rem; + height: 1rem; + color: var(--color-success-400); + } +} + +.toast-visible { + opacity: 1; + translate: -50% 0; +} + +:root[data-theme='dark'] .toast { + background: var(--color-neutral-50); + color: var(--color-neutral-900); +} + +@media (prefers-color-scheme: dark) { + :root:not([data-theme='light']) .toast { + background: var(--color-neutral-50); + color: var(--color-neutral-900); + } +} diff --git a/packages/docs/src/app/docs/doc-page.html b/packages/docs/src/app/docs/doc-page.html index 258751e8..441c02a4 100644 --- a/packages/docs/src/app/docs/doc-page.html +++ b/packages/docs/src/app/docs/doc-page.html @@ -182,6 +182,21 @@

{{ doc().page.title +
+ + {{ toast() }} +
+