This repository has no description
1import { isMarkdownFile } from "./format";
2import type { MarkupContext } from "./paths";
3
4export const renderDocument = async (
5 filename: string,
6 contents: string,
7 ctx: MarkupContext
8): Promise<string | null> => {
9 if (!isMarkdownFile(filename)) return null;
10 const { SOURCE_LIMIT, renderMarkdown } = await import("./markdown");
11 if (contents.length > SOURCE_LIMIT) return null;
12 return renderMarkdown(contents, ctx);
13};