mirror of
https://codeberg.org/JasterV/jaster.xyz.git
synced 2026-04-26 18:10:01 +00:00
Add D2 as a diagramming tool
This commit is contained in:
parent
8e8a89f279
commit
43e2798fb1
5 changed files with 22 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -19,3 +19,6 @@ pnpm-debug.log*
|
||||||
.env
|
.env
|
||||||
.env.production
|
.env.production
|
||||||
|
|
||||||
|
# Ignore automatic generated diagrams from D2
|
||||||
|
public/assets/d2/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { defineConfig } from "astro/config";
|
import { defineConfig } from "astro/config";
|
||||||
import icon from "astro-icon";
|
import icon from "astro-icon";
|
||||||
|
|
||||||
import sitemap from "@astrojs/sitemap";
|
import sitemap from "@astrojs/sitemap";
|
||||||
|
import d2 from "astro-d2";
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
|
@ -15,5 +15,18 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
sitemap(),
|
sitemap(),
|
||||||
|
// Refer to: https://astro-d2.vercel.app/configuration/
|
||||||
|
d2({
|
||||||
|
// Outputs to `public/assets/d2`
|
||||||
|
output: "assets/d2",
|
||||||
|
sketch: true,
|
||||||
|
pad: 50,
|
||||||
|
layout: "dagre",
|
||||||
|
// https://d2lang.com/tour/themes/
|
||||||
|
theme: {
|
||||||
|
default: "3",
|
||||||
|
dark: "200",
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
|
||||||
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
|
@ -15,6 +15,7 @@
|
||||||
"@astrojs/check": "^0.9.4",
|
"@astrojs/check": "^0.9.4",
|
||||||
"@astrojs/sitemap": "^3.4.0",
|
"@astrojs/sitemap": "^3.4.0",
|
||||||
"astro": "^5.8.1",
|
"astro": "^5.8.1",
|
||||||
|
"astro-d2": "^0.8.0",
|
||||||
"astro-icon": "^1.1.5",
|
"astro-icon": "^1.1.5",
|
||||||
"typescript": "^5.8.3"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,11 @@ We skip all of that for the sake of making this very simple, but I think having
|
||||||
|
|
||||||
Let's look at a simple diagram.
|
Let's look at a simple diagram.
|
||||||
|
|
||||||
|
```d2 title="Door IoT Ws client"
|
||||||
|
direction: right
|
||||||
|
|
||||||
|
Documentation -> Starlight -> Website: {style.animated: true}
|
||||||
Let's look at some code:
|
```
|
||||||
|
|
||||||
## Let's get into code
|
## Let's get into code
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue