From b4ce338ae63c12491eb37bfe84760acd7d2431d6 Mon Sep 17 00:00:00 2001 From: Max Elkins Date: Tue, 7 Apr 2026 23:11:41 +0100 Subject: [PATCH 1/9] feat: add astro specific `.prettierrc` so that editors (vscode) can auto-format files not in /website --- .prettierrc | 12 +----------- website/.prettierrc | 11 +++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 website/.prettierrc diff --git a/.prettierrc b/.prettierrc index d87faa5..0967ef4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,11 +1 @@ -{ - "plugins": ["prettier-plugin-astro"], - "overrides": [ - { - "files": "*.astro", - "options": { - "parser": "astro" - } - } - ] -} +{} diff --git a/website/.prettierrc b/website/.prettierrc new file mode 100644 index 0000000..d87faa5 --- /dev/null +++ b/website/.prettierrc @@ -0,0 +1,11 @@ +{ + "plugins": ["prettier-plugin-astro"], + "overrides": [ + { + "files": "*.astro", + "options": { + "parser": "astro" + } + } + ] +} From 045023c241bd0b8677c4d40a26e50dd1502ab391 Mon Sep 17 00:00:00 2001 From: Max Elkins Date: Tue, 7 Apr 2026 23:37:12 +0100 Subject: [PATCH 2/9] fix: add default link color --- website/src/styles/reset.css | 1 + 1 file changed, 1 insertion(+) diff --git a/website/src/styles/reset.css b/website/src/styles/reset.css index f41d8d1..30dc662 100644 --- a/website/src/styles/reset.css +++ b/website/src/styles/reset.css @@ -54,6 +54,7 @@ p { a:not([class]) { text-decoration-skip-ink: auto; color: currentColor; + color: var(--sapphire); } /* Make images easier to work with */ img, From 649f046c5253460a344a15c8726697c1a92b61b4 Mon Sep 17 00:00:00 2001 From: Max Elkins Date: Tue, 7 Apr 2026 23:37:31 +0100 Subject: [PATCH 3/9] feat: add global table and code styles --- website/src/styles/global.css | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/website/src/styles/global.css b/website/src/styles/global.css index 140f72e..eb01ed5 100644 --- a/website/src/styles/global.css +++ b/website/src/styles/global.css @@ -111,3 +111,75 @@ button, align-items: center; gap: 0.5rem; } + +/* ── Table ─────────────────────────────────────────────────────── */ + +table { + --stroke: 1px solid var(--surface1); + border: var(--stroke); + border-collapse: collapse; + width: 100%; +} + +th { + text-align: left; + font-weight: bold; +} + +thead th { + padding-block: 0.75rem; +} + +td, +th { + padding: 0.75rem; +} + +th:not(:only-of-type) { + border-block-end: var(--stroke); +} + +th:only-of-type { + border-inline-end: var(--stroke); +} + +:is(th, td) ~ :is(th, td) { + border-inline-start: var(--stroke); +} + +tr + tr :is(th, td) { + border-block-start: var(--stroke); +} + +/* ── Code ─────────────────────────────────────────────────────── */ + +:is(code, kbd, samp) { + background: var(--crust); + border-radius: 2px; + + @media (prefers-color-scheme: dark) { + background: var(--surface0); + } + + font-family: var(--font-mono); + padding: 0.2em 0.2em 0.05em 0.2em; + hyphens: none; + tab-size: 2; + text-align: left; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + box-decoration-break: clone; +} + +pre:has(code) { + width: max-content; + max-width: 100%; + overflow-x: auto; +} + +pre code { + border: none; + background: none; + padding: 0; +} From 5cebe7a7ebba6502d027a6b982f7918a968afb81 Mon Sep 17 00:00:00 2001 From: Max Elkins Date: Tue, 7 Apr 2026 23:38:14 +0100 Subject: [PATCH 4/9] feat: add usage table to homepage and general tidy up --- website/src/pages/index.astro | 156 +++++++++++++++------------------- 1 file changed, 70 insertions(+), 86 deletions(-) diff --git a/website/src/pages/index.astro b/website/src/pages/index.astro index 034af07..84dcfee 100644 --- a/website/src/pages/index.astro +++ b/website/src/pages/index.astro @@ -29,7 +29,9 @@ import HdiLogo from "../components/HdiLogo.astro"; > + fill="currentColor" + > + {VERSION} @@ -48,9 +50,7 @@ import HdiLogo from "../components/HdiLogo.astro";

Install

-

- Works on macOS and Linux (probably WSL2 also). -

+

Works on macOS and Linux (probably WSL2 also).

@@ -76,39 +76,66 @@ import HdiLogo from "../components/HdiLogo.astro"; etc. It extracts the fenced code blocks from matching sections and presents them as an interactive, executable list.

+

Usage

-
$ cd some-project
-$ hdi
-[hdi] some-project
 
