Skip to content

Commit 1376ce1

Browse files
committed
update
1 parent 1c82b3f commit 1376ce1

5 files changed

Lines changed: 47 additions & 47 deletions

File tree

_site/0-book/unit-5/section-3/1-map.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ When you call `map`, a **Dependency** is registered internally between the two `
3535

3636
The dependency created by `map` is **Static**. Once you define the relationship `labels = numbers.map(...)`, the rule itself—the transformation of the value—does not change later.
3737

38-
```mermaid
39-
flowchart LR
40-
Start --> Stop
38+
```d2
39+
Documentation -> Website: Starlight
4140
```
4241

4342
```txt
4443
+-----------------+ .map(x => `Score: ${x}`) +-----------------+
4544
| numbers | --------------------------------> | labels |
46-
| (Timeline<number>) | | (Timeline<string>) |
47-
+-----------------+ +-----------------+
45+
| (Timeline<number>) | | (Timeline<string>) |
46+
+-----------------+ +-----------------+
4847
^ |
4948
| .define(Now, 100) V
5049
+------------- Value propagates to "Score: 100"

astro.config.mjs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import rehypeMathjax from 'rehype-mathjax';
1212

1313
import mermaid from 'astro-mermaid';
1414

15+
import d2 from 'astro-d2';
16+
1517
export default defineConfig({
1618
// GitHub Pages configuration
1719
site: 'https://ken-okabe.github.io',
@@ -21,26 +23,23 @@ export default defineConfig({
2123
routing: {
2224
prefixDefaultLocale: true,
2325
},
24-
integrations: [
25-
mermaid(), // ⚠️ Must come BEFORE starlight
26-
starlight({
27-
title: 'Experience Quality Coding for AI',
28-
defaultLocale: 'en',
29-
locales: {
30-
en: { label: 'English', lang: 'en' },
31-
ja: { label: '日本語', lang: 'ja' }, // Label for language picker can be in Japanese
32-
},
33-
plugins: [
34-
// Call the imported plugin as a function
35-
starlightSidebarTopics(
36-
generatedTopics,
37-
{
38-
// Plugin options here, if any
39-
}
40-
),
41-
],
42-
}),
43-
],
26+
integrations: [ starlight({
27+
title: 'Experience Quality Coding for AI',
28+
defaultLocale: 'en',
29+
locales: {
30+
en: { label: 'English', lang: 'en' },
31+
ja: { label: '日本語', lang: 'ja' }, // Label for language picker can be in Japanese
32+
},
33+
plugins: [
34+
// Call the imported plugin as a function
35+
starlightSidebarTopics(
36+
generatedTopics,
37+
{
38+
// Plugin options here, if any
39+
}
40+
),
41+
],
42+
}), d2()],
4443
// Global Markdown configuration for Astro
4544
markdown: {
4645
remarkPlugins: [remarkMath],
@@ -62,4 +61,4 @@ export default defineConfig({
6261
// wrap: true,
6362
// },
6463
},
65-
});
64+
});

package-lock.json

Lines changed: 18 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dependencies": {
1414
"@astrojs/starlight": "^0.34.3",
1515
"astro": "^5.6.1",
16-
"astro-mermaid": "^1.0.4",
16+
"astro-d2": "^0.8.0",
1717
"fs-extra": "^11.3.0",
1818
"gray-matter": "^4.0.3",
1919
"mdast-util-to-string": "^4.0.0",

src/content/docs/en/book/unit-5/section-3/1-map.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,15 @@ When you call `map`, a **Dependency** is registered internally between the two `
3838

3939
The dependency created by `map` is **Static**. Once you define the relationship `labels = numbers.map(...)`, the rule itself—the transformation of the value—does not change later.
4040

41-
```mermaid
42-
flowchart LR
43-
Start --> Stop
41+
```d2
42+
Documentation -> Website: Starlight
4443
```
4544

4645
```txt
4746
+-----------------+ .map(x => `Score: ${x}`) +-----------------+
4847
| numbers | --------------------------------> | labels |
49-
| (Timeline<number>) | | (Timeline<string>) |
50-
+-----------------+ +-----------------+
48+
| (Timeline<number>) | | (Timeline<string>) |
49+
+-----------------+ +-----------------+
5150
^ |
5251
| .define(Now, 100) V
5352
+------------- Value propagates to "Score: 100"

0 commit comments

Comments
 (0)