文档部分基本完成,还需要完善生成目录

This commit is contained in:
:NoBody: committed 2026-04-25 16:42:37 +08:00
1 parent 578109c8de
commit 115fd47bae
108 files changed
+6202 -289

No files matched your search

+6 -42
View File
@@ -1,46 +1,10 @@
import { Browser, chromium } from "playwright";
// deno-lint-ignore no-import-prefix
import { parse } from "https://deno.land/[email protected]/flags/mod.ts";
import { match_sub_command_to_function } from "./cli/match.ts";
const args = parse(Deno.args);
// export async function mdToPdf(
// markdownContent: string,
// outputPath = "output.pdf",
// ): Promise<void> {
// const md = new MarkdownIt();
// const htmlContent = md.render(markdownContent);
// try {
// const page = await browser.newPage();
// const fullHtml = `
// <html>
// <head>
// <style>
// body { font-family: "Noto Sans CJK SC", sans-serif; margin: 40px; }
// h1 { color: #333; }
// code { background: #f4f4f4; padding: 2px 4px; }
// </style>
// </head>
// <body>${htmlContent}</body>
// </html>
// `;
// await page.setContent(fullHtml);
// await page.pdf({
// path: outputPath,
// format: "A4",
// printBackground: true,
// margin: { top: "20mm", bottom: "20mm", left: "10mm", right: "10mm" },
// });
// } finally {
// await browser.close();
// }
// }
// if (import.meta.main) {
// await mdToPdf("# Test Title\n\nHello **PDF**", "output.pdf");
// console.log("PDF generated: output.pdf");
// }
if (import.meta.main) {
console.log();
const sub_command = match_sub_command_to_function(args._ as Array<string>);
await sub_command();
}