import { markdownObj } from "./markdownObj"; import { unified } from "unified"; import rehypeFormat from "rehype-format"; import rehypeStringify from "rehype-stringify"; import baseline from "./input/baseline.jsx"; import { readFile } from "fs-extra"; import { extractContent } from "./deprecated/extractContent.js"; import rehypeParse from "rehype-parse"; const jsxProcessor = unified() .use(rehypeParse, { fragment: true }) .use(rehypeFormat) .use(rehypeStringify); // //FIX seems to be an issue with the pipeline, run it and you'll see whats up // // const file = await markdownObj("./input/cookie.md"); const main = await extractContent("./input/cookie.md"); // console.log(file.main); const output = await jsxProcessor.stringify( await jsxProcessor.run( baseline({ // css: file.css, // header: eval(file.header)?.(file), // before: eval(file.before)?.(file), main: main, // after: eval(file.after)?.(file), // footer: eval(file.footer)?.(file), }), ), ); console.log(output);