1
0
mirror of https://github.com/docker/docs.git synced 2026-10-23 18:09:02 +03:00

40 Commits

Author SHA1 Message Date
Alexa Kristensen
e44889768c ux: improve Mermaid rendering and theme switching (#26304)
## Summary

**Problem:** Mermaid diagrams briefly showed their raw source before the
SVG appeared, stayed on the wrong palette after a light/dark theme
toggle, and could leave Mermaid's error graphic in the page when a
diagram failed to parse.

**Why this change:** Diagrams are used more often in the docs, so the
renderer needs to match the site theme and avoid flashing source text
while SVGs load.

**Solution:** Replace `mermaid.run()` with a controlled
`mermaid.render()` loop that caches each block's source, skips stale
async results, re-renders when the `<html>` dark class changes,
suppresses Mermaid's default error SVG, and hides `pre.mermaid` until an
SVG is present (or a render error sets `data-error` so the source can
still be inspected).

@netlify /get-started/docker-concepts/the-basics/what-is-a-registry/

Preview:
https://deploy-preview-26304--docsdocker.netlify.app/get-started/docker-concepts/the-basics/what-is-a-registry/
Example of pre-fix behavior:
https://deploy-preview-26283--docsdocker.netlify.app/accounts/organization/

Generated by Cursor

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-08 10:41:05 -05:00
David Karlsson
c93c72c7c2 Merge pull request #25979 from dvdksn/codex/sandbox-interactive-diagram
docs: prototype interactive Sandboxes diagram
2026-09-21 16:23:46 +02:00
David Karlsson
d95336d485 Merge pull request #25178 from dvdksn/mermaid-codeblock-hook
layouts: render mermaid code blocks as diagrams
2026-05-27 14:49:57 +02:00
David Karlsson
9789556384 layouts: render ```mermaid code blocks as diagrams
Adds a Hugo codeblock render hook that turns ```mermaid fences into
<pre class="mermaid"> containers, plus a lazily-loaded mermaid bundle
that only ships on pages that actually contain a diagram. Mirrors the
existing YouTube embed pattern (Store flag + conditional script tag in
baseof) so the main scripts.js bundle stays unchanged.
2026-05-27 11:08:46 +02:00
David Karlsson
28ca826bf1 analytics: fix Marlin endpoint URL double-encoding in head.html
Hugo's html/template JS-escapes string values inside <script> blocks.
Calling jsonify per-field produced quoted strings like "https://..."
which were then re-escaped, embedding literal quote characters in the
endpoint value passed to the SDK.

Fix by jsonifying the whole config dict at once and marking it safeJS
so html/template does not apply a second round of escaping.

Also extract the environment ternary out of the Marlin constructor call
for readability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:42:49 +02:00
David Karlsson
a6c2209c7f analytics: add Marlin SDK and migrate dropdown Heap markers
Introduces @docker/marlin-sdk-web-public for first-party pageview and
click analytics, bundled into scripts.js via Hugo's existing js.Build
pipeline. Config is emitted to window.__marlinConfig from head.html and
gated to prod/staging only.

Renames data-heap-id attributes on the markdown-dropdown buttons to
marlin-action so they are picked up by the SDK's auto-click tracking.

TODO: replace the REPLACE-ME endpoint placeholders in hugo.yaml with
the canonical Marlin ingestion URLs from the data-platform team.

TODO: heap.track() calls in youtube-script.html are left in place —
the public SDK exposes no equivalent track() method, so video
play/pause events cannot be migrated yet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2026-05-22 13:40:16 +02:00
David Karlsson
db740fe266 docs: add auto/system theme option to theme toggle (#24519)
> 🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Summary

`theme.js` unconditionally wrote the resolved preference to
`localStorage` on every page load, permanently locking in a concrete
`"light"` or `"dark"` value even for first-time visitors — making it
impossible to track OS preference changes after any site visit. Removed
the unconditional `localStorage.setItem` from `theme.js` so the early
script only reads (never writes); the Alpine.js toggle in `header.html`
now cycles through three states (light → dark → auto), with "auto"
removing the `theme-preference` key and resolving from
`prefers-color-scheme` with a live `matchMedia` change listener so the
theme updates immediately when the OS preference changes. A contrast
icon indicates auto mode; all three icon spans are driven by Alpine
`x-show` directives rather than pure CSS dark-mode classes.

**Verified:** logic matches the standard three-state pattern;
`prefers-color-scheme` media query and `matchMedia` change listener are
the canonical browser APIs for system-preference tracking.
**Checked:** no other files reference `theme-preference` or the theme
toggle; no CSS changes required.

Closes #23177

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 06:19:52 +02:00
David Karlsson
2c59158bc3 site: update landing page layout
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2026-01-21 15:56:23 +01:00
David Karlsson
f0dd5b6c80 site(gordon): do not persist open state
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2026-01-13 12:21:28 +01:00
David Karlsson
14d73dab86 site(gordon): escape HTML in markdown text to preserve angle brackets
Configure marked.js to escape HTML entities in text tokens while
preserving code blocks. This allows angle brackets like <target-name>
to display correctly in regular text without being interpreted as HTML
tags, while keeping code examples intact.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2026-01-13 12:21:28 +01:00
David Karlsson
d3a595ef6a site: use gordon for ask ai
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2026-01-13 12:21:28 +01:00
David Karlsson
c36309ed8a hugo: render site navigation using sections
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-09-09 10:51:38 +02:00
David Karlsson
97307d4c66 search: pagefind v1.1.0
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-05-23 14:05:59 +02:00
David Karlsson
5599686cb9 hugo: return keywords as sliceArray
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-05-13 15:23:28 +02:00
David Karlsson
4b66d6d7d5 search: tweak fuse.js config
By enabling ignoreLocation and useExtendedSearch, we ensure
space-delimited keywords are not matched as a single phrase, and the
location of those individual matches does not matter

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-05-08 20:07:17 +02:00
David Karlsson
6ccbfa3f64 hugo: use fuse.js search instead of algolia
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-04-26 14:36:13 +02:00
David Karlsson
c27e60b369 fix: only add toc eventlistener if toc exists
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-04-24 18:14:02 +02:00
Ajeet Singh Raina, Docker Captain, ARM Innovator
a846de1787 Add documentation for core Docker concepts and guides (#19691)
* Added the-basic pages
---------

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: Michael Irwin <mikesir87@gmail.com>
Co-authored-by: Craig Osterhout <103533812+craig-osterhout@users.noreply.github.com>
2024-03-27 14:09:35 -07:00
David Karlsson
36d3f62159 feat: add tooltip partial
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-02-23 15:03:27 +01:00
David Karlsson
adcb1edfa7 chore: style and script refactor
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-02-23 15:03:27 +01:00
David Karlsson
f3b44a4476 cli: change reference docs url paths
Moves the reference documentation to a new subpath, from /engine/ to /reference/
2024-02-21 10:25:53 +01:00
David Karlsson
f6191387b6 chore: remove mermaid.js
We're not using mermaid for diagrams anymore so we can prune the
dependency.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-02-01 09:46:24 +01:00
David Karlsson
558fbdfabc hugo: use inline svgs for sidebar icons
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-25 12:28:38 +01:00
David Karlsson
a6a5cb5ebe js: remove sidebar scrolldown effect
When accessing a page that's far down the left-hand sidebar, we have a
script that would scroll the sidebar position down so that the selected
item is visible. In some cases, this would cause some confusion and
jittery rendering on page load.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-25 08:35:41 +01:00
David Karlsson
299ffee524 hugo: improve sidebar rendering and behavior
Removes the alpine.js components for the sidebar, and uses vanilla
eventlisteners instead. Also moved off javascript for handling the
expanse/collapse display, in favor of using css only.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-24 16:34:00 +01:00
David Karlsson
91a2200a11 fix: dockerfile tooltips should match only keywords
Before this change, the Dockerfile tooltip script marked all occurences
of keywords, as defined by the lexer, as Dockerfile instructions in a
`dockerfile` code block. This meant some tokens parsed from heredocs
would be included. The matched keyword token is now compared against a
hard-coded list of actual Dockerfile instructions before they're
annotated.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-12 12:14:18 +01:00
David Karlsson
db85f53af1 feat: improve heading markup and scroll behavior
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-11-12 20:35:34 +01:00
David Karlsson
f64276790d feat: numbered lines for code blocks
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-10-30 20:48:59 +01:00
David Karlsson
ec22fd57f5 feat: add dockerfile tooltips
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-10-13 14:31:34 +02:00
David Karlsson
d603fb6571 ux: enable search for non-prod deploys
Search results include the hostname by default.
This change strips the hostname which makes it
possible to search when the site is deployed on
other domains, such as netlify and localhost.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-24 15:14:15 +02:00
David Karlsson
a0d21ade2f migrate to hugo
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-22 09:41:02 +02:00
Craig Osterhout
59bcc82aba Improve undefined error in EULA. (#17187)
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
2023-05-02 08:48:44 -07:00
craig-osterhout
eb774bd5fd add check in modal.js 2023-04-19 08:29:30 -07:00
CrazyMax
c7d42efd55 do not append anchorLink for tiles
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-17 16:41:46 +01:00
Allie Sadler
58a506a8a9 modal fix (#16591) 2023-01-25 15:06:06 +00:00
Allie Sadler
ad4c5dd659 image zoom modal (#15975)
* POC image modal

* standardize image size

* fixes

* fixes

* reverse an earlier commit and tweak further

* experiments

* more playing around

* simplify

* David's magic

* david fix

* test

* test 2

* Final fix

* now the final fix
2023-01-10 17:01:21 +00:00
Alexey Pyltsyn
41b42d94fe Enable dark mode in browser UI (#16025) 2022-10-31 15:29:01 +01:00
craig-osterhout
6fa06e8174 remove $ prompt from code copy 2022-10-21 09:03:57 -07:00
David Karlsson
24158cc3c2 add code copy feature (#15910)
Signed-off-by: David Karlsson <david.karlsson@docker.com>
2022-10-19 14:29:26 +02:00
CrazyMax
998bfbfd09 jekyll(assets): move css to assets folder
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-05 15:49:22 +02:00