generate readme too
This commit is contained in:
parent
1da90f397b
commit
59a6487d99
4 changed files with 41 additions and 12 deletions
20
README.md
20
README.md
|
@ -1,15 +1,17 @@
|
||||||
# noeidelon
|
# noeidelon
|
||||||
|
|
||||||
To install dependencies:
|
Foxes dream of electron beams.
|
||||||
|
|
||||||
```bash
|
https://art.mekanoe.com
|
||||||
bun install
|
|
||||||
```
|
|
||||||
|
|
||||||
To run:
|
## Development
|
||||||
|
|
||||||
```bash
|
`nix` to install bun... or do it globally.
|
||||||
bun run .
|
|
||||||
```
|
|
||||||
|
|
||||||
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)
|
||||||
|
|
17
generators/README.md.template
Normal file
17
generators/README.md.template
Normal file
|
@ -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
|
||||||
|
|
||||||
|
<!--/INSERT/-->
|
|
@ -10,6 +10,7 @@ for (const htmlFile of allHtmls) {
|
||||||
|
|
||||||
const indexTemplate = await Bun.file("generators/index.html.template").text();
|
const indexTemplate = await Bun.file("generators/index.html.template").text();
|
||||||
const workTemplate = await Bun.file("generators/work.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")
|
const allWorks = globSync("html/*.js")
|
||||||
.map((file) => file.replace("html/", "").replace(".js", ""))
|
.map((file) => file.replace("html/", "").replace(".js", ""))
|
||||||
|
@ -27,7 +28,16 @@ const index = indexTemplate.replace(
|
||||||
"<!--/INSERT/-->",
|
"<!--/INSERT/-->",
|
||||||
allWorks.map((work) => `<li><a href="/${work}">./${work}</a></li>`).join("\n")
|
allWorks.map((work) => `<li><a href="/${work}">./${work}</a></li>`).join("\n")
|
||||||
);
|
);
|
||||||
|
|
||||||
await Bun.write("html/index.html", index);
|
await Bun.write("html/index.html", index);
|
||||||
|
|
||||||
console.log(`index.html generated. ${allWorks.length} works found.`);
|
const readme = readmeTemplate.replace(
|
||||||
|
/<!--\/INSERT\/-->/,
|
||||||
|
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.`
|
||||||
|
);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "noeidelon",
|
"name": "noeidelon",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"main": "./generators/generate.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "bun ./generators/generate.js",
|
|
||||||
"serve": "serve ./html"
|
"serve": "serve ./html"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue