How to use the @argdown/node.argdown.load 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-cli / src / commands / MapCommand.ts View on Github external
} else {
      config.process.push("save-svg-as-pdf");
    }
  }

  if (args.stdout) {
    if (format === "dot") {
      config.process.push("stdout-dot");
    } else if (format === "graphml") {
      config.process.push("stdout-graphml");
    } else {
      // pdf and png to stdout is currently not supported
      config.process.push("stdout-svg");
    }
  }
  await argdown.load(config).catch(e => console.log(e));
};
github christianvoigt / argdown / packages / argdown-cli / src / commands / DefaultCommand.ts View on Github external
export const handler = async (args: Arguments) => {
  let config = await argdown.loadConfig(args.config);
  config.logLevel = args.verbose ? "verbose" : config.logLevel;
  config.watch = args.watch || config.watch;
  config.logParserErrors = args.logParserErrors || config.logParserErrors;
  await argdown.load(config).catch(e => console.log(e));
};
github christianvoigt / argdown / packages / argdown-cli / src / commands / CompileCommand.ts View on Github external
}
  config.saveAs = config.saveAs || {};
  if (args.outputDir) {
    config.saveAs.outputDir = args.outputDir;
  }

  config.logLevel = args.verbose ? "verbose" : config.logLevel;
  config.watch = args.watch || config.watch;
  config.process = ["load-file"];
  if (!args.stdout || args.outputDir) {
    config.process.push("save-as-argdown");
  }
  if (args.stdout) {
    config.process.push("stdout-argdown");
  }
  await argdown.load(config).catch((e: Error) => console.log(e));
};
github christianvoigt / argdown / packages / argdown-cli / src / commands / HtmlCommand.ts View on Github external
config.process.push("export-html");

  if (!args.stdout || args.outputDir) {
    config.process.push("save-as-html");
  }

  if (args.css) {
    config.html.css = args.css;
  } else if (!args.stdout || args.outputDir) {
    config.process.push("copy-default-css");
  }
  if (args.stdout) {
    config.process.push("stdout-html");
  }

  await argdown.load(config).catch((e: Error) => console.log(e.message));
};
github christianvoigt / argdown / packages / argdown-cli / src / commands / JSONCommand.ts View on Github external
config.logParserErrors = args.logParserErrors || config.logParserErrors;
  if (config.logParserErrors) {
    config.process.push("log-parser-errors");
  }
  config.process.push("build-model");
  config.process.push("colorize");
  config.process.push("export-json");

  if (!args.stdout || args.outputDir) {
    config.process.push("save-as-json");
  }
  if (args.stdout) {
    config.process.push("stdout-json");
  }

  await argdown.load(config).catch(e => console.log(e));
};
github christianvoigt / argdown / packages / argdown-cli / src / commands / RunCommand.ts View on Github external
export const handler = async (
  args: Arguments
) => {
  const processName = args.process || "default";
  let config = await argdown.loadConfig(args.config);
  config.process = processName;
  config.logLevel = args.verbose ? "verbose" : config.logLevel;
  config.watch = args.watch || config.watch;
  config.logParserErrors = args.logParserErrors || config.logParserErrors;
  await argdown.load(config).catch(e => console.log(e));
};

@argdown/node

Async Argdown application for node.js

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis