How to use the @argdown/node.argdown.addPlugin function in @argdown/node

To help you get started, we’ve selected a few @argdown/node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github christianvoigt / argdown / packages / argdown-vscode / src / preview / ArgdownEngine.ts View on Github external
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

@argdown/node

Async Argdown application for node.js

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis