import { marked } from "marked"
import { readFileSync } from "node:fs"
import { join, normalize } from "node:path"
const SITE_URL = "https://riricdev.tail5ea5cd.ts.net"
// Layout de la page de documentation (navigable, sections).
function layout(title: string, description: string, body: string, sidebar: string): string {
return `
${title} ยท Zektyc
${body}
`
}
const DOCS_DIR = normalize(join(import.meta.dir))
export function docsPage(service: string): string | null {
if (service !== "maxspeed") return null
const md = readFileSync(join(DOCS_DIR, "maxspeed-doc.md"), "utf8")
const body = marked.parse(md) as string
return layout(
"API Maxspeed",
"API publique des limitations de vitesse (maxspeed) en Europe, depuis OpenStreetMap. Endpoints point & route, exemples, performance.",
body,
"",
)
}