radiant-docs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/index.js +312 -0
  2. package/package.json +38 -0
  3. package/template/.vscode/extensions.json +4 -0
  4. package/template/.vscode/launch.json +11 -0
  5. package/template/astro.config.mjs +216 -0
  6. package/template/ec.config.mjs +51 -0
  7. package/template/package-lock.json +12546 -0
  8. package/template/package.json +51 -0
  9. package/template/public/favicon.svg +9 -0
  10. package/template/src/assets/icons/check.svg +33 -0
  11. package/template/src/assets/icons/danger.svg +37 -0
  12. package/template/src/assets/icons/info.svg +36 -0
  13. package/template/src/assets/icons/lightbulb.svg +74 -0
  14. package/template/src/assets/icons/warning.svg +37 -0
  15. package/template/src/components/Header.astro +176 -0
  16. package/template/src/components/MdxPage.astro +49 -0
  17. package/template/src/components/OpenApiPage.astro +270 -0
  18. package/template/src/components/Search.astro +362 -0
  19. package/template/src/components/Sidebar.astro +19 -0
  20. package/template/src/components/SidebarDropdown.astro +149 -0
  21. package/template/src/components/SidebarGroup.astro +51 -0
  22. package/template/src/components/SidebarLink.astro +56 -0
  23. package/template/src/components/SidebarMenu.astro +46 -0
  24. package/template/src/components/SidebarSubgroup.astro +136 -0
  25. package/template/src/components/TableOfContents.astro +480 -0
  26. package/template/src/components/ThemeSwitcher.astro +84 -0
  27. package/template/src/components/endpoint/PlaygroundBar.astro +68 -0
  28. package/template/src/components/endpoint/PlaygroundButton.astro +44 -0
  29. package/template/src/components/endpoint/PlaygroundField.astro +54 -0
  30. package/template/src/components/endpoint/PlaygroundForm.astro +203 -0
  31. package/template/src/components/endpoint/RequestSnippets.astro +308 -0
  32. package/template/src/components/endpoint/ResponseDisplay.astro +177 -0
  33. package/template/src/components/endpoint/ResponseFields.astro +224 -0
  34. package/template/src/components/endpoint/ResponseSnippets.astro +247 -0
  35. package/template/src/components/sidebar/SidebarEndpointLink.astro +51 -0
  36. package/template/src/components/sidebar/SidebarOpenApi.astro +207 -0
  37. package/template/src/components/ui/Field.astro +69 -0
  38. package/template/src/components/ui/Tag.astro +5 -0
  39. package/template/src/components/ui/demo/CodeDemo.astro +15 -0
  40. package/template/src/components/ui/demo/Demo.astro +3 -0
  41. package/template/src/components/ui/demo/UiDisplay.astro +13 -0
  42. package/template/src/components/user/Accordian.astro +69 -0
  43. package/template/src/components/user/AccordianGroup.astro +13 -0
  44. package/template/src/components/user/Callout.astro +101 -0
  45. package/template/src/components/user/Step.astro +51 -0
  46. package/template/src/components/user/Steps.astro +9 -0
  47. package/template/src/components/user/Tab.astro +25 -0
  48. package/template/src/components/user/Tabs.astro +122 -0
  49. package/template/src/content.config.ts +11 -0
  50. package/template/src/entrypoint.ts +9 -0
  51. package/template/src/layouts/Layout.astro +92 -0
  52. package/template/src/lib/component-error.ts +163 -0
  53. package/template/src/lib/frontmatter-schema.ts +9 -0
  54. package/template/src/lib/oas.ts +24 -0
  55. package/template/src/lib/pagefind.ts +88 -0
  56. package/template/src/lib/routes.ts +316 -0
  57. package/template/src/lib/utils.ts +59 -0
  58. package/template/src/lib/validation.ts +1097 -0
  59. package/template/src/pages/[...slug].astro +77 -0
  60. package/template/src/styles/global.css +209 -0
  61. package/template/tsconfig.json +5 -0
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "builder2",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "scripts": {
6
+ "dev": "astro dev",
7
+ "start": "tsx runner.ts",
8
+ "prebuild": "rm -rf public/pagefind",
9
+ "build": "astro build && pagefind --site dist",
10
+ "preview": "astro preview",
11
+ "astro": "astro",
12
+ "search:index": "astro build && pagefind --site dist && cp -r dist/pagefind public/"
13
+ },
14
+ "dependencies": {
15
+ "@alpinejs/collapse": "^3.15.2",
16
+ "@alpinejs/focus": "^3.15.3",
17
+ "@alpinejs/persist": "^3.15.2",
18
+ "@astrojs/alpinejs": "^0.4.9",
19
+ "@astrojs/mdx": "^4.3.12",
20
+ "@aws-sdk/client-s3": "^3.964.0",
21
+ "@expressive-code/plugin-collapsible-sections": "^0.41.4",
22
+ "@expressive-code/plugin-line-numbers": "^0.41.4",
23
+ "@iconify-json/lucide": "^1.2.79",
24
+ "@readme/oas-to-snippet": "^29.3.0",
25
+ "@stoplight/spectral-core": "^1.20.0",
26
+ "@stoplight/spectral-rulesets": "^1.22.0",
27
+ "@tailwindcss/typography": "^0.5.19",
28
+ "@tailwindcss/vite": "^4.1.17",
29
+ "@xt0rted/expressive-code-file-icons": "^1.0.0",
30
+ "alpinejs": "^3.15.2",
31
+ "astro": "^5.16.4",
32
+ "astro-expressive-code": "^0.41.4",
33
+ "astro-icon": "^1.1.5",
34
+ "fs-extra": "^11.3.3",
35
+ "mime-types": "^3.0.2",
36
+ "oas": "^28.7.0",
37
+ "openapi-sampler": "^1.6.2",
38
+ "prismjs": "^1.30.0",
39
+ "simple-git": "^3.30.0",
40
+ "tailwindcss": "^4.1.17",
41
+ "yaml": "^2.8.2",
42
+ "zod": "^3.25.76"
43
+ },
44
+ "devDependencies": {
45
+ "@types/fs-extra": "^11.0.4",
46
+ "@types/mime-types": "^3.0.1",
47
+ "@types/prismjs": "^1.26.5",
48
+ "pagefind": "^1.4.0",
49
+ "tsx": "^4.21.0"
50
+ }
51
+ }
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
2
+ <path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
3
+ <style>
4
+ path { fill: #000; }
5
+ @media (prefers-color-scheme: dark) {
6
+ path { fill: #FFF; }
7
+ }
8
+ </style>
9
+ </svg>
@@ -0,0 +1,33 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ x="0px"
4
+ y="0px"
5
+ width="18px"
6
+ height="18px"
7
+ viewBox="0 0 18 18"
8
+ >
9
+ <path
10
+ d="M9.305 1.848L14.555 3.528C14.969 3.661 15.25 4.046 15.25 4.48V11C15.25 14.03 10.566 15.748 9.308 16.155C9.105 16.221 8.895 16.221 8.692 16.155C7.434 15.748 2.75 14.03 2.75 11V4.48C2.75 4.045 3.031 3.66 3.445 3.528L8.695 1.848C8.893 1.785 9.106 1.785 9.305 1.848Z"
11
+ fill="#16a34a"
12
+ fill-opacity="0.7"
13
+ data-color="color-2"
14
+ data-stroke="none"
15
+ ></path>
16
+ <path
17
+ d="M9.305 1.848L14.555 3.528C14.969 3.661 15.25 4.046 15.25 4.48V11C15.25 14.03 10.566 15.748 9.308 16.155C9.105 16.221 8.895 16.221 8.692 16.155C7.434 15.748 2.75 14.03 2.75 11V4.48C2.75 4.045 3.031 3.66 3.445 3.528L8.695 1.848C8.893 1.785 9.106 1.785 9.305 1.848Z"
18
+ stroke="#16a34a"
19
+ stroke-width="1.5"
20
+ stroke-linecap="round"
21
+ stroke-linejoin="round"
22
+ fill="none"
23
+ ></path>
24
+ <path
25
+ d="M6.49701 9.75L8.10601 11.25L11.503 6.75"
26
+ stroke="white"
27
+ opacity="0.9"
28
+ stroke-width="1.5"
29
+ stroke-linecap="round"
30
+ stroke-linejoin="round"
31
+ fill="none"
32
+ ></path>
33
+ </svg>
@@ -0,0 +1,37 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ width="18"
4
+ height="18"
5
+ viewBox="0 0 18 18"
6
+ >
7
+ <path
8
+ opacity="0.8"
9
+ d="M5.63604 1.5H12.364L16.5 5.63604V12.364L12.364 16.5H5.63604L1.5 12.364V5.63604L5.63604 1.5Z"
10
+ fill="#dc2626"
11
+ ></path>
12
+ <path
13
+ d="M5.63604 1.5H12.364L16.5 5.63604V12.364L12.364 16.5H5.63604L1.5 12.364V5.63604L5.63604 1.5Z"
14
+ stroke="#dc2626"
15
+ stroke-width="1.5"
16
+ stroke-linecap="round"
17
+ stroke-linejoin="round"
18
+ fill="none"
19
+ ></path>
20
+ <g transform="translate(0 -0.5)">
21
+ <path
22
+ d="M9 6.75V9.75"
23
+ stroke="white"
24
+ opacity="0.9"
25
+ stroke-width="1.8"
26
+ stroke-linecap="round"
27
+ stroke-linejoin="round"
28
+ fill="none"
29
+ ></path>
30
+ <path
31
+ d="M9 13.5C8.448 13.5 8 13.05 8 12.5C8 11.95 8.448 11.5 9 11.5C9.552 11.5 10 11.9501 10 12.5C10 13.0499 9.552 13.5 9 13.5Z"
32
+ fill="white"
33
+ opacity="0.9"
34
+ data-stroke="none"
35
+ ></path>
36
+ </g>
37
+ </svg>
@@ -0,0 +1,36 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ width="18"
4
+ height="18"
5
+ viewBox="0 0 18 18"
6
+ >
7
+ <circle opacity="0.6" cx="9" cy="9" r="7.5" fill="#0284c7"></circle>
8
+ <circle
9
+ cx="9"
10
+ cy="9"
11
+ r="7.5"
12
+ stroke="#0284c7"
13
+ stroke-width="1.5"
14
+ stroke-linecap="round"
15
+ stroke-linejoin="round"
16
+ fill="none"
17
+ ></circle>
18
+ <path
19
+ d="M9 12V9"
20
+ stroke="white"
21
+ opacity="0.9"
22
+ stroke-width="1.9"
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ fill="none"
26
+ ></path>
27
+ <path
28
+ d="M9 6H9.0075"
29
+ stroke="white"
30
+ opacity="0.9"
31
+ stroke-width="1.9"
32
+ stroke-linecap="round"
33
+ stroke-linejoin="round"
34
+ fill="none"
35
+ ></path>
36
+ </svg>
@@ -0,0 +1,74 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ x="0px"
4
+ y="0px"
5
+ width="18px"
6
+ height="18px"
7
+ viewBox="0 0 18 18"
8
+ >
9
+ <path
10
+ fill-rule="evenodd"
11
+ clip-rule="evenodd"
12
+ d="M7.97299 4.358C11.045 3.714 13.75 6.041 13.75 9C13.75 10.867 12.6695 12.475 11.1028 13.25H6.89719C5.11109 12.367 3.95699 10.399 4.31499 8.202C4.62299 6.315 6.10099 4.75 7.97299 4.358Z"
13
+ fill="#eab308"
14
+ opacity="0.7"
15
+ data-color="color-2"
16
+ data-stroke="none"
17
+ ></path>
18
+ <path
19
+ d="M9 0.75V1.75"
20
+ stroke="#eab308"
21
+ stroke-width="1.5"
22
+ stroke-linecap="round"
23
+ stroke-linejoin="round"
24
+ fill="none"
25
+ ></path>
26
+ <path
27
+ d="M14.834 3.16599L14.127 3.87299"
28
+ stroke="#eab308"
29
+ stroke-width="1.5"
30
+ stroke-linecap="round"
31
+ stroke-linejoin="round"
32
+ fill="none"
33
+ ></path>
34
+ <path
35
+ d="M17.25 9H16.25"
36
+ stroke="#eab308"
37
+ stroke-width="1.5"
38
+ stroke-linecap="round"
39
+ stroke-linejoin="round"
40
+ fill="none"
41
+ ></path>
42
+ <path
43
+ d="M3.16602 3.16599L3.87302 3.87299"
44
+ stroke="#eab308"
45
+ stroke-width="1.5"
46
+ stroke-linecap="round"
47
+ stroke-linejoin="round"
48
+ fill="none"
49
+ ></path>
50
+ <path
51
+ d="M0.75 9H1.75"
52
+ stroke="#eab308"
53
+ stroke-width="1.5"
54
+ stroke-linecap="round"
55
+ stroke-linejoin="round"
56
+ fill="none"
57
+ ></path>
58
+ <path
59
+ d="M13.75 8.99999C13.75 6.04069 11.0445 3.71348 7.97199 4.35818C6.09979 4.75108 4.62099 6.31669 4.31449 8.20489C3.93509 10.5427 5.26679 12.6193 7.24999 13.407V15.25C7.24999 16.0784 7.92159 16.75 8.74999 16.75H9.24999C10.0784 16.75 10.75 16.0784 10.75 15.25V13.407C12.505 12.71 13.75 11.004 13.75 8.99999Z"
60
+ stroke="#eab308"
61
+ stroke-width="1.5"
62
+ stroke-linecap="round"
63
+ stroke-linejoin="round"
64
+ fill="none"
65
+ ></path>
66
+ <path
67
+ d="M6.89697 13.25H11.103"
68
+ stroke="#eab308"
69
+ stroke-width="1.5"
70
+ stroke-linecap="round"
71
+ stroke-linejoin="round"
72
+ fill="none"
73
+ ></path>
74
+ </svg>
@@ -0,0 +1,37 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ x="0px"
4
+ y="0px"
5
+ width="18px"
6
+ height="18px"
7
+ viewBox="0 0 18 18"
8
+ >
9
+ <path
10
+ opacity="0.7"
11
+ d="M7.63796 3.48996L2.21295 12.89C1.60795 13.9399 2.36395 15.25 3.57495 15.25H14.425C15.636 15.25 16.392 13.9399 15.787 12.89L10.362 3.48996C9.75696 2.44996 8.24296 2.44996 7.63796 3.48996Z"
12
+ fill="#f59e0b"
13
+ data-color="color-2"
14
+ data-stroke="none"
15
+ ></path>
16
+ <path
17
+ d="M7.63796 3.48996L2.21295 12.89C1.60795 13.9399 2.36395 15.25 3.57495 15.25H14.425C15.636 15.25 16.392 13.9399 15.787 12.89L10.362 3.48996C9.75696 2.44996 8.24296 2.44996 7.63796 3.48996Z"
18
+ stroke="#f59e0b"
19
+ stroke-width="1.5"
20
+ stroke-linecap="round"
21
+ stroke-linejoin="round"
22
+ fill="none"
23
+ ></path>
24
+ <path
25
+ d="M9 6.75V9.75"
26
+ stroke="#78350f"
27
+ stroke-width="1.5"
28
+ stroke-linecap="round"
29
+ stroke-linejoin="round"
30
+ fill="none"
31
+ ></path>
32
+ <path
33
+ d="M9 13.5C8.448 13.5 8 13.05 8 12.5C8 11.95 8.448 11.5 9 11.5C9.552 11.5 10 11.9501 10 12.5C10 13.0499 9.552 13.5 9 13.5Z"
34
+ fill="#78350f"
35
+ data-stroke="none"
36
+ ></path>
37
+ </svg>
@@ -0,0 +1,176 @@
1
+ ---
2
+ import { Icon } from "astro-icon/components";
3
+ import { getConfig } from "../lib/validation";
4
+ import Search from "./Search.astro";
5
+
6
+ const config = await getConfig();
7
+
8
+ function getLogoUrl(logoPath: string | undefined): string | null {
9
+ if (!logoPath) return null;
10
+
11
+ // Normalize path: remove leading slash if present
12
+ const normalizedPath = logoPath.startsWith("/")
13
+ ? logoPath.slice(1)
14
+ : logoPath;
15
+
16
+ // Return public URL - Vite plugin ensures file exists in public
17
+ return `/${normalizedPath}`;
18
+ }
19
+
20
+ // Load light and dark logos
21
+ const lightLogoUrl = getLogoUrl(config.logo?.light);
22
+ const darkLogoUrl = getLogoUrl(config.logo?.dark);
23
+
24
+ // Get the href for the logo link (defaults to "/")
25
+ const logoHref = config.logo?.href || "/";
26
+ ---
27
+
28
+ <header
29
+ class:list={[
30
+ "fixed z-30 inset-x-1 top-0 h-16 mt-1 border-x border-t border-border rounded-t-xl overflow-hidden",
31
+ config.navbar?.blur
32
+ ? "bg-background/80 backdrop-blur-[18px] backdrop-saturate-200"
33
+ : "bg-background",
34
+ ]}
35
+ data-pagefind-ignore
36
+ >
37
+ <div class="flex h-full border-b border-b-border-light">
38
+ <div class="lg:w-[283px] h-full">
39
+ <div class="flex gap-3 lg:block h-full lg:border-r border-border-light">
40
+ <button
41
+ x-on:click="open = ! open"
42
+ class="lg:hidden cursor-pointer pl-4 sm:pl-6 pr-2"
43
+ >
44
+ <div
45
+ class="flex flex-col items-center justify-center gap-1 h-full transition"
46
+ x-bind:class="open ? 'rotate-90': ''"
47
+ >
48
+ <div
49
+ class="w-[14px] h-0.5 bg-neutral-900 rounded-full origin-[20%_50%] transition"
50
+ x-bind:class="open ? 'rotate-45': ''"
51
+ >
52
+ </div>
53
+ <div
54
+ class="w-[14px] h-0.5 bg-neutral-900 rounded-full origin-[20%_50%] transition"
55
+ x-bind:class="open ? '-rotate-45': ''"
56
+ >
57
+ </div>
58
+ </div>
59
+ </button>
60
+ <a
61
+ href={logoHref}
62
+ class="h-full flex items-center justify-center gap-2 lg:gap-3 text-xl font-bold text-neutral-800 dark:text-neutral-100"
63
+ >
64
+ {
65
+ lightLogoUrl || darkLogoUrl ? (
66
+ <>
67
+ {/* Light mode: show light logo if available, otherwise show title */}
68
+ {lightLogoUrl ? (
69
+ <img
70
+ src={lightLogoUrl}
71
+ class="max-h-[40px] w-auto max-w-[200px] object-contain dark:hidden"
72
+ alt="Logo"
73
+ />
74
+ ) : (
75
+ <span class="dark:hidden">{config.title}</span>
76
+ )}
77
+
78
+ {/* Dark mode: show dark logo if available, otherwise show title */}
79
+ {darkLogoUrl ? (
80
+ <img
81
+ src={darkLogoUrl}
82
+ class="max-h-[40px] w-auto max-w-[200px] object-contain hidden dark:block"
83
+ alt="Logo"
84
+ />
85
+ ) : (
86
+ <span class="hidden dark:block">{config.title}</span>
87
+ )}
88
+ </>
89
+ ) : (
90
+ config.title
91
+ )
92
+ }
93
+ <span
94
+ class="text-[10px] text-neutral-500 font-semibold bg-neutral-100 dark:bg-neutral-800 px-2 py-px mt-0.5 rounded-full border border-neutral-200 dark:border-neutral-700/70 shadow-xs"
95
+ >Docs</span
96
+ >
97
+ </a>
98
+ </div>
99
+ </div>
100
+ <div class="flex-1 flex">
101
+ <div
102
+ class="min-w-0 w-full flex items-center justify-end md:justify-between gap-3 px-4 sm:px-6"
103
+ >
104
+ <Search />
105
+ {
106
+ config.navbar && (
107
+ <nav class="hidden xs:flex items-center gap-3">
108
+ {config.navbar.links && (
109
+ <div
110
+ class:list={[
111
+ "space-x-1",
112
+ config.navbar.primary || config.navbar.secondary
113
+ ? "pr-2 hidden xl:flex"
114
+ : "hidden lg:flex",
115
+ ]}
116
+ >
117
+ {config.navbar.links.map((l, i) => (
118
+ <a
119
+ class="flex items-center gap-1 text-sm font-medium text-neutral-600/80 hover:text-neutral-600 duration-200 px-1.5 py-[5px] whitespace-nowrap"
120
+ href={l.href}
121
+ >
122
+ {l.icon && (
123
+ <Icon
124
+ class="ml-0.5"
125
+ name={`lucide:${l.icon}`}
126
+ width="16"
127
+ height="16"
128
+ />
129
+ )}
130
+ {l.text}
131
+ </a>
132
+ ))}
133
+ </div>
134
+ )}
135
+ {config.navbar.secondary && (
136
+ <a
137
+ class:list={[
138
+ "items-center gap-1.5 px-3 py-[5px] text-sm font-[450] bg-white text-neutral-600 hover:text-neutral-700 rounded-md border border-neutral-200 shadow-xs hover:shadow-sm transition-all whitespace-nowrap",
139
+ config.navbar.primary ? "hidden lg:flex" : "flex",
140
+ ]}
141
+ href={config.navbar.secondary.href}
142
+ >
143
+ {config.navbar.secondary.icon && (
144
+ <Icon
145
+ name={`lucide:${config.navbar.secondary.icon}`}
146
+ width="16"
147
+ height="16"
148
+ />
149
+ )}
150
+ {config.navbar.secondary.text}
151
+ </a>
152
+ )}
153
+ {config.navbar.primary && (
154
+ <a
155
+ class:list={[
156
+ "flex items-center gap-1.5 px-5 py-[5px] text-sm font-medium rounded-md bg-neutral-900 text-white/95 hover:text-white duration-200 shadow-[inset_0_1px_0_rgb(255,255,255,0.3),0_0_0_1px_var(--color-neutral-800)] transition-all whitespace-nowrap",
157
+ ]}
158
+ href={config.navbar.primary.href}
159
+ >
160
+ {config.navbar.primary.icon && (
161
+ <Icon
162
+ name={`lucide:${config.navbar.primary.icon}`}
163
+ width="16"
164
+ height="16"
165
+ />
166
+ )}
167
+ {config.navbar.primary.text}
168
+ </a>
169
+ )}
170
+ </nav>
171
+ )
172
+ }
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </header>
@@ -0,0 +1,49 @@
1
+ ---
2
+ import Layout from "../layouts/Layout.astro";
3
+ import { render } from "astro:content";
4
+ import Callout from "./user/Callout.astro";
5
+ import Tabs from "./user/Tabs.astro";
6
+ import Tab from "./user/Tab.astro";
7
+ import Steps from "./user/Steps.astro";
8
+ import Step from "./user/Step.astro";
9
+ import Accordian from "./user/Accordian.astro";
10
+ import AccordianGroup from "./user/AccordianGroup.astro";
11
+ import TableOfContents from "./TableOfContents.astro";
12
+ import { deriveTitleFromEntryId } from "../lib/utils";
13
+ interface Props {
14
+ entry: any;
15
+ }
16
+
17
+ const { entry } = Astro.props;
18
+
19
+ const components = {
20
+ Accordian,
21
+ AccordianGroup,
22
+ Callout,
23
+ Tabs,
24
+ Tab,
25
+ Steps,
26
+ Step,
27
+ };
28
+
29
+ const { Content, headings } = await render(entry);
30
+ const title = entry.data.title || deriveTitleFromEntryId(entry.filePath);
31
+
32
+ const tocHeadings = headings.filter(({ depth }) => depth === 2 || depth === 3);
33
+ ---
34
+
35
+ <Layout>
36
+ <article>
37
+ <header class="mb-6">
38
+ <h1 class="text-3xl font-semibold">{title}</h1>
39
+ </header>
40
+ <div class="flex justify-between w-full">
41
+ <div class="prose-rules">
42
+ <Content components={components} />
43
+ </div>
44
+ <aside class="hidden xl:block w-56 shrink-0">
45
+ <TableOfContents headings={tocHeadings} />
46
+ </aside>
47
+ </div>
48
+ </article>
49
+ </Layout>