MCPcopy Create free account
hub / github.com/SpaceZephyr/myskill / buildHtmlDocument

Function buildHtmlDocument

baoyu-markdown-to-html/scripts/md/render.ts:717–743  ·  view source on GitHub ↗
(meta: HtmlDocumentMeta, css: string, html: string)

Source from the content-addressed store, hash-verified

715}
716
717function buildHtmlDocument(meta: HtmlDocumentMeta, css: string, html: string): string {
718 const lines = [
719 "<!doctype html>",
720 "<html>",
721 "<head>",
722 ' <meta charset="utf-8" />',
723 ' <meta name="viewport" content="width=device-width, initial-scale=1" />',
724 ` <title>${meta.title}</title>`,
725 ];
726 if (meta.author) {
727 lines.push(` <meta name="author" content="${meta.author}" />`);
728 }
729 if (meta.description) {
730 lines.push(` <meta name="description" content="${meta.description}" />`);
731 }
732 lines.push(
733 ` <style>${css}</style>`,
734 "</head>",
735 "<body>",
736 ' <div id="output">',
737 html,
738 " </div>",
739 "</body>",
740 "</html>"
741 );
742 return lines.join("\n");
743}
744
745async function inlineCss(html: string): Promise<string> {
746 try {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected