All files / src argdown.ts

100% Statements 59/59
100% Branches 0/0
100% Functions 0/0
100% Lines 59/59

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103    1x 1x                   1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x         1x 1x 1x         1x   1x         1x         1x           1x 1x 1x 1x 1x         1x 1x 1x 1x 1x 1x 1x   1x   1x 1x   1x 1x 1x 1x   1x 1x 1x   1x 1x 1x 1x 1x 1x 1x  
"use strict";
 
import { AsyncArgdownApplication } from "./AsyncArgdownApplication";
import {
  ParserPlugin,
  ModelPlugin,
  HtmlExportPlugin,
  JSONExportPlugin,
  TagPlugin,
  MapPlugin,
  DotExportPlugin,
  DataPlugin
} from "@argdown/core";
import { SaveAsFilePlugin } from "./plugins/SaveAsFilePlugin";
import { DotToSvgExportPlugin } from "./plugins/DotToSvgExportPlugin";
import { SvgToPdfExportPlugin } from "./plugins/SvgToPdfExportPlugin";
import { CopyDefaultCssPlugin } from "./plugins/CopyDefaultCssPlugin";
import { LogParserErrorsPlugin } from "./plugins/LogParserErrorsPlugin";
import { StdOutPlugin } from "./plugins/StdOutPlugin";
import { IncludePlugin } from "./plugins/IncludePlugin";
import { LoadFilePlugin } from "./plugins/LoadFilePlugin";
 
export const argdown = new AsyncArgdownApplication();
const loadFilePlugin = new LoadFilePlugin();
const includePlugin = new IncludePlugin();
const parserPlugin = new ParserPlugin();
const logParserErrorsPlugin = new LogParserErrorsPlugin();
const dataPlugin = new DataPlugin();
const modelPlugin = new ModelPlugin();
const htmlExport = new HtmlExportPlugin();
const tagPlugin = new TagPlugin();
const mapPlugin = new MapPlugin();
const dotExport = new DotExportPlugin();
const jsonExport = new JSONExportPlugin();
const saveAsHtml = new SaveAsFilePlugin({
  outputDir: "./html",
  dataKey: "html",
  extension: ".html"
});
const copyDefaultCss = new CopyDefaultCssPlugin();
const dotToSvgExport = new DotToSvgExportPlugin();
const saveSvgAsSvg = new SaveAsFilePlugin({
  outputDir: "./svg",
  dataKey: "svg",
  extension: ".svg"
});
const saveSvgAsPdf = new SvgToPdfExportPlugin();
 
const saveAsDot = new SaveAsFilePlugin({
  outputDir: "./dot",
  dataKey: "dot",
  extension: ".dot"
});
const saveAsJSON = new SaveAsFilePlugin({
  outputDir: "./json",
  dataKey: "json",
  extension: ".json"
});
const saveAsArgdown = new SaveAsFilePlugin({
  outputDir: "./compiled",
  dataKey: "input",
  extension: ".argdown",
  isRequestData: true
});
const stdoutDot = new StdOutPlugin({ dataKey: "dot" });
const stdoutSvg = new StdOutPlugin({ dataKey: "svg" });
const stdoutJSON = new StdOutPlugin({ dataKey: "json" });
const stdoutHtml = new StdOutPlugin({ dataKey: "html" });
const stdoutArgdown = new StdOutPlugin({
  dataKey: "input",
  isRequestData: true
});
 
argdown.addPlugin(loadFilePlugin, "load-file");
argdown.addPlugin(includePlugin, "load-file");
argdown.addPlugin(parserPlugin, "parse-input");
argdown.addPlugin(logParserErrorsPlugin, "log-parser-errors");
argdown.addPlugin(dataPlugin, "build-model");
argdown.addPlugin(modelPlugin, "build-model");
argdown.addPlugin(tagPlugin, "build-model");
 
argdown.addPlugin(mapPlugin, "build-map");
 
argdown.addPlugin(stdoutArgdown, "stdout-argdown");
argdown.addPlugin(saveAsArgdown, "save-as-argdown");
 
argdown.addPlugin(htmlExport, "export-html");
argdown.addPlugin(copyDefaultCss, "copy-default-css");
argdown.addPlugin(saveAsHtml, "save-as-html");
argdown.addPlugin(stdoutHtml, "stdout-html");
 
argdown.addPlugin(jsonExport, "export-json");
argdown.addPlugin(saveAsJSON, "save-as-json");
argdown.addPlugin(stdoutJSON, "stdout-json");
 
argdown.addPlugin(dotExport, "export-dot");
argdown.addPlugin(saveAsDot, "save-as-dot");
argdown.addPlugin(stdoutDot, "stdout-dot");
argdown.addPlugin(dotToSvgExport, "export-svg");
argdown.addPlugin(saveSvgAsSvg, "save-svg-as-svg");
argdown.addPlugin(stdoutSvg, "stdout-svg");
argdown.addPlugin(saveSvgAsPdf, "save-svg-as-pdf");