@unified-latex/unified-latex-cli 1.0.12 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -12,14 +13,20 @@ var __copyProps = (to, from, except, desc) => {
12
13
  }
13
14
  return to;
14
15
  };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
18
+ mod
19
+ ));
16
20
 
17
21
  // libs/unified-latex.ts
18
22
  var import_unified = require("unified");
19
23
  var import_unified_latex_util_parse = require("@unified-latex/unified-latex-util-parse");
20
24
  var import_unified_latex_util_to_string = require("@unified-latex/unified-latex-util-to-string");
21
25
  var processLatexViaUnified = (options2) => {
22
- return (0, import_unified.unified)().use(import_unified_latex_util_parse.unifiedLatexFromString).use(import_unified_latex_util_to_string.unifiedLatexStringCompiler, Object.assign({ pretty: true, forceNewlineEnding: true }, options2));
26
+ return (0, import_unified.unified)().use(import_unified_latex_util_parse.unifiedLatexFromString).use(
27
+ import_unified_latex_util_to_string.unifiedLatexStringCompiler,
28
+ Object.assign({ pretty: true, forceNewlineEnding: true }, options2)
29
+ );
23
30
  };
24
31
 
25
32
  // libs/unified-args/index.ts
@@ -39,10 +46,12 @@ var import_fault = require("fault");
39
46
 
40
47
  // libs/lints/index.ts
41
48
  var import_unified_latex_lint = require("@unified-latex/unified-latex-lint");
42
- var availableLints = Object.fromEntries(Object.values(import_unified_latex_lint.lints).map((lint) => [
43
- lint.name.replace(/^unified-latex-lint:/, ""),
44
- lint
45
- ]));
49
+ var availableLints = Object.fromEntries(
50
+ Object.values(import_unified_latex_lint.lints).map((lint) => [
51
+ lint.name.replace(/^unified-latex-lint:/, ""),
52
+ lint
53
+ ])
54
+ );
46
55
 
47
56
  // libs/unified-args/schema.ts
