Mdx – Execute Your Markdown Code Blocks, Now in Go

Reading Time: 1 minute

mdx – Execute your Markdown Code Blocks

Imagine you have the following Markdown file to document your commands:

# demo.md
## [simple_echo]() – Simple echo in shell

“`sh
echo “hello world”
“`

With mdx you execute the sh code block:

% mdx simple_echo
hello world

🚀 In a nutshell:

Pass arguments into your code block. ➔ Example

Define dependencies ➔ Example

supports shebangs in code block ➔ Example

parses all .md files in the CWD for potential commands

list all commands using -list or -l

➔ Usage

Getting started

Installation

You can simply download a binary which fits your operating system and achitecture from the releases page.

Then just use the demo.md from above to execute simple_echo.

Build

Go should be installed on your system: Follow this guide to install go in your PATH.

$ git clone https://github.com/dim0x69/mdx
$ go build
$ go install

Resources

The idea for this project came from Makedown.

Article Source




Information contained on this page is provided by an independent third-party content provider. This website makes no warranties or representations in connection therewith. If you are affiliated with this page and would like it removed please contact editor @cedarcity.business

Skip to content