Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 6333744

Browse files
committed
Add mermaid-mdx and basic sitewide config.
1 parent a57fdf3 commit 6333744

File tree

5 files changed

+1592
-13
lines changed

5 files changed

+1592
-13
lines changed

docs/apis.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ description: 'Building HTTP APIs with Nitric'
66

77
Nitric has built-in support for web apps and HTTP API development. The `api` resource allows you to create APIs in your applications, including routing, middleware and request handlers.
88

9+
## Architecture
10+
11+
```mermaid
12+
graph LR;
13+
classDef default line-height:1.2;
14+
15+
A[Api]-->B[Service A];
16+
A-->C[Service B];
17+
```
18+
919
## Creating APIs
1020

1121
Nitric allows you define named APIs, each with their own routes, middleware, handlers and security.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
"lucide-react": "^0.445.0",
6363
"mdast-util-to-string": "^4.0.0",
6464
"mdx-annotations": "^0.1.1",
65+
"mdx-mermaid": "^2.0.3",
66+
"mermaid": "^11.4.1",
6567
"next": "^14.2.15",
6668
"next-contentlayer2": "^0.5.1",
6769
"next-themes": "^0.3.0",

src/components/mdx.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,6 @@ export { Tabs, TabItem } from '@/components/tabs/Tabs'
108108

109109
export { CodeTabs } from '@/components/code/CodeTabs'
110110

111+
export { Mermaid } from 'mdx-mermaid/Mermaid'
112+
111113
// see if we need to remove these

src/mdx/remark.mjs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
import { mdxAnnotations } from 'mdx-annotations'
22
import remarkGfm from 'remark-gfm'
3+
import mdxMermaid from 'mdx-mermaid'
34

4-
export const remarkPlugins = [mdxAnnotations.remark, remarkGfm]
5+
export const remarkPlugins = [
6+
mdxAnnotations.remark,
7+
remarkGfm,
8+
[
9+
mdxMermaid,
10+
{
11+
output: 'svg',
12+
mermaid: {
13+
theme: 'base',
14+
themeVariables: {
15+
primaryColor: '#ff0000',
16+
secondaryColor: '#00ff00',
17+
tertiaryColor: '#0000ff',
18+
textColor: '#000000',
19+
fontSize: '14px',
20+
fontFamily: 'Fira Code, monospace',
21+
},
22+
},
23+
},
24+
],
25+
]

0 commit comments

Comments
 (0)