工农解放报第二期26.11
This commit is contained in:
1 parent
97e84fa6c4
commit
5977b1b272
17 files changed
+604
-46
No files matched your search
@@ -131,6 +131,25 @@ export async function generate_md() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function generate_html() {
|
||||
await cacheBeforeGeneration();
|
||||
for (const config of selectedConfigs()) {
|
||||
const builder = new DocuBuilder(
|
||||
config,
|
||||
await createTemplateVariables(args, config, cfg.vars),
|
||||
);
|
||||
builder.with_files_sync(config.journal.from_directory);
|
||||
const html = await builder.as_html_page();
|
||||
const markdownPath = config.md?.path ?? config.markdown_output;
|
||||
if (!markdownPath) {
|
||||
throw new Error("Missing output path in config. Use md.path.");
|
||||
}
|
||||
const htmlPath = markdownPath.replace(/\.md$/i, ".html");
|
||||
await Deno.writeTextFile(htmlPath, html);
|
||||
console.log(`Generated HTML: ${htmlPath}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function generate_txt() {
|
||||
await cacheBeforeGeneration();
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user