# md-exec **Repository Path**: linuxsuren/md-exec ## Basic Information - **Project Name**: md-exec - **Description**: 让 Markdown 格式的教程、文档变得可执行,成为基于命令行终端的交互式教程。 - **Primary Language**: Go - **License**: MIT - **Default Branch**: master - **Homepage**: https://github.com/linuxsuren/md-exec/ - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2023-02-16 - **Last Updated**: 2023-09-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Codacy Badge](https://app.codacy.com/project/badge/Grade/5022a74d146f487581821fd1c3435437)](https://www.codacy.com/gh/LinuxSuRen/md-exec/dashboard?utm_source=github.com&utm_medium=referral&utm_content=LinuxSuRen/md-exec&utm_campaign=Badge_Grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/5022a74d146f487581821fd1c3435437)](https://www.codacy.com/gh/LinuxSuRen/md-exec/dashboard?utm_source=github.com&utm_medium=referral&utm_content=LinuxSuRen/md-exec&utm_campaign=Badge_Coverage) ## Usage `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` ```shell #!title: Print ip info ifconfig ``` ### Variable input support In some use cases, we need to change the variables or command line flags. Try the following demo: ```shell #!title: Variable Input Hello World name=linuxsuren echo hello $name ``` ### Run in long time ```shell #!title: Run long time for i in 1 2 3 4 5 do echo $i sleep 1 done ``` ### Run Python Script ```python3 #!title: Python Hello World print('hello python world'); ``` ## Run Golang ```golang #!title: Golang Hello World fmt.Println("hello golang") items := []int{1,2,3,4} for _, item := range items { fmt.Println(item) } ``` ## Limitation Please make sure the Markdown files meet Linux end-of-line. You could turn it via: `dos2unix your.md`