文档部分基本完成,还需要完善生成目录
This commit is contained in:
1 parent
578109c8de
commit
365b1db47e
109 files changed
+6222
-289
No files matched your search
+6
-42
@@ -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();
|
||||
}
|
||||
Reference in new issue
Block a user