mirror of
https://github.com/vesan/obsidian-table-beautifier.git
synced 2026-07-22 06:53:19 +00:00
Parses ASCII (+/-/|) and Unicode (┌─┬─┐│├┼┤└┴┘) table formats from CLI tool output and converts them to properly formatted Markdown pipe tables. Identifier-like cell values are auto-wrapped in backticks. Available via right-click context menu and command palette.
24 lines
502 B
JavaScript
24 lines
502 B
JavaScript
import esbuild from "esbuild";
|
|
import process from "process";
|
|
|
|
const production = process.argv[2] === "production";
|
|
|
|
const context = await esbuild.context({
|
|
entryPoints: ["src/main.ts"],
|
|
bundle: true,
|
|
external: ["obsidian"],
|
|
format: "cjs",
|
|
target: "es2018",
|
|
logLevel: "info",
|
|
sourcemap: production ? false : "inline",
|
|
treeShaking: true,
|
|
outfile: "main.js",
|
|
minify: production,
|
|
});
|
|
|
|
if (production) {
|
|
await context.rebuild();
|
|
process.exit(0);
|
|
} else {
|
|
await context.watch();
|
|
}
|