How to use @argdown/node - 10 common examples

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-language-server / dist / server.js View on Github external
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const vscode_languageserver_1 = require("vscode-languageserver");
const vscode_uri_1 = require("vscode-uri");
const Export_1 = require("./commands/Export");
const DocumentSymbolsPlugin_1 = require("./providers/DocumentSymbolsPlugin");
const index_1 = require("./providers/index");
const node_1 = require("@argdown/node");
const EXPORT_CONTENT_COMMAND = "argdown.server.exportContent";
const EXPORT_DOCUMENT_COMMAND = "argdown.server.exportDocument";
const RUN_COMMAND = "argdown.run";
// Create a connection for the server. The connection uses Node's IPC as a transport
let connection = vscode_languageserver_1.createConnection(vscode_languageserver_1.ProposedFeatures.all);
node_1.argdown.logger.log = function (level, message) {
    if (level != "verbose" || this.logLevel == "verbose") {
        connection.console.log(message);
    }
};
let hasConfigurationCapability = false;
let hasWorkspaceFolderCapability = false;
// Create a simple text document manager. The text document manager
// supports full document sync only
let documents = new vscode_languageserver_1.TextDocuments();
let workspaceFolders;
// After the server has started the client sends an initilize request. The server receives
// in the passed params the rootPath of the workspace plus the client capabilites.
connection.onInitialize((params) => {
    let capabilities = params.capabilities;
    connection.console.log("Node version: " + process.version);
    // Does the client support the `workspace/configuration` request?
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 / dist / src / commands / RunCommand.js View on Github external
exports.handler = async (argv) => {
    const processName = argv.process || "default";
    let config = await node_1.argdown.loadConfig(argv.config);
    config.process = processName;
    config.logLevel = argv.verbose ? "verbose" : config.logLevel;
    config.watch = argv.watch || config.watch;
    config.logParserErrors = argv.logParserErrors || config.logParserErrors;
    await node_1.argdown.load(config).catch(e => console.log(e));
};
//# sourceMappingURL=RunCommand.js.map
github christianvoigt / argdown / packages / argdown-cli / dist / src / commands / JSONCommand.js View on Github external
config.logLevel = argv.verbose ? "verbose" : config.logLevel;
    config.watch = argv.watch || config.watch;
    config.process = ["load-file", "parse-input"];
    config.logParserErrors = argv.logParserErrors || config.logParserErrors;
    if (config.logParserErrors) {
        config.process.push("log-parser-errors");
    }
    config.process.push("build-model");
    config.process.push("export-json");
    if (!argv.stdout || argv.outputDir) {
        config.process.push("save-as-json");
    }
    if (argv.stdout) {
        config.process.push("stdout-json");
    }
    await node_1.argdown.load(config).catch(e => console.log(e));
};
//# sourceMappingURL=JSONCommand.js.map
github christianvoigt / argdown / packages / argdown-cli / dist / src / commands / MapCommand.js View on Github external
else if (format === "svg") {
            config.process.push("save-svg-as-svg");
        }
        else {
            config.process.push("save-svg-as-pdf");
        }
    }
    if (argv.stdout) {
        if (format === "dot") {
            config.process.push("stdout-dot");
        }
        else {
            config.process.push("stdout-svg");
        }
    }
    await node_1.argdown.load(config).catch(e => console.log(e));
};
//# sourceMappingURL=MapCommand.js.map
github christianvoigt / argdown / packages / argdown-cli / dist / src / commands / CompileCommand.js View on Github external
config.inputPath = argv.inputGlob;
    }
    config.saveAs = config.saveAs || {};
    if (argv.outputDir) {
        config.saveAs.outputDir = argv.outputDir;
    }
    config.logLevel = argv.verbose ? "verbose" : config.logLevel;
    config.watch = argv.watch || config.watch;
    config.process = ["load-file"];
    if (!argv.stdout || argv.outputDir) {
        config.process.push("save-as-argdown");
    }
    if (argv.stdout) {
        config.process.push("stdout-argdown");
    }
    await node_1.argdown.load(config).catch((e) => console.log(e));
};
//# sourceMappingURL=CompileCommand.js.map
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 / 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));
};
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));
};

@argdown/node

Async Argdown application for node.js

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis