Skip to content

Commit f816e14

Browse files
Merge pull request #51 from IntersectMBO/docs/comprehensive-architecture-documentation
docs: Add comprehensive architecture documentation
2 parents 73a1e18 + 7d42e0d commit f816e14

File tree

143 files changed

+6428
-2165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+6428
-2165
lines changed

docs/app/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
@import 'tailwindcss';
22
@import 'fumadocs-ui/css/neutral.css';
33
@import 'fumadocs-ui/css/preset.css';
4+
@import 'fumadocs-twoslash/twoslash.css';

docs/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "@/app/global.css"
2+
import "@/app/twoslash.css"
23
// import { RootProvider } from "fumadocs-ui/provider"
34
import { Provider } from "./provider"
45

docs/app/twoslash.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* Twoslash type hover styles */
2+
@import '@shikijs/twoslash/style-rich.css';

docs/components/mdx/mermaid.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
'use client';
2+
import { use, useEffect, useId, useState } from 'react';
3+
import { useTheme } from 'next-themes';
4+
5+
export function Mermaid({ chart }: { chart: string }) {
6+
const [mounted, setMounted] = useState(false);
7+
useEffect(() => {
8+
setMounted(true);
9+
}, []);
10+
11+
if (!mounted) return;
12+
13+
return <MermaidContent chart={chart} />;
14+
}
15+
16+
const cache = new Map<string, Promise<unknown>>();
17+
18+
function cachePromise<T>(
19+
key: string,
20+
setPromise: () => Promise<T>,
21+
): Promise<T> {
22+
const cached = cache.get(key);
23+
if (cached) return cached as Promise<T>;
24+
25+
const promise = setPromise();
26+
cache.set(key, promise);
27+
return promise;
28+
}
29+
30+
function MermaidContent({ chart }: { chart: string }) {
31+
const id = useId();
32+
const { resolvedTheme } = useTheme();
33+
const { default: mermaid } = use(
34+
cachePromise('mermaid', () => import('mermaid')),
35+
);
36+
37+
mermaid.initialize({
38+
startOnLoad: false,
39+
securityLevel: 'loose',
40+
fontFamily: 'inherit',
41+
themeCSS: 'margin: 1.5rem auto 0;',
42+
theme: resolvedTheme === 'dark' ? 'dark' : 'default',
43+
});
44+
45+
const { svg, bindFunctions } = use(
46+
cachePromise(`${chart}-${resolvedTheme}`, () => {
47+
return mermaid.render(id, chart.replaceAll('\\n', '\n'));
48+
}),
49+
);
50+
51+
return (
52+
<div
53+
ref={(container) => {
54+
if (container) bindFunctions?.(container);
55+
}}
56+
dangerouslySetInnerHTML={{ __html: svg }}
57+
/>
58+
);
59+
}

docs/components/search.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import { useDocsSearch } from "fumadocs-core/search/client"
1414
import { create } from "@orama/orama"
1515
import { useI18n } from "fumadocs-ui/contexts/i18n"
1616

17-
function initOrama() {
18-
return create({
17+
async function initOrama() {
18+
return await create({
1919
schema: { _: "string" },
2020
// https://docs.orama.com/docs/orama-js/supported-languages
2121
language: "english"
@@ -34,6 +34,7 @@ export default function DefaultSearchDialog(props: SharedProps) {
3434

3535
const { search, setSearch, query } = useDocsSearch({
3636
type: "static",
37+
// @ts-ignore - Orama type mismatch with fumadocs-core
3738
initOrama,
3839
locale,
3940
from: apiFrom
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Address Construction
3+
description: How to build Cardano addresses from keys and credentials
4+
---
5+
6+
# Address Construction
7+
8+
Content coming soon.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Address Conversion
3+
description: Convert between different address formats
4+
---
5+
6+
# Address Conversion
7+
8+
Content coming soon.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Addresses
3+
description: Working with Cardano addresses in Evolution SDK
4+
---
5+
6+
# Addresses
7+
8+
Content coming soon.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"title": "Addresses",
3+
"pages": [
4+
"index",
5+
"construction",
6+
"conversion",
7+
"types",
8+
"validation"
9+
]
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Address Types
3+
description: Different types of Cardano addresses and their uses
4+
---
5+
6+
# Address Types
7+
8+
Content coming soon.

0 commit comments

Comments
 (0)