- Support to run
shell
,python
,Golang
, andGroovy
- Load multiple Markdown files
md-exec
could exec the commands in the Markdown files.
For instance, it will execute those commands which in Markdown block via mde README.md
#!title: Print ip info
ifconfig
Run in different shells:
#!title: Run in zsh
readlink /proc/$$/exe
#!title: Run in dash
readlink /proc/$$/exe
In some use cases, we need to change the variables or command line flags. Try the following demo:
#!title: Variable Input Hello World
name=linuxsuren
echo hello $name
#!title: Run long time
for i in 1 2 3 4 5
do
echo $i
sleep 1
done
#!title: Python Hello World
print('hello python world');
#!title: Golang Hello World
fmt.Println("hello golang")
items := []int{1,2,3,4}
for _, item := range items {
fmt.Println(item)
}
#!title: Groovy Hello World
class Foo {
void hello(){
println "hello"
}
}
new Foo().hello()
Please make sure the Markdown files meet Linux end-of-line.
You could turn it via: dos2unix your.md