-  Installation
-  ▶ npm install
-    cp .env.example .env
+      
+      
+        
+          
+            
+            
+          
+        
+        
+          
+            
+            
+          
+          
+            
+            
+          
+          
+            
+            
+          
+          
+            
+            
+          
+          
+            
+            
+          
+          
+            
+            
+          
+        
+      
CommandDescription
hdiInteractive picker — shows all sections (default)
hdi installJust install/setup commands (aliases: setup, i)
hdi runJust run/start commands (aliases: start, r)
hdi testJust test commands (alias: t)
hdi deployJust deploy/release commands and platform detection (alias: d)
hdi allAll sections (aliases: a)
- Run - npm run dev - ↑↓ navigate ⇥ sections ⏎ execute c copy q quit
- -
- @@ -118,42 +145,39 @@ $ hdi /* ── About page ─────────────────────────────────────────────────────── */ .about { + --space: 3rem; + flex: 1; padding: 2rem 1.5rem; max-width: 48rem; margin: 0 auto; width: 100%; - --space: 3rem; - h2 { font-size: 1.25rem; color: var(--sapphire); margin-bottom: 1.5rem; + display: flex; + align-items: center; + gap: 0.5rem; } h2::before { content: "▸ "; } + h2::after { + content: ""; + flex: 1; + background-color: var(--surface1); + block-size: 1px; + } + p { line-height: 1.5; - - code { - background: var(--crust); - padding: 0.125em 0.375em; - border-radius: 2px; - - @media (prefers-color-scheme: dark) { - background: var(--surface0); - } - } + margin-block-start: 0.75rem; } } - .about .links-section { - margin-top: 1.5rem; - } - /* ── Hero ─────────────────────────────────────────────────────── */ .hero { @@ -165,8 +189,8 @@ $ hdi } .hero-header { - align-items: center; --space: 1.5rem; + align-items: center; } .hero h1 { @@ -178,8 +202,8 @@ $ hdi } .hero-content { - align-items: center; --space: 1.5rem; + align-items: center; } .hero-text { @@ -213,62 +237,22 @@ $ hdi border: 0.0625rem solid var(--surface0); } - .demo-link { - margin-top: 0.75rem; - text-align: left; - } - - .demo-link a { - color: var(--sapphire); - } - /* ── Install ─────────────────────────────────────────────────────── */ .install-note { - margin-top: 0.75rem; color: var(--subtext0); } /* ── Usage ─────────────────────────────────────────────────────── */ - .usage-block { - background: var(--mantle); - border: 0.0625rem solid var(--surface0); - border-radius: 0.375rem; - padding: 1rem 1.25rem; - overflow-x: auto; - line-height: 1.6; - margin-bottom: 1.25rem; - } - - .usage-block code { - font-family: var(--font-mono); - color: var(--text); - } - - .u-yellow { - color: var(--yellow); - } - .u-sapphire { - color: var(--sapphire); - } - .u-green { - color: var(--green); - } - - .usage-docs-link a { - color: var(--sapphire); - text-decoration: none; - } - - .usage-docs-link a:hover { - text-decoration: underline; + td:first-child, + th:first-child { + min-width: min(20ch, 30vw); } /* ── Responsive ─────────────────────────────────────────────────────── */ @media (max-width: 43.75rem) { - /* About */ .about { padding: 1rem 1.5rem 2rem; } From 3f3b162ac207eaa49071ae73dbc1475aed91558c Mon Sep 17 00:00:00 2001 From: Max Elkins Date: Tue, 7 Apr 2026 23:43:35 +0100 Subject: [PATCH 5/9] refactor: render table of commands via markdown for better maintainability --- website/src/data/commands.md | 8 ++++++ website/src/pages/index.astro | 46 ++++++----------------------------- 2 files changed, 15 insertions(+), 39 deletions(-) create mode 100644 website/src/data/commands.md diff --git a/website/src/data/commands.md b/website/src/data/commands.md new file mode 100644 index 0000000..cc1906b --- /dev/null +++ b/website/src/data/commands.md @@ -0,0 +1,8 @@ +| Command | Description | +| ------------- | ---------------------------------------------------------------- | +| `hdi` | Interactive picker — shows all sections (default) | +| `hdi install` | Just install/setup commands (aliases: `setup`, `i`) | +| `hdi run` | Just run/start commands (aliases: `start`, `r`) | +| `hdi test` | Just test commands (alias: `t`) | +| `hdi deploy` | Just deploy/release commands and platform detection (alias: `d`) | +| `hdi all` | All sections (aliases: `a`) | diff --git a/website/src/pages/index.astro b/website/src/pages/index.astro index 84dcfee..143e210 100644 --- a/website/src/pages/index.astro +++ b/website/src/pages/index.astro @@ -5,6 +5,7 @@ import DemoLatte from "../assets/demo-latte.gif"; import DemoMocha from "../assets/demo-mocha.gif"; import { VERSION } from "../data/data"; import HdiLogo from "../components/HdiLogo.astro"; +import { Content as CommandTable } from "../data/commands.md"; --- @@ -90,43 +91,9 @@ import HdiLogo from "../components/HdiLogo.astro";

Usage

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
hdiInteractive picker — shows all sections (default)
hdi installJust install/setup commands (aliases: setup, i)
hdi runJust run/start commands (aliases: start, r)
hdi testJust test commands (alias: t)
hdi deployJust deploy/release commands and platform detection (alias: d)
hdi allAll sections (aliases: a)
- - +
+ +