Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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));
};
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));
};
export const handler = async (
args: Arguments
) => {
let config = await argdown.loadConfig(args.config);
config.json = config.json || {};
if (args.spaces !== null) {
config.json.spaces = args.spaces;
}
if (args.removeEmbeddedRelations) {
config.json.removeEmbeddedRelations = true;
}
if (args.removeMap) {
config.json.exportMap = false;
}
if (args.inputGlob) {
config.inputPath = args.inputGlob;
}
public async loadConfig(
configFile: string | undefined,
resource: vscode.Uri
): Promise {
if (!configFile) {
return {};
}
const workspaceFolder = vscode.workspace.getWorkspaceFolder(resource);
let configPath = configFile;
if (workspaceFolder) {
let rootPath = workspaceFolder.uri.fsPath;
configPath = path.resolve(rootPath, configFile);
} else if (!path.isAbsolute(configPath)) {
return {};
}
return await argdown.loadConfig(configPath);
}
}
export const handler = async (
args: Arguments
) => {
let config = await argdown.loadConfig(args.config);
config.dot = config.dot || {};
config.map = config.map || {};
config.group = config.group || {};
config.selection = config.selection || {};
config.color = config.color || {};
const format = args.format || "pdf";
if (format === "pdf") {
config.svgToPdf = config.svgToPdf || {};
} else {
config.saveAs = config.saveAs || {};
}
if (args.useHtmlLabels) {
config.dot.useHtmlLabels = true;
}
export const handler = async (
args: Arguments
) => {
let config = await argdown.loadConfig(args.config);
if (args.inputGlob) {
config.inputPath = args.inputGlob;
}
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) {
export const handler = async function(
args: Arguments
) {
let config = await argdown.loadConfig(args.config);
config.html = config.html || {};
if (args.headless) {
config.html.headless = true;
}
if (args.title) {
config.title = args.title;
}
if (args.lang) {
config.html.lang = args.lang;
}
if (args.inputGlob) {
config.inputPath = args.inputGlob;
}