How to use the @argdown/node.argdown 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-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 / 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-language-server / dist / server.js View on Github external
const processTextForProviders = (text, path) => __awaiter(this, void 0, void 0, function* () {
    const request = {
        input: text,
        inputPath: path,
        process: ["parse-input", "build-model"]
    };
    return yield node_1.argdown.runAsync(request);
});
connection.onRenameRequest((params) => __awaiter(this, void 0, void 0, function* () {
github christianvoigt / argdown / packages / argdown-cli / dist / src / commands / HtmlCommand.js View on Github external
exports.handler = async function (argv) {
    let config = await node_1.argdown.loadConfig(argv.config);
    config.html = config.html || {};
    if (argv.headless) {
        config.html.headless = true;
    }
    if (argv.title) {
        config.html.title = argv.title;
    }
    if (argv.inputGlob) {
        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;
github christianvoigt / argdown / packages / argdown-cli / dist / src / commands / JSONCommand.js View on Github external
exports.handler = async (argv) => {
    let config = await node_1.argdown.loadConfig(argv.config);
    config.json = config.json || {};
    if (argv.spaces !== null) {
        config.json.spaces = argv.spaces;
    }
    if (argv.removeEmbeddedRelations) {
        config.json.removeEmbeddedRelations = true;
    }
    if (argv.removeMap) {
        config.json.exportMap = false;
    }
    if (argv.inputGlob) {
        config.inputPath = argv.inputGlob;
    }
    config.saveAs = config.saveAs || {};
    if (argv.outputDir) {
        config.saveAs.outputDir = argv.outputDir;
github christianvoigt / argdown / packages / argdown-cli / dist / src / commands / MapCommand.js View on Github external
exports.handler = async (argv) => {
    let config = await node_1.argdown.loadConfig(argv.config);
    config.dot = config.dot || {};
    config.map = config.map || {};
    config.group = config.group || {};
    config.selection = config.selection || {};
    config.color = config.color || {};
    const format = argv.format || "pdf";
    if (format === "pdf") {
        config.svgToPdf = config.svgToPdf || {};
    }
    else {
        config.saveAs = config.saveAs || {};
    }
    if (argv.useHtmlLabels) {
        config.dot.useHtmlLabels = true;
    }
    if (argv.argumentLabelMode) {

@argdown/node

Async Argdown application for node.js

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis