Skip to content
sombriksPublic

About

run bash scripts from markdown files

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

48 Commits

Folders and files

Repository files navigation

npm Node.js CI MIT

echo "Run bash scripts inside markdown files!"

Installing

npm -g i mdexec

Run with npx if you prefer:

npx mdexec

Usage

Run the first bash script contained in a README.md file in current directory:

mdexec 0

List all scripts from README.md:

mdexec 
# or mdexec -l

Pass directory where to run and markdown file name, run the 4th script:

mdexec -f steps/intro.md -d ../example -s 3

Run mdexec -h for more details.

Why

Sometimes documentation also offers a command to execute.

Would be nice exec such scripts from terminal.

Some IDE's already offers to execute scripts.

How

Add some script blocks in your markdown document:

# Obi-Wan jumps
echo "Hello there!"
# Grievous salutes
echo "General Kenobi!"
for i in `ls`
do
  echo $i
done

Then mdexec will present them:

## How
[0]:
# Obi-Wan jumps
echo "Hello there!"
[1]:
# Grievous salutes
echo "General Kenobi!"
[2]:
for i in `ls`
do
  echo $i
done

What about other shells

echo "for now,"
echo "only bash is supported"

Further reading

About

run bash scripts from markdown files

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages