Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as path from "path";
import { ArgdownPreviewConfiguration } from "./ArgdownPreviewConfiguration";
import { findElementAtPositionPlugin } from "./FindElementAtPositionPlugin";
import { argdown } from "@argdown/node";
import {
IArgdownRequest,
ISection,
IEquivalenceClass,
IArgument,
IMapNode,
isGroupMapNode,
ArgdownTypes,
IMap,
stringifyArgdownData
} from "@argdown/core";
argdown.addPlugin(findElementAtPositionPlugin, "find-element-at-position");
export class ArgdownEngine {
public constructor() {}
public async exportHtml(
doc: vscode.TextDocument,
config: ArgdownPreviewConfiguration
): Promise {
const argdownConfig = config.argdownConfig || {};
const input = doc.getText();
const request: IArgdownRequest = {
...argdownConfig,
input: input,
process: ["parse-input", "build-model", "export-html"],
html: {
...argdownConfig.html,
headless: true