48
57
  var schema = [
@@ -88,7 +97,9 @@ var schema = [
88
97
  },
89
98
  {
90
99
  long: "lint",
91
- description: `Lint rules to apply. Use multiple times to specify multiple lints. Available rules: ${Object.keys(availableLints).join(", ")}`,
100
+ description: `Lint rules to apply. Use multiple times to specify multiple lints. Available rules: ${Object.keys(
101
+ availableLints
102
+ ).join(", ")}`,
92
103
  short: "l",
93
104
  type: "string",
94
105
  value: "<rule>"
@@ -126,6 +137,13 @@ var schema = [
126
137
  type: "string",
127
138
  value: "<rule>"
128
139
  },
140
+ {
141
+ long: "expand-document-macro",
142
+ description: "Expand the specified macro which is defined in the document. You can use --stats to list all macros defined in the document.",
143
+ short: "d",
144
+ type: "string",
145
+ value: "<name>"
146
+ },
129
147
  {
130
148
  long: "frail",
131
149
  description: "Exit with 1 on warnings",
@@ -236,7 +254,9 @@ function parseMacroExpansion(def) {
236
254
  const macro = (0, import_unified_latex_util_parse2.parse)(def).content[0];
237
255
  const name = (0, import_unified_latex_util_macros.newcommandMacroToName)(macro);
238
256
  if (!name) {
239
- throw new Error(`Could extract macro definition from "${def}"; expected the macro to be defined via \\newcommand or similar syntax`);
257
+ throw new Error(
258
+ `Could extract macro definition from "${def}"; expected the macro to be defined via \\newcommand or similar syntax`
259
+ );
240
260
  }
241
261
  const signature = (0, import_unified_latex_util_macros.newcommandMacroToSpec)(macro);
242
262
  const body = (0, import_unified_latex_util_macros.newcommandMacroToSubstitutionAst)(macro);
@@ -244,7 +264,9 @@ function parseMacroExpansion(def) {
244
264
  }
245
265
  const parsedSpec = import_json5.default.parse(def);
246
266
  if (parsedSpec.name == null || parsedSpec.body == null) {
247
- throw new Error(`Expected a "name" field and a "body" field to be defined on ${def}`);
267
+ throw new Error(
268
+ `Expected a "name" field and a "body" field to be defined on ${def}`
269
+ );
248
270
  }
249
271
  parsedSpec.signature = parsedSpec.signature || "";
250
272
  return {
@@ -299,7 +321,9 @@ function options(flags, configuration) {
299
321
  ].join("\n");
300
322
  const settings = parseSettings(config.setting);
301
323
  if (config.html && config.statsJson) {
302
- throw new Error("Both --html and --stats-json were specified; only one may be used at a time.");
324
+ throw new Error(
325
+ "Both --html and --stats-json were specified; only one may be used at a time."
326
+ );
303
327
  }
304
328
  return {
305
329
  helpMessage: help,
@@ -339,8 +363,15 @@ function options(flags, configuration) {
339
363
  frail: config.frail,
340
364
  stats: config.stats,
341
365
  statsJson: config.statsJson,
342
- expandMacro: normalizeToArray(config.expandMacro).map(parseMacroExpansion),
343
- macro: normalizeToArray(config.macro).map(parseMacroExpansion),
366
+ expandMacro: normalizeToArray(config.expandMacro).map(
367
+ parseMacroExpansion
368
+ ),
369
+ expandDocumentMacro: normalizeToArray(
370
+ config.expandDocumentMacro
371
+ ),
372
+ macro: normalizeToArray(config.macro).map(
373
+ parseMacroExpansion
374
+ ),
344
375
  html: config.html
345
376
  };
346
377
  }
@@ -363,17 +394,19 @@ function normalizeLints(value, config) {
363
394
  if (config.lintAll) {
364
395
  normalized.push(...Object.keys(availableLints).map((v) => [v]));
365
396
  }
366
- const result = Object.fromEntries(normalized.map((value2) => {
367
- let params = value2[1] ? parseConfig(value2[1], {}) : void 0;
368
- if (config.fixAll) {
369
- if (params) {
370
- Object.assign(params, { fix: true });
371
- } else {
372
- params = { fix: true };
397
+ const result = Object.fromEntries(
398
+ normalized.map((value2) => {
399
+ let params = value2[1] ? parseConfig(value2[1], {}) : void 0;
400
+ if (config.fixAll) {
401
+ if (params) {
402
+ Object.assign(params, { fix: true });
403
+ } else {
404
+ params = { fix: true };
405
+ }
373
406
  }
374
- }
375
- return [value2[0], params];
376
- }));
407
+ return [value2[0], params];
408
+ })
409
+ );
377
410
  return result;
378
411
  }
379
412
  function reporter(value) {
@@ -398,7 +431,11 @@ function parseConfig(value, cache) {
398
431
  flags = toCamelCase(parseJSON(value));
399
432
  } catch (error) {
400
433
  const exception = error;
401
- throw (0, import_fault.fault)("Cannot parse `%s` as JSON: %s", value, exception.message.replace(/at(?= position)/, "around"));
434
+ throw (0, import_fault.fault)(
435
+ "Cannot parse `%s` as JSON: %s",
436
+ value,
437
+ exception.message.replace(/at(?= position)/, "around")
438
+ );
402
439
  }
403
440
  for (flag in flags) {
404
441
  if (own.call(flags, flag)) {
@@ -412,7 +449,11 @@ function validateLintNames(lints2) {
412
449
  const name = lint[0];
413
450
  if (!availableLints[name]) {
414
451
  const known = Object.keys(availableLints);
415
- throw (0, import_fault.fault)("Unknown lint rule `%s`, available rules are:\n%s", name, " " + known.join("\n "));
452
+ throw (0, import_fault.fault)(
453
+ "Unknown lint rule `%s`, available rules are:\n%s",
454
+ name,
455
+ " " + known.join("\n ")
456
+ );
416
457
  }
417
458
  }
418
459
  return true;
@@ -420,7 +461,11 @@ function validateLintNames(lints2) {
420
461
  function handleUnknownArgument(flag) {
421
462
  if (flag.charAt(0) === "-") {
422
463
  if (flag.charAt(1) === "-") {
423
- throw (0, import_fault.fault)("Unknown option `%s`, expected:\n%s", flag, inspectAll(schema));
464
+ throw (0, import_fault.fault)(
465
+ "Unknown option `%s`, expected:\n%s",
466
+ flag,
467
+ inspectAll(schema)
468
+ );
424
469
  }
425
470
  const found = flag.slice(1).split("");
426
471
  const known = schema.filter((d) => d.short);
@@ -429,7 +474,11 @@ function handleUnknownArgument(flag) {
429
474
  while (++index2 < found.length) {
430
475
  const key = found[index2];
431
476
  if (!knownKeys.has(key)) {
432
- throw (0, import_fault.fault)("Unknown short option `-%s`, expected:\n%s", key, inspectAll(known));
477
+ throw (0, import_fault.fault)(
478
+ "Unknown short option `-%s`, expected:\n%s",
479
+ key,
480
+ inspectAll(known)
481
+ );
433
482
  }
434
483
  }
435
484
  }
@@ -512,11 +561,16 @@ var statsPlugin = function() {
512
561
  const packages = (0, import_unified_latex_util_packages.listPackages)(tree);
513
562
  const packageNames = packages.map((s) => (0, import_unified_latex_util_print_raw.printRaw)(s));
514
563
  if (packages.length > 0) {
515
- file.info(`Found ${packages.length} imported packages: ${packageNames.join(", ")}`);
564
+ file.info(
565
+ `Found ${packages.length} imported packages: ${packageNames.join(", ")}`
566
+ );
516
567
  }
517
568
  const newcommands = (0, import_unified_latex_util_macros2.listNewcommands)(tree);
518
569
  if (newcommands.length > 0) {
519
- file.info(`Found ${newcommands.length} defined commands: ${newcommands.map((c) => `\\${c.name}`).join(", ")}`, enclosingPosition(newcommands.map((c) => c.definition)));
570
+ file.info(
571
+ `Found ${newcommands.length} defined commands: ${newcommands.map((c) => `\\${c.name}`).join(", ")}`,
572
+ enclosingPosition(newcommands.map((c) => c.definition))
573
+ );
520
574
  }
521
575
  };
522
576
  };
@@ -540,7 +594,9 @@ var import_unified_latex_util_macros3 = require("@unified-latex/unified-latex-ut
540
594
  var import_unified_latex_util_arguments = require("@unified-latex/unified-latex-util-arguments");
541
595
  var expandMacrosPlugin = function(options2) {
542
596
  const { macros = [] } = options2 || {};
543
- const macroInfo = Object.fromEntries(macros.map((m) => [m.name, { signature: m.signature }]));
597
+ const macroInfo = Object.fromEntries(
598
+ macros.map((m) => [m.name, { signature: m.signature }])
599
+ );
544
600
  return (tree) => {
545
601
  (0, import_unified_latex_util_arguments.attachMacroArgs)(tree, macroInfo);
546
602
  (0, import_unified_latex_util_macros3.expandMacros)(tree, macros);
@@ -551,7 +607,9 @@ var expandMacrosPlugin = function(options2) {
551
607
  var import_unified_latex_util_arguments2 = require("@unified-latex/unified-latex-util-arguments");
552
608
  var attachMacroArgsPlugin = function(options2) {
553
609
  const { macros = [] } = options2 || {};
554
- const macroInfo = Object.fromEntries(macros.map((m) => [m.name, { signature: m.signature }]));
610
+ const macroInfo = Object.fromEntries(
611
+ macros.map((m) => [m.name, { signature: m.signature }])
612
+ );
555
613
  return (tree) => {
556
614
  (0, import_unified_latex_util_arguments2.attachMacroArgs)(tree, macroInfo);
557
615
  };
@@ -574,6 +632,23 @@ var prettyPrintHtmlPlugin = function() {
574
632
  };
575
633
  };
576
634
 
635
+ // libs/macros/expand-document-macros-plugin.ts
636
+ var import_unified_latex_util_macros4 = require("@unified-latex/unified-latex-util-macros");
637
+ var import_unified_latex_util_arguments3 = require("@unified-latex/unified-latex-util-arguments");
638
+ var expandDocumentMacrosPlugin = function(options2) {
639
+ const { macros = [] } = options2 || {};
640
+ const macrosSet = new Set(macros);
641
+ return (tree) => {
642
+ const newcommands = (0, import_unified_latex_util_macros4.listNewcommands)(tree);
643
+ const macros2 = newcommands.filter((s) => macrosSet.has(s.name));
644
+ const macroInfo = Object.fromEntries(
645
+ macros2.map((m) => [m.name, { signature: m.signature }])
646
+ );
647
+ (0, import_unified_latex_util_arguments3.attachMacroArgs)(tree, macroInfo);
648
+ (0, import_unified_latex_util_macros4.expandMacrosExcludingDefinitions)(tree, macros2);
649
+ };
650
+ };
651
+
577
652
  // libs/unified-args/index.ts
578
653
  var ttyStream = Object.assign(new import_node_stream.default.Readable(), { isTTY: true });
579
654
  var exitStatus = 0;
@@ -590,16 +665,19 @@ function unifiedArgs(cliConfig) {
590
665
  return fail(exception, true);
591
666
  }
592
667
  if (config.help) {
593
- import_node_process.default.stdout.write([
594
- "Usage: " + cliConfig.name + " [options] [path | glob ...]",
595
- "",
596
- " " + cliConfig.description,
597
- "",
598
- "Options:",
599
- "",
600
- config.helpMessage,
601
- ""
602
- ].join("\n"), noop);
668
+ import_node_process.default.stdout.write(
669
+ [
670
+ "Usage: " + cliConfig.name + " [options] [path | glob ...]",
671
+ "",
672
+ " " + cliConfig.description,
673
+ "",
674
+ "Options:",
675
+ "",
676
+ config.helpMessage,
677
+ ""
678
+ ].join("\n"),
679
+ noop
680
+ );
603
681
  return;
604
682
  }
605
683
  if (config.version) {
@@ -610,17 +688,27 @@ function unifiedArgs(cliConfig) {
610
688
  output = config.output;
611
689
  config.streamIn = ttyStream;
612
690
  config.out = false;
613
- import_node_process.default.stderr.write(import_chalk.default.bold("Watching...") + " (press CTRL+C to exit)\n", noop);
691
+ import_node_process.default.stderr.write(
692
+ import_chalk.default.bold("Watching...") + " (press CTRL+C to exit)\n",
693
+ noop
694
+ );
614
695
  if (output === true) {
615
696
  config.output = false;
616
- import_node_process.default.stderr.write(import_chalk.default.yellow("Note") + ": Ignoring `--output` until exit.\n", noop);
697
+ import_node_process.default.stderr.write(
698
+ import_chalk.default.yellow("Note") + ": Ignoring `--output` until exit.\n",
699
+ noop
700
+ );
617
701
  }
618
702
  }
619
703
  if (config.lints) {
620
704
  for (const [lintName, lintArgs] of Object.entries(config.lints)) {
621
705
  const lint = availableLints[lintName];
622
706
  if (!lint) {
623
- throw new Error(`Could not find lint named "${lintName}"; available lints are ${Object.keys(availableLints).join(", ")}`);
707
+ throw new Error(
708
+ `Could not find lint named "${lintName}"; available lints are ${Object.keys(
709
+ availableLints
710
+ ).join(", ")}`
711
+ );
624
712
  }
625
713
  config.plugins.push([lint, lintArgs]);
626
714
  }
@@ -637,6 +725,12 @@ function unifiedArgs(cliConfig) {
637
725
  { macros: config.expandMacro }
638
726
  ]);
639
727
  }
728
+ if (config.expandDocumentMacro.length > 0) {
729
+ config.plugins.push([
730
+ expandDocumentMacrosPlugin,
731
+ { macros: config.expandDocumentMacro }
732
+ ]);
733
+ }
640
734
  if (config.statsJson) {
641
735
  config.plugins.push([statsJsonPlugin]);
642
736
  }
@@ -695,11 +789,23 @@ function noop() {
695
789
  }
696
790
 
697
791
  // index.ts
792
+ var import_node_fs = __toESM(require("node:fs"), 1);
793
+ var import_meta = {};
794
+ var version = "unknown (could not read version from package.json)";
795
+ try {
796
+ const packageJson = JSON.parse(
797
+ import_node_fs.default.readFileSync(new URL("./package.json", import_meta.url), {
798
+ encoding: "utf8"
799
+ })
800
+ );
801
+ version = packageJson.version;
802
+ } catch {
803
+ }
698
804
  unifiedArgs({
699
805
  processor: processLatexViaUnified,
700
806
  name: "unified-latex",
701
807
  description: "LaTeX processor powered by unified-latex",
702
- version: "1.0.8",
808
+ version,
703
809
  extensions: ["tex"],
704
810
  ignoreName: ".unifiedlatexignore",
705
811
  packageField: "unifiedLatexConfig",
package/index.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../libs/unified-latex.ts", "../libs/unified-args/index.ts", "../libs/unified-args/options.ts", "../libs/lints/index.ts", "../libs/unified-args/schema.ts", "../libs/macros/parse-macro-expansion.ts", "../libs/stats/index.ts", "../libs/stats/enclosing-position.ts", "../libs/macros/expand-macros-plugin.ts", "../libs/macros/attach-macro-args-plugin.ts", "../libs/html/format.ts", "../index.ts"],
4
- "sourcesContent": ["import { unified } from \"unified\";\nimport * as Ast from \"@unified-latex/unified-latex-types\";\nimport {\n unifiedLatexAstComplier,\n unifiedLatexFromString,\n} from \"@unified-latex/unified-latex-util-parse\";\nimport {\n unifiedLatexStringCompiler,\n PluginOptions as StringCompilerPluginOptions,\n} from \"@unified-latex/unified-latex-util-to-string\";\n/**\n * Use `unified()` to a string to an `Ast.Ast` and then pretty-print it.\n */\nexport const processLatexViaUnified = (\n options?: StringCompilerPluginOptions\n) => {\n return unified()\n .use(unifiedLatexFromString)\n .use(\n unifiedLatexStringCompiler,\n Object.assign({ pretty: true, forceNewlineEnding: true }, options)\n );\n};\n\n/**\n * Use `unified()` to a string to an `Ast.Ast` and then return it. This function\n * will not print/pretty-print the `Ast.Ast` back to a string.\n */\nexport const processLatexToAstViaUnified = () => {\n return unified().use(unifiedLatexFromString).use(unifiedLatexAstComplier);\n};\n", "// Modified from unified-args https://github.com/unifiedjs/unified-args/blob/main/lib/index.js\n// MIT License\n\nimport process from \"node:process\";\nimport stream from \"node:stream\";\nimport chalk from \"chalk\";\nimport chokidar, { FSWatcher } from \"chokidar\";\nimport {\n engine,\n Callback as EngineCallback,\n Context as EngineContext,\n} from \"unified-engine\";\nimport { unifiedLatexToHast } from \"@unified-latex/unified-latex-to-hast\";\nimport { options, Options } from \"./options\";\nimport { availableLints } from \"../lints\";\nimport { statsJsonPlugin, statsPlugin } from \"../stats\";\nimport { expandMacrosPlugin } from \"../macros/expand-macros-plugin\";\nimport { attachMacroArgsPlugin } from \"../macros/attach-macro-args-plugin\";\nimport { prettyPrintHtmlPlugin } from \"../html/format\";\n\n// Fake TTY stream.\nconst ttyStream = Object.assign(new stream.Readable(), { isTTY: true });\n\n// Exit, lazily, with the correct exit status code.\nlet exitStatus = 0;\n\nprocess.on(\"exit\", onexit);\n\n// Handle uncaught errors, such as from unexpected async behavior.\nprocess.on(\"uncaughtException\", fail);\n\n/**\n * Start the CLI.\n *\n * @param {Options} cliConfig\n */\nexport function unifiedArgs(cliConfig: Options) {\n let config: ReturnType<typeof options>;\n let watcher: FSWatcher | undefined;\n let output: boolean | string | undefined;\n\n try {\n config = options(process.argv.slice(2), cliConfig);\n } catch (error) {\n const exception = error as Error;\n return fail(exception, true);\n }\n\n if (config.help) {\n process.stdout.write(\n [\n \"Usage: \" + cliConfig.name + \" [options] [path | glob ...]\",\n \"\",\n \" \" + cliConfig.description,\n \"\",\n \"Options:\",\n \"\",\n config.helpMessage,\n \"\",\n ].join(\"\\n\"),\n noop\n );\n\n return;\n }\n\n if (config.version) {\n process.stdout.write(cliConfig.version + \"\\n\", noop);\n\n return;\n }\n\n // Modify `config` for watching.\n if (config.watch) {\n output = config.output;\n\n // Do not read from stdin(4).\n config.streamIn = ttyStream;\n\n // Do not write to stdout(4).\n config.out = false;\n\n process.stderr.write(\n chalk.bold(\"Watching...\") + \" (press CTRL+C to exit)\\n\",\n noop\n );\n\n // Prevent infinite loop if set to regeneration.\n if (output === true) {\n config.output = false;\n\n process.stderr.write(\n chalk.yellow(\"Note\") + \": Ignoring `--output` until exit.\\n\",\n noop\n );\n }\n }\n\n if (config.lints) {\n for (const [lintName, lintArgs] of Object.entries(config.lints)) {\n const lint = availableLints[lintName];\n if (!lint) {\n throw new Error(\n `Could not find lint named \"${lintName}\"; available lints are ${Object.keys(\n availableLints\n ).join(\", \")}`\n );\n }\n config.plugins.push([lint, lintArgs]);\n }\n }\n\n if (config.stats) {\n config.plugins.push([statsPlugin]);\n }\n\n if (config.macro.length > 0) {\n config.plugins.push([attachMacroArgsPlugin, { macros: config.macro }]);\n }\n\n if (config.expandMacro.length > 0) {\n config.plugins.push([\n expandMacrosPlugin,\n { macros: config.expandMacro },\n ]);\n }\n\n if (config.statsJson) {\n config.plugins.push([statsJsonPlugin]);\n }\n\n if (config.html) {\n config.plugins.push([unifiedLatexToHast]);\n config.plugins.push([prettyPrintHtmlPlugin]);\n }\n\n /**\n * Handle complete run.\n *\n * @type {EngineCallback}\n */\n const done: EngineCallback = function done(error, code, context) {\n if (error) {\n clean();\n fail(error);\n } else {\n exitStatus = code || 0;\n\n if (config.watch && !watcher && context) {\n subscribe(context);\n }\n }\n };\n\n // Clean the watcher.\n function clean() {\n if (watcher) {\n watcher.close();\n watcher = undefined;\n }\n }\n\n /**\n * Subscribe a chokidar watcher to all processed files.\n */\n function subscribe(context: EngineContext) {\n watcher = chokidar\n .watch(context.fileSet?.origins || [], {\n cwd: config.cwd,\n ignoreInitial: true,\n })\n .on(\"error\", done)\n .on(\"change\", (filePath) => {\n config.files = [filePath];\n engine(config, done);\n });\n\n process.on(\"SIGINT\", onsigint);\n\n /**\n * Handle a SIGINT.\n */\n function onsigint() {\n // Hide the `^C` in terminal.\n process.stderr.write(\"\\n\", noop);\n\n clean();\n\n // Do another process if `output` specified regeneration.\n if (output === true) {\n config.output = output;\n config.watch = false;\n engine(config, done);\n }\n }\n }\n\n // Initial run.\n engine(config, done);\n}\n\n/**\n * Print an error, optionally with stack.\n *\n * @param {Error} error\n * @param {boolean} [pretty=false]\n */\nfunction fail(error: Error, pretty?: boolean) {\n const message = String((pretty ? error : error.stack) || error);\n\n exitStatus = 1;\n\n process.stderr.write(message.trim() + \"\\n\", noop);\n}\n\nfunction onexit() {\n process.exit(exitStatus);\n}\n\nfunction noop() {}\n", "// Modified from unified-args https://github.com/unifiedjs/unified-args/blob/main/lib/index.js\n// MIT License\n\nimport table from \"text-table\";\nimport camelcase from \"camelcase\";\nimport minimist from \"minimist\";\nimport json5 from \"json5\";\nimport { fault } from \"fault\";\nimport { schema } from \"./schema\";\nimport type { Options as EngineOptions } from \"unified-engine\";\nimport type { Option } from \"./schema\";\nimport { PluggableList } from \"unified\";\nimport { availableLints } from \"../lints\";\nimport * as Ast from \"@unified-latex/unified-latex-types\";\nimport { parseMacroExpansion } from \"../macros/parse-macro-expansion\";\n\ntype RequiredEngineOptions = Required<\n Pick<\n EngineOptions,\n | \"extensions\"\n | \"ignoreName\"\n | \"packageField\"\n | \"pluginPrefix\"\n | \"processor\"\n | \"rcName\"\n >\n>;\n\ntype ArgsOptionsFields = {\n /**\n * Name of executable\n */\n name: string;\n /**\n * description of executable\n */\n description: string;\n /**\n * Version (semver) of executable\n */\n version: string;\n};\n\nexport type Options = RequiredEngineOptions &\n Pick<EngineOptions, \"cwd\"> &\n ArgsOptionsFields;\n\nconst own = {}.hasOwnProperty;\n\n/**\n * Schema for `minimist`.\n */\nconst minischema = {\n unknown: handleUnknownArgument,\n default: {} as Record<string, string | boolean | null>,\n alias: {} as Record<string, string>,\n string: [] as string[],\n boolean: [] as string[],\n};\n\nlet index = -1;\nwhile (++index < schema.length) {\n addEach(schema[index]);\n}\n\n/**\n * Parse CLI options.\n */\nexport function options(flags: string[], configuration: Options) {\n const extension = configuration.extensions[0];\n const name = configuration.name;\n const config = toCamelCase(minimist(flags, minischema));\n let index = -1;\n\n while (++index < schema.length) {\n const option = schema[index];\n if (option.type === \"string\" && config[option.long] === \"\") {\n throw fault(\"Missing value:%s\", inspect(option).join(\" \"));\n }\n }\n\n const ext = commaSeparated(config.ext as string | string[]);\n const report = reporter(config.report as string | string[]);\n const help = [\n inspectAll(schema),\n \"\",\n \"Examples:\",\n \"\",\n \" # Process `input.\" + extension + \"`\",\n \" $ \" + name + \" input.\" + extension + \" -o output.\" + extension,\n \"\",\n \" # Pipe\",\n \" $ \" + name + \" < input.\" + extension + \" > output.\" + extension,\n \"\",\n \" # Rewrite all applicable files\",\n \" $ \" + name + \" . -o\",\n \"\",\n \" # Lint files and display the lint output (but not the processed file)\",\n \" $ \" + name + \" . --lint-all --no-stdout\",\n ].join(\"\\n\");\n\n const settings = parseSettings(config.setting as string);\n\n if (config.html && config.statsJson) {\n throw new Error(\"Both --html and --stats-json were specified; only one may be used at a time.\");\n }\n\n return {\n helpMessage: help,\n cwd: configuration.cwd,\n processor: configuration.processor,\n help: config.help,\n version: config.version,\n files: config._,\n filePath: config.filePath,\n watch: config.watch,\n extensions: ext.length === 0 ? configuration.extensions : ext,\n output: config.output,\n out: config.stdout,\n tree: config.tree,\n treeIn: config.treeIn,\n treeOut: config.treeOut,\n inspect: config.inspect,\n rcName: configuration.rcName,\n packageField: configuration.packageField,\n rcPath: config.rcPath,\n detectConfig: config.config,\n settings,\n ignoreName: configuration.ignoreName,\n ignorePath: config.ignorePath,\n ignorePathResolveFrom: config.ignorePathResolveFrom,\n ignorePatterns: commaSeparated(config.ignorePattern as string),\n silentlyIgnore: config.silentlyIgnore,\n detectIgnore: config.ignore,\n pluginPrefix: configuration.pluginPrefix,\n plugins: [],\n lints: normalizeLints(config.lint as string | string[], config),\n reporter: report[0],\n reporterOptions: report[1],\n color: config.color,\n silent: config.silent,\n quiet: config.quiet,\n frail: config.frail,\n stats: config.stats,\n statsJson: config.statsJson,\n expandMacro: normalizeToArray(config.expandMacro as string).map(\n parseMacroExpansion\n ),\n macro: normalizeToArray(config.macro as string).map(\n parseMacroExpansion\n ),\n html: config.html,\n } as EngineOptions & {\n help: boolean;\n helpMessage: string;\n watch: boolean;\n version: boolean;\n lints: Record<string, Record<string, unknown> | undefined>;\n plugins: PluggableList;\n stats: boolean;\n statsJson: boolean;\n expandMacro: { name: string; signature: string; body: Ast.Node[] }[];\n macro: { name: string; signature: string }[];\n html: boolean;\n };\n}\n\nfunction addEach(option: Option) {\n const value = option.default;\n\n minischema.default[option.long] = value === undefined ? null : value;\n\n if (option.type && option.type in minischema) {\n minischema[option.type].push(option.long);\n }\n\n if (option.short) {\n minischema.alias[option.short] = option.long;\n }\n}\n\n/**\n * Parse `extensions`.\n */\nfunction commaSeparated(value: string[] | string | null | undefined): string[] {\n return normalizeToArray(value).flatMap((d) => splitOnComma(d));\n}\n\n/**\n * Parse `plugins`.\n */\nfunction plugins(value: string[] | string | null | undefined) {\n const normalized = normalizeToArray(value).map(splitOnEquals);\n let index = -1;\n const result: Record<string, Record<string, unknown> | undefined> = {};\n\n while (++index < normalized.length) {\n const value = normalized[index];\n result[value[0]] = value[1] ? parseConfig(value[1], {}) : undefined;\n }\n\n return result;\n}\n\n/**\n * Normalize the specified lints\n */\nfunction normalizeLints(\n value: string[] | string | null | undefined,\n config: Record<\"lintAll\" | \"fixAll\", unknown>\n) {\n const normalized = normalizeToArray(value).map(splitOnEquals);\n validateLintNames(normalized);\n if (config.lintAll) {\n normalized.push(...Object.keys(availableLints).map((v) => [v]));\n }\n\n const result: Record<string, Record<string, unknown> | undefined> =\n Object.fromEntries(\n normalized.map((value) => {\n let params = value[1] ? parseConfig(value[1], {}) : undefined;\n if (config.fixAll) {\n if (params) {\n Object.assign(params, { fix: true });\n } else {\n params = { fix: true };\n }\n }\n return [value[0], params];\n })\n );\n\n return result;\n}\n\n/**\n * Parse `reporter`: only one is accepted.\n */\nfunction reporter(value: string[] | string | null | undefined) {\n const all = normalizeToArray(value)\n .map(splitOnEquals)\n .map((value) => [\n value[0],\n value[1] ? parseConfig(value[1], {}) : undefined,\n ]);\n\n return all[all.length - 1] || [];\n}\n\n/**\n * Parse `settings`.\n */\nfunction parseSettings(\n value: string[] | string | null | undefined\n): Record<string, unknown> {\n const normalized = normalizeToArray(value);\n const cache: Record<string, unknown> = {};\n\n for (const value of normalized) {\n parseConfig(value, cache);\n }\n\n return cache;\n}\n\n/**\n * Parse configuration.\n */\nfunction parseConfig(\n value: string,\n cache: Record<string, unknown>\n): Record<string, unknown> {\n let flags: Record<string, unknown>;\n let flag: string;\n\n try {\n flags = toCamelCase(parseJSON(value));\n } catch (error) {\n const exception = error as Error;\n throw fault(\n \"Cannot parse `%s` as JSON: %s\",\n value,\n // Fix position\n exception.message.replace(/at(?= position)/, \"around\")\n );\n }\n\n for (flag in flags) {\n if (own.call(flags, flag)) {\n cache[flag] = flags[flag];\n }\n }\n\n return cache;\n}\n/**\n * Handle an unknown flag.\n */\nfunction validateLintNames(lints: string[][]): boolean {\n for (const lint of lints) {\n const name = lint[0];\n if (!availableLints[name]) {\n const known = Object.keys(availableLints);\n throw fault(\n \"Unknown lint rule `%s`, available rules are:\\n%s\",\n name,\n \"\\t\" + known.join(\"\\n\\t\")\n );\n }\n }\n\n return true;\n}\n\n/**\n * Handle an unknown flag.\n */\nfunction handleUnknownArgument(flag: string): boolean {\n // Not a glob.\n if (flag.charAt(0) === \"-\") {\n // Long options, always unknown.\n if (flag.charAt(1) === \"-\") {\n throw fault(\n \"Unknown option `%s`, expected:\\n%s\",\n flag,\n inspectAll(schema)\n );\n }\n\n // Short options, can be grouped.\n const found = flag.slice(1).split(\"\");\n const known = schema.filter((d) => d.short);\n const knownKeys = new Set(known.map((d) => d.short));\n let index = -1;\n\n while (++index < found.length) {\n const key = found[index];\n if (!knownKeys.has(key)) {\n throw fault(\n \"Unknown short option `-%s`, expected:\\n%s\",\n key,\n inspectAll(known)\n );\n }\n }\n }\n\n return true;\n}\n\n/**\n * Inspect all `options`.\n */\nfunction inspectAll(options: Option[]): string {\n return table(options.map((d) => inspect(d)));\n}\n\n/**\n * Inspect one `option`.\n */\nfunction inspect(option: Option): string[] {\n let description = option.description;\n let long = option.long;\n\n if (option.default === true || option.truelike) {\n description += \" (on by default)\";\n long = \"[no-]\" + long;\n }\n\n return [\n \"\",\n option.short ? \"-\" + option.short : \"\",\n \"--\" + long + (option.value ? \" \" + option.value : \"\"),\n description,\n ];\n}\n\n/**\n * Normalize `value`.\n */\nfunction normalizeToArray(\n value: string | string[] | null | undefined\n): string[] {\n if (!value) {\n return [];\n }\n\n if (typeof value === \"string\") {\n return [value];\n }\n\n return value;\n}\n\nfunction splitOnEquals(value: string) {\n return value.split(\"=\");\n}\n\nfunction splitOnComma(value: string) {\n return value.split(\",\");\n}\n\n/**\n * Transform the keys on an object to camel-case, recursively.\n */\nfunction toCamelCase(object: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n let key: string;\n\n for (key in object) {\n if (own.call(object, key)) {\n let value = object[key];\n\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n // @ts-expect-error: looks like an object.\n value = toCamelCase(value);\n }\n\n result[camelcase(key)] = value;\n }\n }\n\n return result;\n}\n\n/**\n * Parse a (lazy?) JSON config.\n */\nfunction parseJSON(value: string): Record<string, unknown> {\n return json5.parse(\"{\" + value + \"}\");\n}\n", "import { lints } from \"@unified-latex/unified-latex-lint\";\n\nexport const availableLints = Object.fromEntries(\n Object.values(lints).map((lint) => [\n lint.name.replace(/^unified-latex-lint:/, \"\"),\n lint,\n ])\n);\n", "// Modified from unified-args https://github.com/unifiedjs/unified-args/blob/main/lib/index.js\n// MIT License\n\nimport { availableLints } from \"../lints\";\n\nexport type Option = {\n long: string;\n description: string;\n value?: string;\n short?: string;\n default?: string | boolean;\n truelike?: boolean;\n type?: \"boolean\" | \"string\";\n};\n\nexport const schema: Option[] = [\n {\n long: \"help\",\n description: \"Output usage information\",\n short: \"h\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"version\",\n description: \"Output version number\",\n short: \"v\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"output\",\n description: \"Specify output location\",\n short: \"o\",\n value: \"[path]\",\n },\n {\n long: \"rc-path\",\n description: \"Specify configuration file\",\n short: \"r\",\n type: \"string\",\n value: \"<path>\",\n },\n {\n long: \"ignore-path\",\n description: \"Specify ignore file\",\n short: \"i\",\n type: \"string\",\n value: \"<path>\",\n },\n {\n long: \"ext\",\n description: \"Specify extensions\",\n type: \"string\",\n value: \"<extensions>\",\n },\n {\n long: \"lint\",\n description: `Lint rules to apply. Use multiple times to specify multiple lints. Available rules: ${Object.keys(\n availableLints\n ).join(\", \")}`,\n short: \"l\",\n type: \"string\",\n value: \"<rule>\",\n },\n {\n long: \"lint-all\",\n description: `Apply all available lint rules`,\n type: \"boolean\",\n default: false,\n },\n {\n long: \"fix-all\",\n description: \"Apply fixes for all applied lints\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"watch\",\n description: \"Watch for changes and reprocess\",\n short: \"w\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"macro\",\n description:\n \"Attach arguments of the specified macro (by default, unrecognized macros are parsed as having no arguments). Accepts a string of the form `\\\\newcommand{<name>}[<num args>]{<body>}` or a JSON string `{name: <name>, signature: <xparse argument signature>, body: <macro body>}`\",\n short: \"m\",\n type: \"string\",\n value: \"<rule>\",\n },\n {\n long: \"expand-macro\",\n description:\n \"Expand the specified macro. Accepts a string of the form `\\\\newcommand{<name>}[<num args>]{<body>}` or a JSON string `{name: <name>, signature: <xparse argument signature>, body: <macro body>}`\",\n short: \"e\",\n type: \"string\",\n value: \"<rule>\",\n },\n {\n long: \"frail\",\n description: \"Exit with 1 on warnings\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"tree\",\n description: \"Specify input and output as syntax tree\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"report\",\n description: \"Specify reporter\",\n type: \"string\",\n value: \"<reporter>\",\n },\n {\n long: \"file-path\",\n description: \"Specify path to process as\",\n type: \"string\",\n value: \"<path>\",\n },\n {\n long: \"ignore-path-resolve-from\",\n description:\n \"Resolve patterns in `ignore-path` from its directory or cwd\",\n type: \"string\",\n value: \"dir|cwd\",\n default: \"dir\",\n },\n {\n long: \"ignore-pattern\",\n description: \"Specify ignore patterns\",\n type: \"string\",\n value: \"<globs>\",\n },\n {\n long: \"silently-ignore\",\n description: \"Do not fail when given ignored files\",\n type: \"boolean\",\n },\n {\n long: \"tree-in\",\n description: \"Specify input as syntax tree\",\n type: \"boolean\",\n },\n {\n long: \"tree-out\",\n description: \"Output syntax tree\",\n type: \"boolean\",\n },\n {\n long: \"inspect\",\n description: \"Output formatted syntax tree\",\n type: \"boolean\",\n },\n {\n long: \"stats\",\n description: \"Show information about the processed file\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"stats-json\",\n description:\n \"Show information about the processed file and output the information as JSON\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"html\",\n description:\n \"Convert the output to HTML. Note, for math to render properly, you will need to add a library like MathJax or KaTeX to your HTMl source; you should also expand/replace any macros not recognized by the converter\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"stdout\",\n description: \"[Don't] write the processed file's contents to stdout\",\n type: \"boolean\",\n truelike: true,\n },\n {\n long: \"color\",\n description: \"Specify color in report\",\n type: \"boolean\",\n default: true,\n },\n {\n long: \"config\",\n description: \"Search for configuration files\",\n type: \"boolean\",\n default: true,\n },\n {\n long: \"ignore\",\n description: \"Search for ignore files\",\n type: \"boolean\",\n default: true,\n },\n];\n", "import json5 from \"json5\";\nimport * as Ast from \"@unified-latex/unified-latex-types\";\nimport {\n newcommandMacroToName,\n newcommandMacroToSpec,\n newcommandMacroToSubstitutionAst,\n} from \"@unified-latex/unified-latex-util-macros\";\nimport { parse } from \"@unified-latex/unified-latex-util-parse\";\n\n/**\n * Parse a macro specification given on the command line as either a \"\\newcommand\" string\n * or a JSON object specifying `name`, `signature`, and `body`.\n */\nexport function parseMacroExpansion(def: string): {\n name: string;\n signature: string;\n body: Ast.Node[];\n} {\n if (def.startsWith(\"\\\\\")) {\n const macro = parse(def).content[0] as Ast.Macro;\n const name = newcommandMacroToName(macro);\n if (!name) {\n // If there was no name specified, it must not have been a `\\newcommand` or other recognized macro\n throw new Error(\n `Could extract macro definition from \"${def}\"; expected the macro to be defined via \\\\newcommand or similar syntax`\n );\n }\n const signature = newcommandMacroToSpec(macro);\n const body = newcommandMacroToSubstitutionAst(macro);\n\n return { name, signature, body };\n }\n // If it wasn't specified via a `\\newcommand` macro, assume it's specified as JSON\n const parsedSpec = json5.parse(def);\n if (parsedSpec.name == null || parsedSpec.body == null) {\n throw new Error(\n `Expected a \"name\" field and a \"body\" field to be defined on ${def}`\n );\n }\n parsedSpec.signature = parsedSpec.signature || \"\";\n\n return {\n name: parsedSpec.name,\n signature: parsedSpec.signature,\n body: parse(parsedSpec.body).content,\n };\n}\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\nimport { listPackages } from \"@unified-latex/unified-latex-util-packages\";\nimport { listNewcommands } from \"@unified-latex/unified-latex-util-macros\";\nimport { printRaw } from \"@unified-latex/unified-latex-util-print-raw\";\nimport { Plugin } from \"unified\";\nimport { enclosingPosition } from \"./enclosing-position\";\n\n/**\n * Plugin that reports statistics on the contents of LaTeX files.\n */\nexport const statsPlugin: Plugin<void[], Ast.Root, Ast.Root> = function () {\n return (tree, file) => {\n const packages = listPackages(tree);\n const packageNames = packages.map((s) => printRaw(s));\n if (packages.length > 0) {\n file.info(\n `Found ${\n packages.length\n } imported packages: ${packageNames.join(\", \")}`\n );\n }\n\n const newcommands = listNewcommands(tree);\n if (newcommands.length > 0) {\n file.info(\n `Found ${newcommands.length} defined commands: ${newcommands\n .map((c) => `\\\\${c.name}`)\n .join(\", \")}`,\n enclosingPosition(newcommands.map((c) => c.definition))\n );\n }\n };\n};\n\n/**\n * Plugin that reports statistics on the contents of LaTeX files and replaces the file output with a JSON\n * representation of the statistics.\n */\nexport const statsJsonPlugin: Plugin<void[], Ast.Root, string> = function () {\n this.Compiler = (tree, file) => {\n file.extname = \".json\";\n file.basename += \"-stats\";\n\n const packages = listPackages(tree).map((s) => printRaw(s));\n const newcommands = listNewcommands(tree).map((c) => ({\n name: c.name,\n signature: c.signature,\n body: printRaw(c.body),\n definition: printRaw(c.definition),\n }));\n\n return JSON.stringify({ packages, newcommands }, null, 4) + \"\\n\";\n };\n};\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\n\ntype Position = { line: number; column: number; offset: number };\n\n/**\n * Find the smallest `position` object that contains all `nodes`.\n */\nexport function enclosingPosition(nodes: Ast.Node[]): {\n start: Position;\n end: Position;\n} {\n let start: Position = { line: 1, column: 1, offset: 0 };\n let end: Position = { line: 1, column: 1, offset: 0 };\n\n for (const node of nodes) {\n if (Number(node.position?.start.offset) < Number(start.offset)) {\n start = node.position?.start as Position;\n }\n if (Number(node.position?.end.offset) > Number(end.offset)) {\n end = node.position?.end as Position;\n }\n }\n\n return { start, end };\n}\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\nimport { expandMacros } from \"@unified-latex/unified-latex-util-macros\";\nimport { Plugin } from \"unified\";\nimport { attachMacroArgs } from \"@unified-latex/unified-latex-util-arguments\";\nimport { printRaw } from \"@unified-latex/unified-latex-util-print-raw\";\n\ntype PluginOptions = {\n macros: { name: string; signature: string; body: Ast.Node[] }[];\n};\n\n/**\n * Plugin that expands the specified macros.\n */\nexport const expandMacrosPlugin: Plugin<PluginOptions[], Ast.Root, Ast.Root> =\n function (options) {\n const { macros = [] } = options || {};\n const macroInfo = Object.fromEntries(\n macros.map((m) => [m.name, { signature: m.signature }])\n );\n return (tree) => {\n // We need to attach the arguments to each macro before we process it!\n attachMacroArgs(tree, macroInfo);\n expandMacros(tree, macros);\n };\n };\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\nimport { Plugin } from \"unified\";\nimport { attachMacroArgs } from \"@unified-latex/unified-latex-util-arguments\";\n\ntype PluginOptions = {\n macros: { name: string; signature: string }[];\n};\n\n/**\n * Plugin that attaches the arguments of the specified macros.\n */\nexport const attachMacroArgsPlugin: Plugin<\n PluginOptions[],\n Ast.Root,\n Ast.Root\n> = function (options) {\n const { macros = [] } = options || {};\n const macroInfo = Object.fromEntries(\n macros.map((m) => [m.name, { signature: m.signature }])\n );\n return (tree) => {\n // We need to attach the arguments to each macro before we process it!\n attachMacroArgs(tree, macroInfo);\n };\n};\n", "import { Root } from \"hastscript/lib/core\";\nimport rehypeStringify from \"rehype-stringify\";\nimport Prettier from \"prettier\";\nimport { Plugin, unified } from \"unified\";\n\n/**\n * Plugin that pretty-prints HTML.\n */\nexport const prettyPrintHtmlPlugin: Plugin<void[], Root, string> = function () {\n const processor = unified().use(rehypeStringify);\n this.Compiler = (tree, file) => {\n file.extname = \".html\";\n\n const html = processor.stringify(tree, file);\n try {\n return Prettier.format(html, { parser: \"html\", useTabs: true });\n } catch {}\n return html;\n };\n};\n", "import { processLatexViaUnified } from \"./libs/unified-latex\";\nimport { unifiedArgs } from \"./libs/unified-args\";\n\nunifiedArgs({\n processor: processLatexViaUnified,\n name: \"unified-latex\",\n description: \"LaTeX processor powered by unified-latex\",\n version: \"1.0.8\",\n extensions: [\"tex\"],\n ignoreName: \".unifiedlatexignore\",\n packageField: \"unifiedLatexConfig\",\n rcName: \".unifiedlatexrc\",\n pluginPrefix: \"@unified-latex/\",\n});\n\n// NOTE: The docstring comment must be the last item in the index.ts file!\n/**\n * ## What is this?\n *\n * Command line interface to common `unified-latex` functions.\n *\n * ## When should I use this?\n *\n * If you want to reformat, process, or gather statistic on LaTeX files from the command line.\n *\n * ## Examples\n *\n * Reformat and pretty-print a file\n *\n * ```bash\n * unified-latex input.tex -o output.tex\n * ```\n *\n * List all commands defined via `\\newcommand` and friends (and hide the file output).\n *\n * ```bash\n * unified-latex input.tex --no-stdout --stats\n * ```\n *\n * Expand the definition of the macro `\\foo{...}`, which takes one argument.\n *\n * ```bash\n * unified-latex input.tex -e \"\\\\newcommand{foo}[1]{FOO(#1)}\"\n * ```\n *\n * View the parsed AST.\n *\n * ```bash\n * unified-latex input.tex --inspect\n * ```\n *\n * Convert the file to HTML. (Note, you will need to include and configure a library like _MathJax_ or _KaTeX_ to render\n * any math in the resulting HTML. Warnings are provided for macros that aren't recognized by the converter.)\n *\n * ```bash\n * unified-latex input.tex -o output.html --html\n * ```\n *\n * Lint all tex files in the current directory and watch for changes.\n *\n * ```bash\n * unified-latex . --no-stdout --lint-all --watch\n * ```\n */\n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AO,MAAM,MAAM,IAAI;AAE/B,YAAM;AAGN,UAAI,WAAW,MAAM;AACjB,eAAO,SAAS;AAChB,eAAO,QAAQ;AACf,0CAAO,QAAQ,IAAI;AAAA,MACvB;AAAA,IACJ;AAAA,EACJ;AAGA,oCAAO,QAAQ,IAAI;AACvB;AAQA,cAAc,OAAc,QAAkB;AAC1C,QAAM,UAAU,OAAQ,UAAS,QAAQ,MAAM,UAAU,KAAK;AAE9D,eAAa;AAEb,8BAAQ,OAAO,MAAM,QAAQ,KAAK,IAAI,MAAM,IAAI;AACpD;AAEA,kBAAkB;AACd,8BAAQ,KAAK,UAAU;AAC3B;AAEA,gBAAgB;AAAC;;;AUxNjB,YAAY;AAAA,EACR,WAAW;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AAAA,EACT,YAAY,CAAC,KAAK;AAAA,EAClB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,cAAc;AAClB,CAAC;",
6
- "names": []
3
+ "sources": ["../libs/unified-latex.ts", "../libs/unified-args/index.ts", "../libs/unified-args/options.ts", "../libs/lints/index.ts", "../libs/unified-args/schema.ts", "../libs/macros/parse-macro-expansion.ts", "../libs/stats/index.ts", "../libs/stats/enclosing-position.ts", "../libs/macros/expand-macros-plugin.ts", "../libs/macros/attach-macro-args-plugin.ts", "../libs/html/format.ts", "../libs/macros/expand-document-macros-plugin.ts", "../index.ts"],
4
+ "sourcesContent": ["import { unified } from \"unified\";\nimport * as Ast from \"@unified-latex/unified-latex-types\";\nimport {\n unifiedLatexAstComplier,\n unifiedLatexFromString,\n} from \"@unified-latex/unified-latex-util-parse\";\nimport {\n unifiedLatexStringCompiler,\n PluginOptions as StringCompilerPluginOptions,\n} from \"@unified-latex/unified-latex-util-to-string\";\n/**\n * Use `unified()` to a string to an `Ast.Ast` and then pretty-print it.\n */\nexport const processLatexViaUnified = (\n options?: StringCompilerPluginOptions\n) => {\n return unified()\n .use(unifiedLatexFromString)\n .use(\n unifiedLatexStringCompiler,\n Object.assign({ pretty: true, forceNewlineEnding: true }, options)\n );\n};\n\n/**\n * Use `unified()` to a string to an `Ast.Ast` and then return it. This function\n * will not print/pretty-print the `Ast.Ast` back to a string.\n */\nexport const processLatexToAstViaUnified = () => {\n return unified().use(unifiedLatexFromString).use(unifiedLatexAstComplier);\n};\n", "// Modified from unified-args https://github.com/unifiedjs/unified-args/blob/main/lib/index.js\n// MIT License\n\nimport process from \"node:process\";\nimport stream from \"node:stream\";\nimport chalk from \"chalk\";\nimport chokidar, { FSWatcher } from \"chokidar\";\nimport {\n engine,\n Callback as EngineCallback,\n Context as EngineContext,\n} from \"unified-engine\";\nimport { unifiedLatexToHast } from \"@unified-latex/unified-latex-to-hast\";\nimport { options, Options } from \"./options\";\nimport { availableLints } from \"../lints\";\nimport { statsJsonPlugin, statsPlugin } from \"../stats\";\nimport { expandMacrosPlugin } from \"../macros/expand-macros-plugin\";\nimport { attachMacroArgsPlugin } from \"../macros/attach-macro-args-plugin\";\nimport { prettyPrintHtmlPlugin } from \"../html/format\";\nimport { expandDocumentMacrosPlugin } from \"../macros/expand-document-macros-plugin\";\n\n// Fake TTY stream.\nconst ttyStream = Object.assign(new stream.Readable(), { isTTY: true });\n\n// Exit, lazily, with the correct exit status code.\nlet exitStatus = 0;\n\nprocess.on(\"exit\", onexit);\n\n// Handle uncaught errors, such as from unexpected async behavior.\nprocess.on(\"uncaughtException\", fail);\n\n/**\n * Start the CLI.\n *\n * @param {Options} cliConfig\n */\nexport function unifiedArgs(cliConfig: Options) {\n let config: ReturnType<typeof options>;\n let watcher: FSWatcher | undefined;\n let output: boolean | string | undefined;\n\n try {\n config = options(process.argv.slice(2), cliConfig);\n } catch (error) {\n const exception = error as Error;\n return fail(exception, true);\n }\n\n if (config.help) {\n process.stdout.write(\n [\n \"Usage: \" + cliConfig.name + \" [options] [path | glob ...]\",\n \"\",\n \" \" + cliConfig.description,\n \"\",\n \"Options:\",\n \"\",\n config.helpMessage,\n \"\",\n ].join(\"\\n\"),\n noop\n );\n\n return;\n }\n\n if (config.version) {\n process.stdout.write(cliConfig.version + \"\\n\", noop);\n\n return;\n }\n\n // Modify `config` for watching.\n if (config.watch) {\n output = config.output;\n\n // Do not read from stdin(4).\n config.streamIn = ttyStream;\n\n // Do not write to stdout(4).\n config.out = false;\n\n process.stderr.write(\n chalk.bold(\"Watching...\") + \" (press CTRL+C to exit)\\n\",\n noop\n );\n\n // Prevent infinite loop if set to regeneration.\n if (output === true) {\n config.output = false;\n\n process.stderr.write(\n chalk.yellow(\"Note\") + \": Ignoring `--output` until exit.\\n\",\n noop\n );\n }\n }\n\n if (config.lints) {\n for (const [lintName, lintArgs] of Object.entries(config.lints)) {\n const lint = availableLints[lintName];\n if (!lint) {\n throw new Error(\n `Could not find lint named \"${lintName}\"; available lints are ${Object.keys(\n availableLints\n ).join(\", \")}`\n );\n }\n config.plugins.push([lint, lintArgs]);\n }\n }\n\n if (config.stats) {\n config.plugins.push([statsPlugin]);\n }\n\n if (config.macro.length > 0) {\n config.plugins.push([attachMacroArgsPlugin, { macros: config.macro }]);\n }\n\n if (config.expandMacro.length > 0) {\n config.plugins.push([\n expandMacrosPlugin,\n { macros: config.expandMacro },\n ]);\n }\n\n if (config.expandDocumentMacro.length > 0) {\n config.plugins.push([\n expandDocumentMacrosPlugin,\n { macros: config.expandDocumentMacro },\n ]);\n }\n\n if (config.statsJson) {\n config.plugins.push([statsJsonPlugin]);\n }\n\n if (config.html) {\n config.plugins.push([unifiedLatexToHast]);\n config.plugins.push([prettyPrintHtmlPlugin]);\n }\n\n /**\n * Handle complete run.\n *\n * @type {EngineCallback}\n */\n const done: EngineCallback = function done(error, code, context) {\n if (error) {\n clean();\n fail(error);\n } else {\n exitStatus = code || 0;\n\n if (config.watch && !watcher && context) {\n subscribe(context);\n }\n }\n };\n\n // Clean the watcher.\n function clean() {\n if (watcher) {\n watcher.close();\n watcher = undefined;\n }\n }\n\n /**\n * Subscribe a chokidar watcher to all processed files.\n */\n function subscribe(context: EngineContext) {\n watcher = chokidar\n .watch(context.fileSet?.origins || [], {\n cwd: config.cwd,\n ignoreInitial: true,\n })\n .on(\"error\", done)\n .on(\"change\", (filePath) => {\n config.files = [filePath];\n engine(config, done);\n });\n\n process.on(\"SIGINT\", onsigint);\n\n /**\n * Handle a SIGINT.\n */\n function onsigint() {\n // Hide the `^C` in terminal.\n process.stderr.write(\"\\n\", noop);\n\n clean();\n\n // Do another process if `output` specified regeneration.\n if (output === true) {\n config.output = output;\n config.watch = false;\n engine(config, done);\n }\n }\n }\n\n // Initial run.\n engine(config, done);\n}\n\n/**\n * Print an error, optionally with stack.\n *\n * @param {Error} error\n * @param {boolean} [pretty=false]\n */\nfunction fail(error: Error, pretty?: boolean) {\n const message = String((pretty ? error : error.stack) || error);\n\n exitStatus = 1;\n\n process.stderr.write(message.trim() + \"\\n\", noop);\n}\n\nfunction onexit() {\n process.exit(exitStatus);\n}\n\nfunction noop() {}\n", "// Modified from unified-args https://github.com/unifiedjs/unified-args/blob/main/lib/index.js\n// MIT License\n\nimport table from \"text-table\";\nimport camelcase from \"camelcase\";\nimport minimist from \"minimist\";\nimport json5 from \"json5\";\nimport { fault } from \"fault\";\nimport { schema } from \"./schema\";\nimport type { Options as EngineOptions } from \"unified-engine\";\nimport type { Option } from \"./schema\";\nimport { PluggableList } from \"unified\";\nimport { availableLints } from \"../lints\";\nimport * as Ast from \"@unified-latex/unified-latex-types\";\nimport { parseMacroExpansion } from \"../macros/parse-macro-expansion\";\n\ntype RequiredEngineOptions = Required<\n Pick<\n EngineOptions,\n | \"extensions\"\n | \"ignoreName\"\n | \"packageField\"\n | \"pluginPrefix\"\n | \"processor\"\n | \"rcName\"\n >\n>;\n\ntype ArgsOptionsFields = {\n /**\n * Name of executable\n */\n name: string;\n /**\n * description of executable\n */\n description: string;\n /**\n * Version (semver) of executable\n */\n version: string;\n};\n\nexport type Options = RequiredEngineOptions &\n Pick<EngineOptions, \"cwd\"> &\n ArgsOptionsFields;\n\nconst own = {}.hasOwnProperty;\n\n/**\n * Schema for `minimist`.\n */\nconst minischema = {\n unknown: handleUnknownArgument,\n default: {} as Record<string, string | boolean | null>,\n alias: {} as Record<string, string>,\n string: [] as string[],\n boolean: [] as string[],\n};\n\nlet index = -1;\nwhile (++index < schema.length) {\n addEach(schema[index]);\n}\n\n/**\n * Parse CLI options.\n */\nexport function options(flags: string[], configuration: Options) {\n const extension = configuration.extensions[0];\n const name = configuration.name;\n const config = toCamelCase(minimist(flags, minischema));\n let index = -1;\n\n while (++index < schema.length) {\n const option = schema[index];\n if (option.type === \"string\" && config[option.long] === \"\") {\n throw fault(\"Missing value:%s\", inspect(option).join(\" \"));\n }\n }\n\n const ext = commaSeparated(config.ext as string | string[]);\n const report = reporter(config.report as string | string[]);\n const help = [\n inspectAll(schema),\n \"\",\n \"Examples:\",\n \"\",\n \" # Process `input.\" + extension + \"`\",\n \" $ \" + name + \" input.\" + extension + \" -o output.\" + extension,\n \"\",\n \" # Pipe\",\n \" $ \" + name + \" < input.\" + extension + \" > output.\" + extension,\n \"\",\n \" # Rewrite all applicable files\",\n \" $ \" + name + \" . -o\",\n \"\",\n \" # Lint files and display the lint output (but not the processed file)\",\n \" $ \" + name + \" . --lint-all --no-stdout\",\n ].join(\"\\n\");\n\n const settings = parseSettings(config.setting as string);\n\n if (config.html && config.statsJson) {\n throw new Error(\n \"Both --html and --stats-json were specified; only one may be used at a time.\"\n );\n }\n\n return {\n helpMessage: help,\n cwd: configuration.cwd,\n processor: configuration.processor,\n help: config.help,\n version: config.version,\n files: config._,\n filePath: config.filePath,\n watch: config.watch,\n extensions: ext.length === 0 ? configuration.extensions : ext,\n output: config.output,\n out: config.stdout,\n tree: config.tree,\n treeIn: config.treeIn,\n treeOut: config.treeOut,\n inspect: config.inspect,\n rcName: configuration.rcName,\n packageField: configuration.packageField,\n rcPath: config.rcPath,\n detectConfig: config.config,\n settings,\n ignoreName: configuration.ignoreName,\n ignorePath: config.ignorePath,\n ignorePathResolveFrom: config.ignorePathResolveFrom,\n ignorePatterns: commaSeparated(config.ignorePattern as string),\n silentlyIgnore: config.silentlyIgnore,\n detectIgnore: config.ignore,\n pluginPrefix: configuration.pluginPrefix,\n plugins: [],\n lints: normalizeLints(config.lint as string | string[], config),\n reporter: report[0],\n reporterOptions: report[1],\n color: config.color,\n silent: config.silent,\n quiet: config.quiet,\n frail: config.frail,\n stats: config.stats,\n statsJson: config.statsJson,\n expandMacro: normalizeToArray(config.expandMacro as string).map(\n parseMacroExpansion\n ),\n expandDocumentMacro: normalizeToArray(\n config.expandDocumentMacro as string\n ),\n macro: normalizeToArray(config.macro as string).map(\n parseMacroExpansion\n ),\n html: config.html,\n } as EngineOptions & {\n help: boolean;\n helpMessage: string;\n watch: boolean;\n version: boolean;\n lints: Record<string, Record<string, unknown> | undefined>;\n plugins: PluggableList;\n stats: boolean;\n statsJson: boolean;\n expandMacro: { name: string; signature: string; body: Ast.Node[] }[];\n expandDocumentMacro: string[];\n macro: { name: string; signature: string }[];\n html: boolean;\n };\n}\n\nfunction addEach(option: Option) {\n const value = option.default;\n\n minischema.default[option.long] = value === undefined ? null : value;\n\n if (option.type && option.type in minischema) {\n minischema[option.type].push(option.long);\n }\n\n if (option.short) {\n minischema.alias[option.short] = option.long;\n }\n}\n\n/**\n * Parse `extensions`.\n */\nfunction commaSeparated(value: string[] | string | null | undefined): string[] {\n return normalizeToArray(value).flatMap((d) => splitOnComma(d));\n}\n\n/**\n * Parse `plugins`.\n */\nfunction plugins(value: string[] | string | null | undefined) {\n const normalized = normalizeToArray(value).map(splitOnEquals);\n let index = -1;\n const result: Record<string, Record<string, unknown> | undefined> = {};\n\n while (++index < normalized.length) {\n const value = normalized[index];\n result[value[0]] = value[1] ? parseConfig(value[1], {}) : undefined;\n }\n\n return result;\n}\n\n/**\n * Normalize the specified lints\n */\nfunction normalizeLints(\n value: string[] | string | null | undefined,\n config: Record<\"lintAll\" | \"fixAll\", unknown>\n) {\n const normalized = normalizeToArray(value).map(splitOnEquals);\n validateLintNames(normalized);\n if (config.lintAll) {\n normalized.push(...Object.keys(availableLints).map((v) => [v]));\n }\n\n const result: Record<string, Record<string, unknown> | undefined> =\n Object.fromEntries(\n normalized.map((value) => {\n let params = value[1] ? parseConfig(value[1], {}) : undefined;\n if (config.fixAll) {\n if (params) {\n Object.assign(params, { fix: true });\n } else {\n params = { fix: true };\n }\n }\n return [value[0], params];\n })\n );\n\n return result;\n}\n\n/**\n * Parse `reporter`: only one is accepted.\n */\nfunction reporter(value: string[] | string | null | undefined) {\n const all = normalizeToArray(value)\n .map(splitOnEquals)\n .map((value) => [\n value[0],\n value[1] ? parseConfig(value[1], {}) : undefined,\n ]);\n\n return all[all.length - 1] || [];\n}\n\n/**\n * Parse `settings`.\n */\nfunction parseSettings(\n value: string[] | string | null | undefined\n): Record<string, unknown> {\n const normalized = normalizeToArray(value);\n const cache: Record<string, unknown> = {};\n\n for (const value of normalized) {\n parseConfig(value, cache);\n }\n\n return cache;\n}\n\n/**\n * Parse configuration.\n */\nfunction parseConfig(\n value: string,\n cache: Record<string, unknown>\n): Record<string, unknown> {\n let flags: Record<string, unknown>;\n let flag: string;\n\n try {\n flags = toCamelCase(parseJSON(value));\n } catch (error) {\n const exception = error as Error;\n throw fault(\n \"Cannot parse `%s` as JSON: %s\",\n value,\n // Fix position\n exception.message.replace(/at(?= position)/, \"around\")\n );\n }\n\n for (flag in flags) {\n if (own.call(flags, flag)) {\n cache[flag] = flags[flag];\n }\n }\n\n return cache;\n}\n/**\n * Handle an unknown flag.\n */\nfunction validateLintNames(lints: string[][]): boolean {\n for (const lint of lints) {\n const name = lint[0];\n if (!availableLints[name]) {\n const known = Object.keys(availableLints);\n throw fault(\n \"Unknown lint rule `%s`, available rules are:\\n%s\",\n name,\n \"\\t\" + known.join(\"\\n\\t\")\n );\n }\n }\n\n return true;\n}\n\n/**\n * Handle an unknown flag.\n */\nfunction handleUnknownArgument(flag: string): boolean {\n // Not a glob.\n if (flag.charAt(0) === \"-\") {\n // Long options, always unknown.\n if (flag.charAt(1) === \"-\") {\n throw fault(\n \"Unknown option `%s`, expected:\\n%s\",\n flag,\n inspectAll(schema)\n );\n }\n\n // Short options, can be grouped.\n const found = flag.slice(1).split(\"\");\n const known = schema.filter((d) => d.short);\n const knownKeys = new Set(known.map((d) => d.short));\n let index = -1;\n\n while (++index < found.length) {\n const key = found[index];\n if (!knownKeys.has(key)) {\n throw fault(\n \"Unknown short option `-%s`, expected:\\n%s\",\n key,\n inspectAll(known)\n );\n }\n }\n }\n\n return true;\n}\n\n/**\n * Inspect all `options`.\n */\nfunction inspectAll(options: Option[]): string {\n return table(options.map((d) => inspect(d)));\n}\n\n/**\n * Inspect one `option`.\n */\nfunction inspect(option: Option): string[] {\n let description = option.description;\n let long = option.long;\n\n if (option.default === true || option.truelike) {\n description += \" (on by default)\";\n long = \"[no-]\" + long;\n }\n\n return [\n \"\",\n option.short ? \"-\" + option.short : \"\",\n \"--\" + long + (option.value ? \" \" + option.value : \"\"),\n description,\n ];\n}\n\n/**\n * Normalize `value`.\n */\nfunction normalizeToArray(\n value: string | string[] | null | undefined\n): string[] {\n if (!value) {\n return [];\n }\n\n if (typeof value === \"string\") {\n return [value];\n }\n\n return value;\n}\n\nfunction splitOnEquals(value: string) {\n return value.split(\"=\");\n}\n\nfunction splitOnComma(value: string) {\n return value.split(\",\");\n}\n\n/**\n * Transform the keys on an object to camel-case, recursively.\n */\nfunction toCamelCase(object: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n let key: string;\n\n for (key in object) {\n if (own.call(object, key)) {\n let value = object[key];\n\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n // @ts-expect-error: looks like an object.\n value = toCamelCase(value);\n }\n\n result[camelcase(key)] = value;\n }\n }\n\n return result;\n}\n\n/**\n * Parse a (lazy?) JSON config.\n */\nfunction parseJSON(value: string): Record<string, unknown> {\n return json5.parse(\"{\" + value + \"}\");\n}\n", "import { lints } from \"@unified-latex/unified-latex-lint\";\n\nexport const availableLints = Object.fromEntries(\n Object.values(lints).map((lint) => [\n lint.name.replace(/^unified-latex-lint:/, \"\"),\n lint,\n ])\n);\n", "// Modified from unified-args https://github.com/unifiedjs/unified-args/blob/main/lib/index.js\n// MIT License\n\nimport { availableLints } from \"../lints\";\n\nexport type Option = {\n long: string;\n description: string;\n value?: string;\n short?: string;\n default?: string | boolean;\n truelike?: boolean;\n type?: \"boolean\" | \"string\";\n};\n\nexport const schema: Option[] = [\n {\n long: \"help\",\n description: \"Output usage information\",\n short: \"h\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"version\",\n description: \"Output version number\",\n short: \"v\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"output\",\n description: \"Specify output location\",\n short: \"o\",\n value: \"[path]\",\n },\n {\n long: \"rc-path\",\n description: \"Specify configuration file\",\n short: \"r\",\n type: \"string\",\n value: \"<path>\",\n },\n {\n long: \"ignore-path\",\n description: \"Specify ignore file\",\n short: \"i\",\n type: \"string\",\n value: \"<path>\",\n },\n {\n long: \"ext\",\n description: \"Specify extensions\",\n type: \"string\",\n value: \"<extensions>\",\n },\n {\n long: \"lint\",\n description: `Lint rules to apply. Use multiple times to specify multiple lints. Available rules: ${Object.keys(\n availableLints\n ).join(\", \")}`,\n short: \"l\",\n type: \"string\",\n value: \"<rule>\",\n },\n {\n long: \"lint-all\",\n description: `Apply all available lint rules`,\n type: \"boolean\",\n default: false,\n },\n {\n long: \"fix-all\",\n description: \"Apply fixes for all applied lints\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"watch\",\n description: \"Watch for changes and reprocess\",\n short: \"w\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"macro\",\n description:\n \"Attach arguments of the specified macro (by default, unrecognized macros are parsed as having no arguments). Accepts a string of the form `\\\\newcommand{<name>}[<num args>]{<body>}` or a JSON string `{name: <name>, signature: <xparse argument signature>, body: <macro body>}`\",\n short: \"m\",\n type: \"string\",\n value: \"<rule>\",\n },\n {\n long: \"expand-macro\",\n description:\n \"Expand the specified macro. Accepts a string of the form `\\\\newcommand{<name>}[<num args>]{<body>}` or a JSON string `{name: <name>, signature: <xparse argument signature>, body: <macro body>}`\",\n short: \"e\",\n type: \"string\",\n value: \"<rule>\",\n },\n {\n long: \"expand-document-macro\",\n description:\n \"Expand the specified macro which is defined in the document. You can use --stats to list all macros defined in the document.\",\n short: \"d\",\n type: \"string\",\n value: \"<name>\"\n },\n {\n long: \"frail\",\n description: \"Exit with 1 on warnings\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"tree\",\n description: \"Specify input and output as syntax tree\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"report\",\n description: \"Specify reporter\",\n type: \"string\",\n value: \"<reporter>\",\n },\n {\n long: \"file-path\",\n description: \"Specify path to process as\",\n type: \"string\",\n value: \"<path>\",\n },\n {\n long: \"ignore-path-resolve-from\",\n description:\n \"Resolve patterns in `ignore-path` from its directory or cwd\",\n type: \"string\",\n value: \"dir|cwd\",\n default: \"dir\",\n },\n {\n long: \"ignore-pattern\",\n description: \"Specify ignore patterns\",\n type: \"string\",\n value: \"<globs>\",\n },\n {\n long: \"silently-ignore\",\n description: \"Do not fail when given ignored files\",\n type: \"boolean\",\n },\n {\n long: \"tree-in\",\n description: \"Specify input as syntax tree\",\n type: \"boolean\",\n },\n {\n long: \"tree-out\",\n description: \"Output syntax tree\",\n type: \"boolean\",\n },\n {\n long: \"inspect\",\n description: \"Output formatted syntax tree\",\n type: \"boolean\",\n },\n {\n long: \"stats\",\n description: \"Show information about the processed file\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"stats-json\",\n description:\n \"Show information about the processed file and output the information as JSON\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"html\",\n description:\n \"Convert the output to HTML. Note, for math to render properly, you will need to add a library like MathJax or KaTeX to your HTMl source; you should also expand/replace any macros not recognized by the converter\",\n type: \"boolean\",\n default: false,\n },\n {\n long: \"stdout\",\n description: \"[Don't] write the processed file's contents to stdout\",\n type: \"boolean\",\n truelike: true,\n },\n {\n long: \"color\",\n description: \"Specify color in report\",\n type: \"boolean\",\n default: true,\n },\n {\n long: \"config\",\n description: \"Search for configuration files\",\n type: \"boolean\",\n default: true,\n },\n {\n long: \"ignore\",\n description: \"Search for ignore files\",\n type: \"boolean\",\n default: true,\n },\n];\n", "import json5 from \"json5\";\nimport * as Ast from \"@unified-latex/unified-latex-types\";\nimport {\n newcommandMacroToName,\n newcommandMacroToSpec,\n newcommandMacroToSubstitutionAst,\n} from \"@unified-latex/unified-latex-util-macros\";\nimport { parse } from \"@unified-latex/unified-latex-util-parse\";\n\n/**\n * Parse a macro specification given on the command line as either a \"\\newcommand\" string\n * or a JSON object specifying `name`, `signature`, and `body`.\n */\nexport function parseMacroExpansion(def: string): {\n name: string;\n signature: string;\n body: Ast.Node[];\n} {\n if (def.startsWith(\"\\\\\")) {\n const macro = parse(def).content[0] as Ast.Macro;\n const name = newcommandMacroToName(macro);\n if (!name) {\n // If there was no name specified, it must not have been a `\\newcommand` or other recognized macro\n throw new Error(\n `Could extract macro definition from \"${def}\"; expected the macro to be defined via \\\\newcommand or similar syntax`\n );\n }\n const signature = newcommandMacroToSpec(macro);\n const body = newcommandMacroToSubstitutionAst(macro);\n\n return { name, signature, body };\n }\n // If it wasn't specified via a `\\newcommand` macro, assume it's specified as JSON\n const parsedSpec = json5.parse(def);\n if (parsedSpec.name == null || parsedSpec.body == null) {\n throw new Error(\n `Expected a \"name\" field and a \"body\" field to be defined on ${def}`\n );\n }\n parsedSpec.signature = parsedSpec.signature || \"\";\n\n return {\n name: parsedSpec.name,\n signature: parsedSpec.signature,\n body: parse(parsedSpec.body).content,\n };\n}\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\nimport { listPackages } from \"@unified-latex/unified-latex-util-packages\";\nimport { listNewcommands } from \"@unified-latex/unified-latex-util-macros\";\nimport { printRaw } from \"@unified-latex/unified-latex-util-print-raw\";\nimport { Plugin } from \"unified\";\nimport { enclosingPosition } from \"./enclosing-position\";\n\n/**\n * Plugin that reports statistics on the contents of LaTeX files.\n */\nexport const statsPlugin: Plugin<void[], Ast.Root, Ast.Root> = function () {\n return (tree, file) => {\n const packages = listPackages(tree);\n const packageNames = packages.map((s) => printRaw(s));\n if (packages.length > 0) {\n file.info(\n `Found ${\n packages.length\n } imported packages: ${packageNames.join(\", \")}`\n );\n }\n\n const newcommands = listNewcommands(tree);\n if (newcommands.length > 0) {\n file.info(\n `Found ${newcommands.length} defined commands: ${newcommands\n .map((c) => `\\\\${c.name}`)\n .join(\", \")}`,\n enclosingPosition(newcommands.map((c) => c.definition))\n );\n }\n };\n};\n\n/**\n * Plugin that reports statistics on the contents of LaTeX files and replaces the file output with a JSON\n * representation of the statistics.\n */\nexport const statsJsonPlugin: Plugin<void[], Ast.Root, string> = function () {\n this.Compiler = (tree, file) => {\n file.extname = \".json\";\n file.basename += \"-stats\";\n\n const packages = listPackages(tree).map((s) => printRaw(s));\n const newcommands = listNewcommands(tree).map((c) => ({\n name: c.name,\n signature: c.signature,\n body: printRaw(c.body),\n definition: printRaw(c.definition),\n }));\n\n return JSON.stringify({ packages, newcommands }, null, 4) + \"\\n\";\n };\n};\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\n\ntype Position = { line: number; column: number; offset: number };\n\n/**\n * Find the smallest `position` object that contains all `nodes`.\n */\nexport function enclosingPosition(nodes: Ast.Node[]): {\n start: Position;\n end: Position;\n} {\n let start: Position = { line: 1, column: 1, offset: 0 };\n let end: Position = { line: 1, column: 1, offset: 0 };\n\n for (const node of nodes) {\n if (Number(node.position?.start.offset) < Number(start.offset)) {\n start = node.position?.start as Position;\n }\n if (Number(node.position?.end.offset) > Number(end.offset)) {\n end = node.position?.end as Position;\n }\n }\n\n return { start, end };\n}\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\nimport {\n expandMacros,\n expandMacrosExcludingDefinitions,\n} from \"@unified-latex/unified-latex-util-macros\";\nimport { Plugin } from \"unified\";\nimport { attachMacroArgs } from \"@unified-latex/unified-latex-util-arguments\";\n\ntype PluginOptions = {\n macros: { name: string; signature: string; body: Ast.Node[] }[];\n};\n\n/**\n * Plugin that expands the specified macros.\n */\nexport const expandMacrosPlugin: Plugin<PluginOptions[], Ast.Root, Ast.Root> =\n function (options) {\n const { macros = [] } = options || {};\n const macroInfo = Object.fromEntries(\n macros.map((m) => [m.name, { signature: m.signature }])\n );\n return (tree) => {\n // We need to attach the arguments to each macro before we process it!\n attachMacroArgs(tree, macroInfo);\n expandMacros(tree, macros);\n };\n };\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\nimport { Plugin } from \"unified\";\nimport { attachMacroArgs } from \"@unified-latex/unified-latex-util-arguments\";\n\ntype PluginOptions = {\n macros: { name: string; signature: string }[];\n};\n\n/**\n * Plugin that attaches the arguments of the specified macros.\n */\nexport const attachMacroArgsPlugin: Plugin<\n PluginOptions[],\n Ast.Root,\n Ast.Root\n> = function (options) {\n const { macros = [] } = options || {};\n const macroInfo = Object.fromEntries(\n macros.map((m) => [m.name, { signature: m.signature }])\n );\n return (tree) => {\n // We need to attach the arguments to each macro before we process it!\n attachMacroArgs(tree, macroInfo);\n };\n};\n", "import { Root } from \"hastscript/lib/core\";\nimport rehypeStringify from \"rehype-stringify\";\nimport Prettier from \"prettier\";\nimport { Plugin, unified } from \"unified\";\n\n/**\n * Plugin that pretty-prints HTML.\n */\nexport const prettyPrintHtmlPlugin: Plugin<void[], Root, string> = function () {\n const processor = unified().use(rehypeStringify);\n this.Compiler = (tree, file) => {\n file.extname = \".html\";\n\n const html = processor.stringify(tree, file);\n try {\n return Prettier.format(html, { parser: \"html\", useTabs: true });\n } catch {}\n return html;\n };\n};\n", "import * as Ast from \"@unified-latex/unified-latex-types\";\nimport {\n expandMacros,\n expandMacrosExcludingDefinitions,\n listNewcommands,\n} from \"@unified-latex/unified-latex-util-macros\";\nimport { Plugin } from \"unified\";\nimport { attachMacroArgs } from \"@unified-latex/unified-latex-util-arguments\";\n\ntype PluginOptions = {\n macros?: string[];\n};\n\n/**\n * Plugin that expands the specified macros by name. These macros must be defined in the document via\n * `\\newcommand...` or equivalent.\n */\nexport const expandDocumentMacrosPlugin: Plugin<\n PluginOptions[],\n Ast.Root,\n Ast.Root\n> = function (options) {\n const { macros = [] } = options || {};\n const macrosSet = new Set(macros);\n\n return (tree) => {\n const newcommands = listNewcommands(tree);\n const macros = newcommands.filter((s) => macrosSet.has(s.name));\n\n const macroInfo = Object.fromEntries(\n macros.map((m) => [m.name, { signature: m.signature }])\n );\n // We need to attach the arguments to each macro before we process it!\n attachMacroArgs(tree, macroInfo);\n expandMacrosExcludingDefinitions(tree, macros);\n };\n};\n", "import { processLatexViaUnified } from \"./libs/unified-latex\";\nimport { unifiedArgs } from \"./libs/unified-args\";\nimport fs from \"node:fs\";\n\nlet version = \"unknown (could not read version from package.json)\";\ntry {\n // Read the version dynamically on startup\n type PackageJson = { version: string };\n const packageJson: PackageJson = JSON.parse(\n fs.readFileSync(new URL(\"./package.json\", import.meta.url), {\n encoding: \"utf8\",\n })\n );\n version = packageJson.version;\n} catch {}\n\nunifiedArgs({\n processor: processLatexViaUnified,\n name: \"unified-latex\",\n description: \"LaTeX processor powered by unified-latex\",\n version,\n extensions: [\"tex\"],\n ignoreName: \".unifiedlatexignore\",\n packageField: \"unifiedLatexConfig\",\n rcName: \".unifiedlatexrc\",\n pluginPrefix: \"@unified-latex/\",\n});\n\n// NOTE: The docstring comment must be the last item in the index.ts file!\n/**\n * ## What is this?\n *\n * Command line interface to common `unified-latex` functions.\n *\n * ## When should I use this?\n *\n * If you want to reformat, process, or gather statistic on LaTeX files from the command line.\n *\n * ## Examples\n *\n * Reformat and pretty-print a file\n *\n * ```bash\n * unified-latex input.tex -o output.tex\n * ```\n *\n * List all commands defined via `\\newcommand` and friends (and hide the file output).\n *\n * ```bash\n * unified-latex input.tex --no-stdout --stats\n * ```\n *\n * Expand the definition of the macro `\\foo{...}`, which takes one argument.\n *\n * ```bash\n * unified-latex input.tex -e \"\\\\newcommand{foo}[1]{FOO(#1)}\"\n * ```\n *\n * View the parsed AST.\n *\n * ```bash\n * unified-latex input.tex --inspect\n * ```\n *\n * Convert the file to HTML. (Note, you will need to include and configure a library like _MathJax_ or _KaTeX_ to render\n * any math in the resulting HTML. Warnings are provided for macros that aren't recognized by the converter.)\n *\n * ```bash\n * unified-latex input.tex -o output.html --html\n * ```\n *\n * Lint all tex files in the current directory and watch for changes.\n *\n * ```bash\n * unified-latex . --no-stdout --lint-all --watch\n * ```\n */\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA,qBAAwB;AAExB,sCAGO;AACP,0CAGO;AAIA,IAAM,yBAAyB,CAClCA,aACC;AACD,aAAO,wBAAQ,EACV,IAAI,sDAAsB,EAC1B;AAAA,IACG;AAAA,IACA,OAAO,OAAO,EAAE,QAAQ,MAAM,oBAAoB,KAAK,GAAGA,QAAO;AAAA,EACrE;AACR;;;ACnBA,0BAAoB;AACpB,yBAAmB;AACnB,mBAAkB;AAClB,sBAAoC;AACpC,4BAIO;AACP,mCAAmC;;;ACTnC,wBAAkB;AAClB,uBAAsB;AACtB,sBAAqB;AACrB,IAAAC,gBAAkB;AAClB,mBAAsB;;;ACPtB,gCAAsB;AAEf,IAAM,iBAAiB,OAAO;AAAA,EACjC,OAAO,OAAO,+BAAK,EAAE,IAAI,CAAC,SAAS;AAAA,IAC/B,KAAK,KAAK,QAAQ,wBAAwB,EAAE;AAAA,IAC5C;AAAA,EACJ,CAAC;AACL;;;ACQO,IAAM,SAAmB;AAAA,EAC5B;AAAA,IACI,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,EACb;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,EACb;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,IACP,OAAO;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;AAAA,EACR,WAAW;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AAAA,EACb;AAAA,EACA,YAAY,CAAC,KAAK;AAAA,EAClB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,cAAc;AAClB,CAAC;",
6
+ "names": ["options", "import_json5", "import_unified_latex_util_parse", "json5", "minimist", "index", "value", "lints", "index", "options", "table", "camelcase", "json5", "import_unified_latex_util_macros", "import_unified_latex_util_macros", "options", "import_unified_latex_util_arguments", "options", "import_unified", "rehypeStringify", "Prettier", "import_unified_latex_util_macros", "import_unified_latex_util_arguments", "options", "macros", "stream", "process", "chalk", "done", "chokidar", "fs"]
7
7
  }