Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} 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));
};
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));
};
}
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));
};
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));
};
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));
};
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));
};