import { escapeHtml } from "../lib/html.ts";
import type { WikiIdentity } from "../lib/wiki-identity.ts";
import { type LayoutOptions, layout } from "./layout.ts";
export function notePage(
wiki: WikiIdentity,
noteTitle: string,
renderedHtml: string,
options?: LayoutOptions,
wikiLanguage?: string,
): string {
const langAttr = wikiLanguage ? ` lang="${escapeHtml(wikiLanguage)}"` : "";
const content = `
${renderedHtml}
`;
return layout(noteTitle, content, {
...options,
wikiName: wiki.name,
wikiSlug: wiki.slug,
ownerHandle: wiki.handle,
pageTitle: noteTitle,
enableSearchShortcut: true,
});
}