READMEscript

🙋👁️📃👁️💻

“If you can read it. You can run it!”


goals

A README that is:

readme goals

Although running this example section would cause an infinite loop!

design

A block can be written like this:

```bash
echo 'hi'
```

and the READMEscript would understand that this is to be run in a bash shell… but unlike a normal bash script with comments, it has nicely rendered human-readable markdown text around it.

But in order to run a bash script it would need to have something like mingw or docker on the target machine if it’s not running some linux distro with bash available. Perhaps there’s no getting away from requiring docker here.

Perhaps it’s therefore better to use node (assuming the user installed readmescript using npm) and javascript for the script blocks? (with a few of the boilerplate stuff like FS imported?). eg.

console.log('hi');

Bash could also be the default behaviour for when you don’t tag any a code block with any language at all:

```
echo 'hi'
```

why?

often you get a readme that tells you what to do

usually in a bulleted list like the above, but if something is to be written down to be done manually, it may as well be written to be runnable as well.

why not just use python? (or some other simple cross-platform language?)

why not just use another build system, or a Makefile?

boundaries?

What should go in the READMEscript codeblocks?

It makes sense to put entrypoint code in the READMEscript, but at what point does this entrypoint code become configuration code? (better suited to go in its own script file, or config file, Dockerfile…)