forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathllms-full.txt.ts
More file actions
18 lines (17 loc) · 808 Bytes
/
Copy pathllms-full.txt.ts
File metadata and controls
18 lines (17 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import type { APIRoute } from 'astro';
import { getCollection } from 'astro:content';
import { entryToMarkdown } from '../lib/doc-markdown';
export const GET: APIRoute = async () => {
const docs = (await getCollection('docs'))
.filter((e) => e.data.template !== 'splash')
.sort((a, b) => a.id.localeCompare(b.id));
const header =
'# Nulang — Full Documentation\n\n' +
'> A distributed, actor-based programming language with algebraic effects, ' +
'row-polymorphic types, and reference capabilities. Built in Rust.\n\n' +
'Source: https://nulang.org — one section per documentation page.\n\n';
const body = docs.map((e) => entryToMarkdown(e)).join('\n\n---\n\n');
return new Response(header + body, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
};