radiant-docs 0.1.58 → 0.1.60
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.
- package/package.json +1 -1
- package/template/astro.config.mjs +24 -2
- package/template/package-lock.json +216 -513
- package/template/package.json +13 -3
- package/template/scripts/generate-og-images.mjs +338 -6
- package/template/scripts/generate-og-metadata.mjs +29 -0
- package/template/src/components/Footer.astro +1 -1
- package/template/src/components/Header.astro +6 -13
- package/template/src/components/MdxPage.astro +3 -1
- package/template/src/components/OpenApiPage.astro +26 -832
- package/template/src/components/Sidebar.astro +1 -1
- package/template/src/components/SidebarGroup.astro +1 -1
- package/template/src/components/ThemeSwitcher.astro +5 -15
- package/template/src/components/chat/AssistantEmbedPanel.tsx +1 -1
- package/template/src/components/chat/AssistantEmbedPanelPage.astro +15 -2
- package/template/src/components/endpoint/PlaygroundButton.astro +1 -1
- package/template/src/components/endpoint/PlaygroundField.astro +1 -1
- package/template/src/components/endpoint/PlaygroundForm.astro +9 -5
- package/template/src/components/endpoint/ResponseFields.astro +3 -3
- package/template/src/components/ui/Field.astro +4 -4
- package/template/src/components/user/Callout.astro +2 -2
- package/template/src/components/user/Card.astro +2 -2
- package/template/src/components/user/Step.astro +3 -1
- package/template/src/layouts/Layout.astro +21 -46
- package/template/src/lib/ai-artifacts.ts +792 -0
- package/template/src/lib/font-css.ts +376 -0
- package/template/src/lib/mdx/remark-resolve-internal-links.ts +22 -8
- package/template/src/lib/oas.ts +5 -1
- package/template/src/lib/openapi/operation-doc.ts +1150 -0
- package/template/src/lib/page-description.ts +20 -0
- package/template/src/lib/routes.ts +73 -18
- package/template/src/pages/-/fonts/[...font].ts +50 -0
- package/template/src/pages/404.astro +2 -2
- package/template/src/pages/[...slug]/index.md.ts +35 -0
- package/template/src/pages/[...spec].json.ts +33 -0
- package/template/src/pages/[...spec].yaml.ts +33 -0
- package/template/src/pages/[...spec].yml.ts +33 -0
- package/template/src/pages/index.md.ts +17 -0
- package/template/src/pages/llms-full.txt.ts +11 -0
- package/template/src/pages/llms.txt.ts +11 -0
- package/template/src/styles/global.css +32 -7
- package/template/src/assets/fonts/geist-mono/cyrillic.woff2 +0 -0
- package/template/src/assets/fonts/geist-mono/latin-ext.woff2 +0 -0
- package/template/src/assets/fonts/geist-mono/latin.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/canadian-aboriginal.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/cherokee.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/latin-ext.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/latin.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/math.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/nushu.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/symbols.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/syriac.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/tifinagh.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/vietnamese.woff2 +0 -0
- package/template/src/styles/geist-mono.css +0 -33
- package/template/src/styles/google-sans-flex.css +0 -143
- package/template/src/styles/vaul.css +0 -255
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function normalizePageDescription(value: unknown): string | undefined {
|
|
2
|
+
if (typeof value !== "string") return undefined;
|
|
3
|
+
|
|
4
|
+
const normalized = value.replace(/\s+/g, " ").trim();
|
|
5
|
+
return normalized || undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function resolvePageDescription(args: {
|
|
9
|
+
pageTitle?: string;
|
|
10
|
+
pageDescription?: unknown;
|
|
11
|
+
docsTitle: string;
|
|
12
|
+
}): string {
|
|
13
|
+
const explicitDescription = normalizePageDescription(args.pageDescription);
|
|
14
|
+
if (explicitDescription) return explicitDescription;
|
|
15
|
+
|
|
16
|
+
const pageTitle = args.pageTitle?.trim();
|
|
17
|
+
return pageTitle
|
|
18
|
+
? `Learn about ${pageTitle} in the ${args.docsTitle} documentation.`
|
|
19
|
+
: `${args.docsTitle} documentation.`;
|
|
20
|
+
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
type NavOpenApiPage,
|
|
6
6
|
type NavMenuItem,
|
|
7
7
|
type NavOpenApi,
|
|
8
|
-
type
|
|
8
|
+
type DocsConfig,
|
|
9
9
|
loadOpenApiSpec,
|
|
10
10
|
} from "./validation";
|
|
11
11
|
import {
|
|
@@ -50,12 +50,43 @@ export interface OpenApiRoute extends BaseRoute {
|
|
|
50
50
|
// Discriminated union
|
|
51
51
|
export type Route = MdxRoute | OpenApiRoute;
|
|
52
52
|
|
|
53
|
+
type AuxiliaryPageRef = {
|
|
54
|
+
filePath: string;
|
|
55
|
+
href: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type DocsConfigWithAuxiliaryRefs = DocsConfig & {
|
|
59
|
+
auxiliaryPageRefs?: AuxiliaryPageRef[];
|
|
60
|
+
};
|
|
61
|
+
|
|
53
62
|
function normalizeTitle(value: unknown): string | undefined {
|
|
54
63
|
if (typeof value !== "string") return undefined;
|
|
55
64
|
const trimmed = value.trim();
|
|
56
65
|
return trimmed.length ? trimmed : undefined;
|
|
57
66
|
}
|
|
58
67
|
|
|
68
|
+
function getAuxiliaryPageRefs(
|
|
69
|
+
config: DocsConfigWithAuxiliaryRefs,
|
|
70
|
+
): AuxiliaryPageRef[] {
|
|
71
|
+
return config.auxiliaryPageRefs ?? [];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function findCanonicalMdxRoute(
|
|
75
|
+
routes: Route[],
|
|
76
|
+
filePath: string,
|
|
77
|
+
): MdxRoute | undefined {
|
|
78
|
+
return (
|
|
79
|
+
routes.find(
|
|
80
|
+
(route): route is MdxRoute =>
|
|
81
|
+
route.type === "mdx" && route.filePath === filePath && !route.hidden,
|
|
82
|
+
) ??
|
|
83
|
+
routes.find(
|
|
84
|
+
(route): route is MdxRoute =>
|
|
85
|
+
route.type === "mdx" && route.filePath === filePath,
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
59
90
|
export function resolveMdxPageTitle(args: {
|
|
60
91
|
entry: any;
|
|
61
92
|
docsTitle?: unknown;
|
|
@@ -114,33 +145,36 @@ function processPageItem(
|
|
|
114
145
|
};
|
|
115
146
|
}
|
|
116
147
|
|
|
117
|
-
function
|
|
148
|
+
function processAuxiliaryPageRefRoute(
|
|
149
|
+
ref: AuxiliaryPageRef,
|
|
150
|
+
docs: any[],
|
|
151
|
+
): MdxRoute {
|
|
118
152
|
const entry = docs.find((doc: any) => {
|
|
119
153
|
const docPath = doc.id.replace(/\.mdx$/, "");
|
|
120
|
-
return docPath ===
|
|
154
|
+
return docPath === ref.filePath;
|
|
121
155
|
});
|
|
122
156
|
|
|
123
157
|
if (!entry) {
|
|
124
158
|
throw new Error(
|
|
125
|
-
`Could not find content collection entry for path: ${
|
|
159
|
+
`Could not find content collection entry for path: ${ref.filePath}`,
|
|
126
160
|
);
|
|
127
161
|
}
|
|
128
162
|
|
|
129
|
-
const slug =
|
|
163
|
+
const slug = ref.href.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
130
164
|
|
|
131
165
|
return {
|
|
132
166
|
type: "mdx",
|
|
133
167
|
slug,
|
|
134
168
|
preferredSlug: slug,
|
|
135
169
|
fallbackSlug: buildMdxPageFallbackSlug({
|
|
136
|
-
filePath:
|
|
170
|
+
filePath: ref.filePath,
|
|
137
171
|
groupSlug: "",
|
|
138
172
|
}),
|
|
139
|
-
routeIdentity: `mdx:${
|
|
140
|
-
filePath:
|
|
173
|
+
routeIdentity: `mdx:${ref.filePath}`,
|
|
174
|
+
filePath: ref.filePath,
|
|
141
175
|
title: resolveMdxPageTitle({
|
|
142
176
|
entry,
|
|
143
|
-
filePath:
|
|
177
|
+
filePath: ref.filePath,
|
|
144
178
|
}),
|
|
145
179
|
hidden: true,
|
|
146
180
|
};
|
|
@@ -476,8 +510,16 @@ export async function getAllRoutes(): Promise<Route[]> {
|
|
|
476
510
|
allRoutes = allRoutes.concat(openApiRoutes);
|
|
477
511
|
}
|
|
478
512
|
|
|
479
|
-
for (const
|
|
480
|
-
const
|
|
513
|
+
for (const auxiliaryPageRef of getAuxiliaryPageRefs(config)) {
|
|
514
|
+
const existingFileRoute = allRoutes.find(
|
|
515
|
+
(route) =>
|
|
516
|
+
route.type === "mdx" && route.filePath === auxiliaryPageRef.filePath,
|
|
517
|
+
);
|
|
518
|
+
if (existingFileRoute) {
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const hiddenRoute = processAuxiliaryPageRefRoute(auxiliaryPageRef, docs);
|
|
481
523
|
const existingRoute = allRoutes.find(
|
|
482
524
|
(route) => route.slug === hiddenRoute.slug,
|
|
483
525
|
);
|
|
@@ -523,23 +565,36 @@ export async function getMdxRouteHref(args: {
|
|
|
523
565
|
return prependBasePath(`/${route?.slug ?? preferredSlug}`);
|
|
524
566
|
}
|
|
525
567
|
|
|
568
|
+
async function getCanonicalMdxRouteHref(filePath: string): Promise<string> {
|
|
569
|
+
const config = await getConfig();
|
|
570
|
+
if (config.home && filePath === config.home) {
|
|
571
|
+
return prependBasePath("/");
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
const routes = await getAllRoutes();
|
|
575
|
+
const route = findCanonicalMdxRoute(routes, filePath);
|
|
576
|
+
|
|
577
|
+
if (route) {
|
|
578
|
+
return prependBasePath(`/${route.slug}`);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
return getMdxRouteHref({ filePath });
|
|
582
|
+
}
|
|
583
|
+
|
|
526
584
|
export async function resolveConfiguredHref(
|
|
527
585
|
href: string,
|
|
528
|
-
|
|
586
|
+
config: DocsConfigWithAuxiliaryRefs,
|
|
529
587
|
): Promise<string> {
|
|
530
588
|
const normalizedHref = href.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
531
|
-
const
|
|
589
|
+
const auxiliaryPageRef = getAuxiliaryPageRefs(config).find(
|
|
532
590
|
(route) => route.href.replace(/^\/+/, "").replace(/\/+$/, "") === normalizedHref,
|
|
533
591
|
);
|
|
534
592
|
|
|
535
|
-
if (!
|
|
593
|
+
if (!auxiliaryPageRef) {
|
|
536
594
|
return withBasePath(href);
|
|
537
595
|
}
|
|
538
596
|
|
|
539
|
-
return
|
|
540
|
-
filePath: hiddenPageRoute.filePath,
|
|
541
|
-
preferredSlug: hiddenPageRoute.href,
|
|
542
|
-
});
|
|
597
|
+
return getCanonicalMdxRouteHref(auxiliaryPageRef.filePath);
|
|
543
598
|
}
|
|
544
599
|
|
|
545
600
|
export async function getOpenApiEndpointRouteHref(args: {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import type { APIRoute } from "astro";
|
|
3
|
+
import {
|
|
4
|
+
type DocsFontFile,
|
|
5
|
+
getSelectedDocsFontFiles,
|
|
6
|
+
} from "../../../lib/font-css";
|
|
7
|
+
import { getConfig } from "../../../lib/validation";
|
|
8
|
+
|
|
9
|
+
async function getSelectedFontFileMap(): Promise<Map<string, DocsFontFile>> {
|
|
10
|
+
const config = await getConfig();
|
|
11
|
+
return new Map(
|
|
12
|
+
getSelectedDocsFontFiles(config.theme).map((fontFile) => [
|
|
13
|
+
fontFile.routePath,
|
|
14
|
+
fontFile,
|
|
15
|
+
]),
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function getStaticPaths() {
|
|
20
|
+
const selectedFontFiles = await getSelectedFontFileMap();
|
|
21
|
+
|
|
22
|
+
return Array.from(selectedFontFiles.values(), (fontFile) => ({
|
|
23
|
+
params: {
|
|
24
|
+
font: fontFile.routePath,
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
fontFile,
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const GET: APIRoute = async ({ params, props }) => {
|
|
33
|
+
const selectedFontFiles = await getSelectedFontFileMap();
|
|
34
|
+
const fontFile =
|
|
35
|
+
(props.fontFile as DocsFontFile | undefined) ??
|
|
36
|
+
selectedFontFiles.get(params.font ?? "");
|
|
37
|
+
|
|
38
|
+
if (!fontFile || !selectedFontFiles.has(fontFile.routePath)) {
|
|
39
|
+
return new Response("Font not found.", { status: 404 });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const fontBytes = await fs.readFile(fontFile.sourcePath);
|
|
43
|
+
|
|
44
|
+
return new Response(fontBytes, {
|
|
45
|
+
headers: {
|
|
46
|
+
"Cache-Control": "public, max-age=31536000, immutable",
|
|
47
|
+
"Content-Type": fontFile.contentType,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
};
|
|
@@ -17,7 +17,7 @@ import Layout from "../layouts/Layout.astro";
|
|
|
17
17
|
404
|
|
18
18
|
</p>
|
|
19
19
|
<h1
|
|
20
|
-
class="text-3xl font-semibold tracking-tight text-neutral-900 dark:text-neutral-50"
|
|
20
|
+
class="rd-document-heading text-3xl font-semibold tracking-tight text-neutral-900 dark:text-neutral-50"
|
|
21
21
|
>
|
|
22
22
|
Page not found
|
|
23
23
|
</h1>
|
|
@@ -35,7 +35,7 @@ import Layout from "../layouts/Layout.astro";
|
|
|
35
35
|
</button>
|
|
36
36
|
<a
|
|
37
37
|
href={withBasePath("/")}
|
|
38
|
-
class="inline-flex items-center justify-center gap-2 rounded-lg [corner-shape:superellipse(1.2)] border border-border bg-linear-to-b from-neutral-900/85 to-neutral-900 px-4 py-2 text-sm font-
|
|
38
|
+
class="inline-flex items-center justify-center gap-2 rounded-lg [corner-shape:superellipse(1.2)] border border-border bg-linear-to-b from-neutral-900/85 to-neutral-900 px-4 py-2 text-sm font-normal text-white shadow-sm transition hover:opacity-95 dark:from-neutral-100 dark:to-neutral-200 dark:font-medium dark:text-neutral-950"
|
|
39
39
|
>
|
|
40
40
|
<Icon name="lucide:house" class="size-4" />
|
|
41
41
|
Take me home
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
import {
|
|
3
|
+
getMarkdownRoutePages,
|
|
4
|
+
MARKDOWN_CONTENT_TYPE,
|
|
5
|
+
type AiMarkdownPage,
|
|
6
|
+
} from "../../lib/ai-artifacts";
|
|
7
|
+
|
|
8
|
+
export async function getStaticPaths() {
|
|
9
|
+
const pages = await getMarkdownRoutePages();
|
|
10
|
+
|
|
11
|
+
return pages
|
|
12
|
+
.filter((page) => page.routeSlug)
|
|
13
|
+
.map((page) => ({
|
|
14
|
+
params: {
|
|
15
|
+
slug: page.routeSlug,
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
page,
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const GET: APIRoute = async ({ props }) => {
|
|
24
|
+
const page = props.page as AiMarkdownPage | undefined;
|
|
25
|
+
|
|
26
|
+
if (!page) {
|
|
27
|
+
return new Response("Markdown page not found.", { status: 404 });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return new Response(page.source, {
|
|
31
|
+
headers: {
|
|
32
|
+
"Content-Type": MARKDOWN_CONTENT_TYPE,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
import {
|
|
3
|
+
getOpenApiSpecArtifactsByExtension,
|
|
4
|
+
readOpenApiSpecArtifact,
|
|
5
|
+
type OpenApiSpecArtifact,
|
|
6
|
+
} from "../lib/ai-artifacts";
|
|
7
|
+
|
|
8
|
+
export async function getStaticPaths() {
|
|
9
|
+
const specs = await getOpenApiSpecArtifactsByExtension(".json");
|
|
10
|
+
|
|
11
|
+
return specs.map((spec) => ({
|
|
12
|
+
params: {
|
|
13
|
+
spec: spec.routeParam,
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
spec,
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const GET: APIRoute = async ({ props }) => {
|
|
22
|
+
const spec = props.spec as OpenApiSpecArtifact | undefined;
|
|
23
|
+
|
|
24
|
+
if (!spec) {
|
|
25
|
+
return new Response("OpenAPI spec not found.", { status: 404 });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new Response(await readOpenApiSpecArtifact(spec), {
|
|
29
|
+
headers: {
|
|
30
|
+
"Content-Type": spec.contentType ?? "application/json; charset=utf-8",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
import {
|
|
3
|
+
getOpenApiSpecArtifactsByExtension,
|
|
4
|
+
readOpenApiSpecArtifact,
|
|
5
|
+
type OpenApiSpecArtifact,
|
|
6
|
+
} from "../lib/ai-artifacts";
|
|
7
|
+
|
|
8
|
+
export async function getStaticPaths() {
|
|
9
|
+
const specs = await getOpenApiSpecArtifactsByExtension(".yaml");
|
|
10
|
+
|
|
11
|
+
return specs.map((spec) => ({
|
|
12
|
+
params: {
|
|
13
|
+
spec: spec.routeParam,
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
spec,
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const GET: APIRoute = async ({ props }) => {
|
|
22
|
+
const spec = props.spec as OpenApiSpecArtifact | undefined;
|
|
23
|
+
|
|
24
|
+
if (!spec) {
|
|
25
|
+
return new Response("OpenAPI spec not found.", { status: 404 });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new Response(await readOpenApiSpecArtifact(spec), {
|
|
29
|
+
headers: {
|
|
30
|
+
"Content-Type": spec.contentType ?? "application/yaml; charset=utf-8",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
import {
|
|
3
|
+
getOpenApiSpecArtifactsByExtension,
|
|
4
|
+
readOpenApiSpecArtifact,
|
|
5
|
+
type OpenApiSpecArtifact,
|
|
6
|
+
} from "../lib/ai-artifacts";
|
|
7
|
+
|
|
8
|
+
export async function getStaticPaths() {
|
|
9
|
+
const specs = await getOpenApiSpecArtifactsByExtension(".yml");
|
|
10
|
+
|
|
11
|
+
return specs.map((spec) => ({
|
|
12
|
+
params: {
|
|
13
|
+
spec: spec.routeParam,
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
spec,
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const GET: APIRoute = async ({ props }) => {
|
|
22
|
+
const spec = props.spec as OpenApiSpecArtifact | undefined;
|
|
23
|
+
|
|
24
|
+
if (!spec) {
|
|
25
|
+
return new Response("OpenAPI spec not found.", { status: 404 });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new Response(await readOpenApiSpecArtifact(spec), {
|
|
29
|
+
headers: {
|
|
30
|
+
"Content-Type": spec.contentType ?? "application/yaml; charset=utf-8",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getHomeMarkdownPage, MARKDOWN_CONTENT_TYPE } from "../lib/ai-artifacts";
|
|
2
|
+
|
|
3
|
+
export const prerender = true;
|
|
4
|
+
|
|
5
|
+
export async function GET(): Promise<Response> {
|
|
6
|
+
const page = await getHomeMarkdownPage();
|
|
7
|
+
|
|
8
|
+
if (!page) {
|
|
9
|
+
return new Response("Home page not found.", { status: 404 });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return new Response(page.source, {
|
|
13
|
+
headers: {
|
|
14
|
+
"Content-Type": MARKDOWN_CONTENT_TYPE,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getLlmsFullTxt, PLAIN_TEXT_CONTENT_TYPE } from "../lib/ai-artifacts";
|
|
2
|
+
|
|
3
|
+
export const prerender = true;
|
|
4
|
+
|
|
5
|
+
export async function GET(): Promise<Response> {
|
|
6
|
+
return new Response(await getLlmsFullTxt(), {
|
|
7
|
+
headers: {
|
|
8
|
+
"Content-Type": PLAIN_TEXT_CONTENT_TYPE,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getLlmsTxt, PLAIN_TEXT_CONTENT_TYPE } from "../lib/ai-artifacts";
|
|
2
|
+
|
|
3
|
+
export const prerender = true;
|
|
4
|
+
|
|
5
|
+
export async function GET(): Promise<Response> {
|
|
6
|
+
return new Response(await getLlmsTxt(), {
|
|
7
|
+
headers: {
|
|
8
|
+
"Content-Type": PLAIN_TEXT_CONTENT_TYPE,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
|
-
@import "./vaul.css";
|
|
3
2
|
@plugin "@tailwindcss/typography";
|
|
4
3
|
|
|
5
4
|
@theme {
|
|
@@ -23,10 +22,26 @@
|
|
|
23
22
|
--color-accent-foreground: var(--accent-foreground);
|
|
24
23
|
--color-destructive: var(--destructive);
|
|
25
24
|
|
|
26
|
-
--font-sans:
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
25
|
+
--font-sans: var(
|
|
26
|
+
--rd-font-text,
|
|
27
|
+
"Google Sans Variable",
|
|
28
|
+
ui-sans-serif,
|
|
29
|
+
system-ui,
|
|
30
|
+
sans-serif
|
|
31
|
+
);
|
|
32
|
+
--font-heading: var(--rd-font-heading, var(--font-sans));
|
|
33
|
+
--font-mono: var(
|
|
34
|
+
--rd-font-code,
|
|
35
|
+
"Geist Mono Variable",
|
|
36
|
+
ui-monospace,
|
|
37
|
+
SFMono-Regular,
|
|
38
|
+
Menlo,
|
|
39
|
+
Monaco,
|
|
40
|
+
Consolas,
|
|
41
|
+
"Liberation Mono",
|
|
42
|
+
"Courier New",
|
|
43
|
+
monospace
|
|
44
|
+
);
|
|
30
45
|
|
|
31
46
|
--radius-sm: calc(var(--radius) - 4px);
|
|
32
47
|
--radius-md: calc(var(--radius) - 2px);
|
|
@@ -116,7 +131,7 @@
|
|
|
116
131
|
}
|
|
117
132
|
|
|
118
133
|
body {
|
|
119
|
-
@apply bg-background text-foreground;
|
|
134
|
+
@apply bg-background font-sans text-foreground;
|
|
120
135
|
}
|
|
121
136
|
}
|
|
122
137
|
|
|
@@ -126,7 +141,7 @@
|
|
|
126
141
|
|
|
127
142
|
/* Prose styling */
|
|
128
143
|
.prose-rules {
|
|
129
|
-
@apply prose max-w-none *:my-6 *:first:mt-0 *:last:mb-0 prose-h2:mt-
|
|
144
|
+
@apply prose max-w-none *:my-6 *:first:mt-0 *:last:mb-0 prose-h2:mt-12 prose-h2:mb-2 prose-h2:scroll-mt-24 prose-h3:mt-8 prose-h3:mb-2 prose-h3:scroll-mt-20 prose-headings:font-semibold prose-p:mt-0 prose-p:mb-4 prose-ol:mt-0 prose-ol:mb-5 prose-ul:mt-0 prose-ul:mb-5 prose-a:decoration-(--color-theme) prose-a:decoration-from-font prose-blockquote:border-(--color-theme)/30 dark:prose-blockquote:border-(--color-theme)/30;
|
|
130
145
|
--tw-prose-body: var(--color-neutral-700);
|
|
131
146
|
--tw-prose-headings: var(--color-neutral-900);
|
|
132
147
|
--tw-prose-lead: var(--color-neutral-600);
|
|
@@ -169,6 +184,16 @@
|
|
|
169
184
|
--tw-prose-invert-td-borders: var(--color-neutral-700);
|
|
170
185
|
}
|
|
171
186
|
|
|
187
|
+
.rd-document-heading,
|
|
188
|
+
.prose-rules > :is(h1, h2, h3, h4, h5, h6) {
|
|
189
|
+
font-family: var(--font-heading);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.prose-rules h2 + h3 {
|
|
193
|
+
margin-block-start: 1rem;
|
|
194
|
+
margin-top: 1rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
172
197
|
.dark .prose-rules {
|
|
173
198
|
--tw-prose-body: var(--tw-prose-invert-body);
|
|
174
199
|
--tw-prose-headings: var(--tw-prose-invert-headings);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* geist-mono-cyrillic */
|
|
2
|
-
@font-face {
|
|
3
|
-
font-family: "Geist Mono";
|
|
4
|
-
font-style: normal;
|
|
5
|
-
font-weight: 100 900;
|
|
6
|
-
font-display: swap;
|
|
7
|
-
src: url("../assets/fonts/geist-mono/cyrillic.woff2") format("woff2");
|
|
8
|
-
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* geist-mono-latin-ext */
|
|
12
|
-
@font-face {
|
|
13
|
-
font-family: "Geist Mono";
|
|
14
|
-
font-style: normal;
|
|
15
|
-
font-weight: 100 900;
|
|
16
|
-
font-display: swap;
|
|
17
|
-
src: url("../assets/fonts/geist-mono/latin-ext.woff2") format("woff2");
|
|
18
|
-
unicode-range:
|
|
19
|
-
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
|
|
20
|
-
U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* geist-mono-latin */
|
|
24
|
-
@font-face {
|
|
25
|
-
font-family: "Geist Mono";
|
|
26
|
-
font-style: normal;
|
|
27
|
-
font-weight: 100 900;
|
|
28
|
-
font-display: swap;
|
|
29
|
-
src: url("../assets/fonts/geist-mono/latin.woff2") format("woff2");
|
|
30
|
-
unicode-range:
|
|
31
|
-
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
32
|
-
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
33
|
-
}
|