Identifies level 1 headings and selects everything as text for it.

This commit is contained in:
2023-09-16 12:53:24 +02:00
parent 4be04f7115
commit ffb4778824
3 changed files with 50 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
import * as fs from "fs";
import { toHtml } from "./markdown.js"
const paths = {
output: ".dist",
@@ -36,7 +37,7 @@ manifest.forEach((m) => {
let htmlTemplate = fs.readFileSync(notePath, {
encoding: "utf-8",
});
htmlTemplate = htmlTemplate.replace("{{markdown}}", m.markdown);
htmlTemplate = htmlTemplate.replace("{{markdown}}", toHtml(m.markdown));
fs.writeFileSync(`${paths.output}/${m.directoryName}.html`, htmlTemplate, {
encoding: "utf-8",
flag: "ax",