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.");
public constructor(private context: vscode.ExtensionContext) {
this.config = MarkdownPreviewEnhancedConfig.getCurrentConfig();
mume
.init() // init markdown-preview-enhanced
.then(() => {
mume.onDidChangeConfigFile(this.refreshAllPreviews.bind(this));
MarkdownEngine.onModifySource(this.modifySource.bind(this));
const extensionVersion = require(path.resolve(
this.context.extensionPath,
"./package.json",
))["version"];
if (extensionVersion !== mume.configs.config["vscode_mpe_version"]) {
mume.utility.updateExtensionConfig({
vscode_mpe_version: extensionVersion,
});
}
});
}