當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.ArgdownApplication類代碼示例

本文整理匯總了TypeScript中@argdown/core.ArgdownApplication的典型用法代碼示例。如果您正苦於以下問題:TypeScript ArgdownApplication類的具體用法?TypeScript ArgdownApplication怎麽用?TypeScript ArgdownApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ArgdownApplication類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: ArgdownApplication

  ArgdownApplication,
  ParserPlugin,
  ModelPlugin,
  PreselectionPlugin,
  StatementSelectionPlugin,
  ArgumentSelectionPlugin,
  DataPlugin,
  MapPlugin,
  GroupPlugin,
  ColorPlugin,
  DotExportPlugin
} from "@argdown/core";
import { VizJsMap, DagreMap } from "../src/index";
import "babel-polyfill";

const app = new ArgdownApplication();
const parserPlugin = new ParserPlugin();
app.addPlugin(parserPlugin, "parse-input");
app.addPlugin(new DataPlugin(), "build-model");
const modelPlugin = new ModelPlugin();
app.addPlugin(modelPlugin, "build-model");
const preselectionPlugin = new PreselectionPlugin();
app.addPlugin(preselectionPlugin, "create-map");
const statementSelectionPlugin = new StatementSelectionPlugin();
app.addPlugin(statementSelectionPlugin, "create-map");
const argumentSelectionPlugin = new ArgumentSelectionPlugin();
app.addPlugin(argumentSelectionPlugin, "create-map");
const mapPlugin = new MapPlugin();
app.addPlugin(mapPlugin, "create-map");
const groupPlugin = new GroupPlugin();
app.addPlugin(groupPlugin, "create-map");
開發者ID:christianvoigt,項目名稱:argdown,代碼行數:31,代碼來源:index.ts

示例2: it

 it("sanity test", function() {
   const source = `[T1]: Hello World`;
   const result = app.run({
     process: ["parse-input", "build-model", "export-symbols"],
     input: source,
     logLevel: "error"
   });
   expect(result.documentSymbols).to.exist;
   expect(result.documentSymbols!.length).to.equal(1);
   expect(result.documentSymbols![0].name).to.equal("[T1]");
 });
開發者ID:christianvoigt,項目名稱:argdown,代碼行數:11,代碼來源:DocumentSymbolPlugin.spec.ts

示例3: VizJsMap

const createVizJsMap = (container: HTMLElement) => {
  container.innerHTML = "";
  const vizJsMap = new VizJsMap(container, "/full.render.js");
  const response = app.run({
    input: `
  # G1
  
  <a1>
      - <a2>
  `,
    process: exportDot
  });
  vizJsMap.render({ dot: response.dot! });
};
開發者ID:christianvoigt,項目名稱:argdown,代碼行數:14,代碼來源:index.ts

示例4: DagreMap

const createDagreMap = (container: HTMLElement) => {
  container.innerHTML = "";
  const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
  svg.setAttribute("style", "width: 100%; height: 100%;");
  container.appendChild(svg);
  const dagreMap = new DagreMap(svg);
  const response = app.run({
    input: `
      # G1
      
      <a1>
          - <a2>
      `,
    process: exportMap
  });
  dagreMap.render({ settings: {}, map: response.map!, tags: response.tags! });
};
開發者ID:christianvoigt,項目名稱:argdown,代碼行數:17,代碼來源:index.ts


注:本文中的@argdown/core.ArgdownApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。