Interactively select and execute code blocks in markdown files. Build complex scripts by naming and requiring blocks.

Programming language: Ruby
License: MIT License
Latest version: v0.1.0

MarkdownExec alternatives and similar gems

Based on the "Markdown Processors" category.
Alternatively, view markdown_exec alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of MarkdownExec or a related project?

Add another 'Markdown Processors' Gem



This gem allows you to interactively select and run code blocks in markdown files.

  • Code blocks can be named.

  • Named blocks can be required by other blocks.

  • The selected code block, and all required blocks, are arranged in the order they appear in the markdown file.

  • The resulting code is presented for approval prior to execution.



$ gem install markdown_exec


mde --help Displays help information.

mde Process README.md file in the current directory. Displays all the blocks in the file and allows you to select using [up], [down], and [return]. Press [ctrl]-c to abort selection.

mde -f my.md Process my.md file in the current directory.

mde -p child Process markdown files in the child directory.

mde --list-blocks List all blocks in the selected files.

mde --list-docs List all markdown documents in the selected folder.

Example blocks

When prompted, select either the awake or asleep block. The standard output confirms which required were blocks were included. Naming "hidden" blocks with parentheses "(" and ")" is a convention used here to re-inforce the purpose of the named blocks.

# block named "(day)", required by other blocks
export MYTIME=early
# block named "(night)", required by other blocks
export MYTIME=late

``` :awake +(day) +(report)

block named "awake", select to see result

export ACTIVITY=awake

``` :asleep +(night) +(report)
# block named "asleep", select to see result
export ACTIVITY=asleep
# block named "(report)", required by other blocks
echo "time: $MYTIME, activity: $ACTIVITY"


The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the MarkdownExec project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

*Note that all licence references and agreements mentioned in the MarkdownExec README section above are relevant to that project's source code only.