Skip to content

Commit 992a313

Browse files
authored
docs: add tty docs section with API reference (#60)
* docs: add tty docs section with API reference * docs: expand API documentation with architecture details and input module explanation --------- Signed-off-by: paul valladares <85648028+dreyfus92@users.noreply.github.com>
1 parent cd8496c commit 992a313

14 files changed

Lines changed: 1974 additions & 2 deletions

astro.config.mjs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import starlight from "@astrojs/starlight";
44
import ecTwoSlash from "expressive-code-twoslash";
55
import topics from "starlight-sidebar-topics";
66
import starlightMarkdown from "starlight-markdown";
7+
import mermaid from "astro-mermaid";
8+
import { fileURLToPath } from "node:url";
9+
10+
const docsRoot = fileURLToPath(new URL(".", import.meta.url));
711

812
const site = "https://bomb.sh/docs/";
913

@@ -21,6 +25,7 @@ export default defineConfig({
2125
}
2226
},
2327
integrations: [
28+
mermaid({ autoTheme: true }),
2429
starlight({
2530
title: "Bombshell",
2631
logo: {
@@ -40,7 +45,18 @@ export default defineConfig({
4045
cursorColor: 'rgba(255 0 210)'
4146
}
4247
},
43-
plugins: [ecTwoSlash()],
48+
plugins: [ecTwoSlash({
49+
twoslashOptions: {
50+
compilerOptions: {
51+
module: 99,
52+
moduleResolution: 100,
53+
baseUrl: docsRoot,
54+
paths: {
55+
"@bomb.sh/tty": ["node_modules/@bomb.sh/tty/esm/mod.d.ts"],
56+
},
57+
},
58+
},
59+
})],
4460
},
4561
editLink: {
4662
baseUrl: "https://github.com/bombshell-dev/docs/edit/main/",
@@ -124,6 +140,27 @@ export default defineConfig({
124140
link: "/tab/",
125141
items: [],
126142
},
143+
{
144+
label: "TTY",
145+
id: "tty",
146+
icon: "seti:config",
147+
link: "/tty/basics/getting-started",
148+
items: [
149+
{ label: "Basics", autogenerate: { directory: "tty/basics" } },
150+
{ label: "Guides", autogenerate: { directory: "tty/guides" } },
151+
{
152+
label: "API",
153+
items: [
154+
{ label: "Overview", link: "/tty/api/" },
155+
{ label: "Ops", link: "/tty/api/ops" },
156+
{ label: "Term", link: "/tty/api/term" },
157+
{ label: "Input", link: "/tty/api/input" },
158+
{ label: "Settings", link: "/tty/api/settings" },
159+
{ label: "Termcodes", link: "/tty/api/termcodes" },
160+
],
161+
},
162+
],
163+
},
127164
]),
128165
],
129166
}),

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"dependencies": {
1717
"@astrojs/starlight": "^0.37.1",
1818
"@bomb.sh/args": "^0.3.1",
19+
"@bomb.sh/tty": "^0.8.0",
1920
"@clack/core": "^1.4.3",
2021
"@clack/prompts": "^1.7.0",
2122
"@types/node": "^22.19.3",
@@ -26,7 +27,9 @@
2627
"@xterm/xterm": "^6.0.0",
2728
"arktype": "^2.2.0",
2829
"astro": "^5.16.6",
30+
"astro-mermaid": "^2.1.0",
2931
"expressive-code-twoslash": "^0.5.3",
32+
"mermaid": "^11.16.0",
3033
"sharp": "^0.33.5",
3134
"starlight-markdown": "^0.1.5",
3235
"starlight-sidebar-topics": "^0.6.2"

0 commit comments

Comments
 (0)