Skip to content

Latest commit

 

History

History
executable file
·
42 lines (31 loc) · 627 Bytes

markdown.md

File metadata and controls

executable file
·
42 lines (31 loc) · 627 Bytes

Markdown Scripts

It's possible to write scripts using markdown. Only code blocks will be executed by yzx.

You can run this markdown file:

yzx docs/markdown.md
await $`whoami`
await $`echo ${__dirname}`

We can use imports here as well:

const chalk = (await import("chalk")).default

The __filename will be pointed to markdown.md:

console.log(chalk.yellowBright(__filename))

A bash code (with bash or sh language tags) also will be executed:

VAR=$(date)
echo "$VAR" | wc -c

Other code blocks are ignored:

body .hero {
  margin: 42px;
}