Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main() {
await mume.init();
const engine = new mume.MarkdownEngine({
filePath: "./docs/fullbook.md",
config: {
previewTheme: "github-light.css",
// revealjsTheme: "white.css"
codeBlockTheme: "default.css",
breakOnSingleNewLine: false,
printBackground: true,
enableScriptExecution: true, // <= for running code chunks
},
});
// html export
// await engine.htmlExport({ offline: false, runAllCodeChunks: true });
// console.log("Should be done.");
// chrome (puppeteer) export
public initMarkdownEngine(sourceUri: Uri): MarkdownEngine {
let engine = this.getEngine(sourceUri);
if (!engine) {
engine = new MarkdownEngine({
filePath: this.getFilePath(sourceUri),
projectDirectoryPath: this.getProjectDirectoryPath(
sourceUri,
vscode.workspace.workspaceFolders,
),
config: this.config,
});
this.engineMaps[sourceUri.fsPath] = engine;
this.jsAndCssFilesMaps[sourceUri.fsPath] = [];
}
return engine;
}