{"id":15652614,"url":"https://github.com/linuxsuren/md-exec","last_synced_at":"2025-04-30T20:09:06.749Z","repository":{"id":65852643,"uuid":"600760609","full_name":"LinuxSuRen/md-exec","owner":"LinuxSuRen","description":"Run commands or scripts which in Markdown files","archived":false,"fork":false,"pushed_at":"2023-03-03T00:52:34.000Z","size":59,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T20:08:50.789Z","etag":null,"topics":["markdown"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LinuxSuRen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-12T14:19:43.000Z","updated_at":"2024-06-06T21:45:32.000Z","dependencies_parsed_at":"2023-06-06T10:00:30.522Z","dependency_job_id":null,"html_url":"https://github.com/LinuxSuRen/md-exec","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fmd-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fmd-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fmd-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fmd-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinuxSuRen","download_url":"https://codeload.github.com/LinuxSuRen/md-exec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251774896,"owners_count":21641731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown"],"created_at":"2024-10-03T12:42:51.826Z","updated_at":"2025-04-30T20:09:06.716Z","avatar_url":"https://github.com/LinuxSuRen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://app.codacy.com/project/badge/Grade/5022a74d146f487581821fd1c3435437)](https://www.codacy.com/gh/LinuxSuRen/md-exec/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=LinuxSuRen/md-exec\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/5022a74d146f487581821fd1c3435437)](https://www.codacy.com/gh/LinuxSuRen/md-exec/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=LinuxSuRen/md-exec\u0026utm_campaign=Badge_Coverage)\n![GitHub All Releases](https://img.shields.io/github/downloads/linuxsuren/md-exec/total)\n\n## Feature\n\n* Support to run `shell`, `python`, `Golang`, and `Groovy`\n* Load multiple Markdown files\n\n## Usage\n`md-exec` could exec the commands in the Markdown files.\nFor instance, it will execute those commands which in Markdown block via `mde README.md`\n\n```shell\n#!title: Print ip info\nifconfig\n```\n\nRun in different shells:\n```zsh\n#!title: Run in zsh\nreadlink /proc/$$/exe\n```\n\n```dash\n#!title: Run in dash\nreadlink /proc/$$/exe\n```\n\n### Variable input support\nIn some use cases, we need to change the variables or command line flags. Try the following demo:\n\n```shell\n#!title: Variable Input Hello World\nname=linuxsuren\necho hello $name\n```\n\n### Run in long time\n```shell\n#!title: Run long time\nfor i in 1 2 3 4 5\ndo\n    echo $i\n    sleep 1\ndone\n```\n\n### Run Python Script\n```python3\n#!title: Python Hello World\nprint('hello python world');\n```\n\n## Run Golang\n```golang\n#!title: Golang Hello World\nfmt.Println(\"hello golang\")\n\nitems := []int{1,2,3,4}\nfor _, item := range items {\n    fmt.Println(item)\n}\n```\n\n## Run Groovy\n```groovy\n#!title: Groovy Hello World\nclass Foo {\n    void hello(){\n        println \"hello\"\n    }\n}\nnew Foo().hello()\n```\n\n## Limitation\nPlease make sure the Markdown files meet Linux end-of-line.\nYou could turn it via: `dos2unix your.md`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxsuren%2Fmd-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxsuren%2Fmd-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxsuren%2Fmd-exec/lists"}