diff --git a/script-meta-v2.json b/script-meta-v2.json index db530a8..1f16ea8 100644 --- a/script-meta-v2.json +++ b/script-meta-v2.json @@ -340,12 +340,12 @@ }, "update-cheatsheet.ts": { "script_name": "update-cheatsheet.ts", - "script_length": 2439, - "script_sha256": "bbc770f85c80d26399ee7f8bd891b856e4c713bdc5f91756966015957d91ceb2", + "script_length": 2927, + "script_sha256": "a7d02932f1684134b3123a757f517614000bbecfd722967345e49eb718688a63", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/update-cheatsheet.ts", "single_script_file": true, "publish_time": 1775925235458, - "update_time": 1775925277732 + "update_time": 1775925939859 }, "upper.ts": { "script_name": "upper.ts", diff --git a/single-scripts/update-cheatsheet.ts b/single-scripts/update-cheatsheet.ts index 1af3799..4128baa 100755 --- a/single-scripts/update-cheatsheet.ts +++ b/single-scripts/update-cheatsheet.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -A -import { parse } from "jsr:@std/yaml"; +import {parse} from "jsr:@std/yaml"; import { existsPath, exit, @@ -37,6 +37,22 @@ async function main(): Promise { }); await writeStringToFile("meta.json", JSON.stringify(metas, null, 4)); + + let md = []; + md.push("# cheatsheet"); + md.push(""); + + md.push("| Name | Alias | URL | Description |"); + md.push("| ----- | ----- | ----- | ----- |"); + for (const meta of metas) { + md.push( + `| ${meta.name} | ${ + meta.aliases ? meta.aliases : "-" + } | [${meta.name}/CHEATSHEET.md](${meta.name}/CHEATSHEET.md) | ${meta.description} |`, + ); + } + md.push(""); + await writeStringToFile("README.md", md.join("\n")); } interface CheatSheetMeta {