index: generate HTML, discern wordcount

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2023-04-15 07:56:00 -04:00
parent 508ab9cb2c
commit b264b0b467

View File

@ -213,11 +213,22 @@ language: en-US
await fs.writeFile(`${dir}/src/aboutAuthor.txt`, "---\n\n" + book.authorBio);
let args = ["-o", `${dir}/ebook.epub`, "--to", "epub", `${dir}/src/title.txt`];
args = args.concat(fnames.map((fname) => `${dir}/src/${fname}`));
args = args.concat([`${dir}/src/aboutAuthor.txt`]);
let files = [`${dir}/src/title.txt`];
files = files.concat(fnames.map((fname) => `${dir}/src/${fname}`));
files = files.concat([`${dir}/src/aboutAuthor.txt`]);
console.log(await execa("pandoc", args));
let args = ["-o", `${dir}/ebook.epub`, "--to", "epub"];
args = args.concat(files);
await execa("pandoc", args);
args = ["-o", `${dir}/ebook.html`, "--to", "html"];
args = args.concat(files);
await execa("pandoc", args);
args = ["--lua-filter", "./wordcount.lua"];
args = args.concat(files);
const { stdout } = await execa("pandoc", args);
console.log(stdout);
});
program