From 59a6487d997c911d958ad9a798a4d1cacc93c3f8 Mon Sep 17 00:00:00 2001 From: Noelle Calliope <1581674+mekanoe@users.noreply.github.com> Date: Sun, 1 Oct 2023 03:25:34 -0400 Subject: [PATCH] generate readme too --- README.md | 20 +++++++++++--------- generators/README.md.template | 17 +++++++++++++++++ generators/generate.js | 14 ++++++++++++-- package.json | 2 +- 4 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 generators/README.md.template diff --git a/README.md b/README.md index f043af5..7ccb324 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,17 @@ # noeidelon -To install dependencies: +Foxes dream of electron beams. -```bash -bun install -``` +https://art.mekanoe.com -To run: +## Development -```bash -bun run . -``` +`nix` to install bun... or do it globally. -This project was created using `bun init` in bun v1.0.3. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. +`bun run .` to generate HTMLs + +`bun serve` to serve them locally + +## Artworks + +- [./001-platform-provenance](https://art.mekanoe.com/001-platform-provenance) diff --git a/generators/README.md.template b/generators/README.md.template new file mode 100644 index 0000000..3c0e7c0 --- /dev/null +++ b/generators/README.md.template @@ -0,0 +1,17 @@ +# noeidelon + +Foxes dream of electron beams. + +https://art.mekanoe.com + +## Development + +`nix` to install bun... or do it globally. + +`bun run .` to generate HTMLs + +`bun serve` to serve them locally + +## Artworks + + diff --git a/generators/generate.js b/generators/generate.js index 5f04ecf..0ee938a 100644 --- a/generators/generate.js +++ b/generators/generate.js @@ -10,6 +10,7 @@ for (const htmlFile of allHtmls) { const indexTemplate = await Bun.file("generators/index.html.template").text(); const workTemplate = await Bun.file("generators/work.html.template").text(); +const readmeTemplate = await Bun.file("generators/README.md.template").text(); const allWorks = globSync("html/*.js") .map((file) => file.replace("html/", "").replace(".js", "")) @@ -27,7 +28,16 @@ const index = indexTemplate.replace( "", allWorks.map((work) => `
  • ./${work}
  • `).join("\n") ); - await Bun.write("html/index.html", index); -console.log(`index.html generated. ${allWorks.length} works found.`); +const readme = readmeTemplate.replace( + //, + allWorks + .map((work) => `- [./${work}](https://art.mekanoe.com/${work})`) + .join("\n") +); +await Bun.write("README.md", readme); + +console.log( + `index.html & README.md generated. ${allWorks.length} works found.` +); diff --git a/package.json b/package.json index 958196a..ee54cb8 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "noeidelon", "type": "module", + "main": "./generators/generate.js", "scripts": { - "start": "bun ./generators/generate.js", "serve": "serve ./html" }, "devDependencies": {