Final touches to the facelift
This commit is contained in:
parent
379287af36
commit
a2fbf908aa
19 changed files with 194 additions and 87 deletions
|
|
@ -168,10 +168,16 @@ async function exportStory(slug: string, options: { outputDir: string }) {
|
|||
);
|
||||
const rtfText = await readFile(join(tempDir, "temp.rtf"), "utf-8");
|
||||
const rtfStyles = getRTFStyles(rtfText);
|
||||
await writeFile(
|
||||
join(outputDir, `${slug}.rtf`),
|
||||
rtfText.replaceAll(rtfStyles["Preformatted Text"], rtfStyles["Normal"]),
|
||||
);
|
||||
if (!rtfStyles["Preformatted Text"]) {
|
||||
console.warn(`Missing RTF style "Preformatted Text"! Skipping RTF file generation.`);
|
||||
} else if (!rtfStyles["Normal"]) {
|
||||
console.warn(`Missing RTF style "Normal"! Skipping RTF file generation.`);
|
||||
} else {
|
||||
await writeFile(
|
||||
join(outputDir, `${slug}.rtf`),
|
||||
rtfText.replaceAll(rtfStyles["Preformatted Text"], rtfStyles["Normal"]),
|
||||
);
|
||||
}
|
||||
})(),
|
||||
]);
|
||||
console.log("Success!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue