Commit 27e50bc
Changed files (4)
examples/markdown.md → docs/markdown.md
@@ -1,7 +1,13 @@
# Markdown Scripts
It's possible to write scripts using markdown. Only code blocks will be executed
-by zx. Try to run `zx examples/markdown.md`.
+by zx.
+
+> You can run this markdown file:
+>
+> ```
+> zx docs/markdown.md
+> ```
```js
await $`whoami`
examples/pipelines.md → docs/pipelines.md
@@ -1,6 +1,10 @@
# Pipelines
-> You can run this markdown file: `zx examples/pipelines.md`
+> You can run this markdown file:
+>
+> ```
+> zx docs/pipelines.md
+> ```
The `zx` supports Node.js streams and special `pipe()` method can be used to
redirect stdout.
README.md
@@ -110,7 +110,7 @@ The `pipe()` method can be used to redirect stdout:
await $`cat file.txt`.pipe(process.stdout)
```
-Read more about [pipelines](examples/pipelines.md).
+Read more about [pipelines](docs/pipelines.md).
#### `ProcessOutput`
@@ -343,10 +343,10 @@ module.
#### Markdown scripts
The `zx` can execute scripts written in markdown
-([examples/markdown.md](examples/markdown.md)):
+([docs/markdown.md](docs/markdown.md)):
```bash
-zx examples/markdown.md
+zx docs/markdown.md
```
#### TypeScript scripts
test.mjs
@@ -90,7 +90,7 @@ import path from 'path'
}
{ // Markdown scripts are working
- await $`node zx.mjs examples/markdown.md`
+ await $`node zx.mjs docs/markdown.md`
}
{ // TypeScript scripts are working
@@ -98,7 +98,7 @@ import path from 'path'
}
{ // Quiet mode is working
- let {stdout} = await $`node zx.mjs --quiet examples/markdown.md`
+ let {stdout} = await $`node zx.mjs --quiet docs/markdown.md`
assert(!stdout.includes('whoami'))
}