markdown-exec

1.0.2 • Public • Published

Markdown Exec - Execute commands in your Markdown and keep the output.

Installation

yarn add markdown-exec --global

or

npm install markdown-exec --global




Usage

The markdown-exec command takes one single argument: a file containing XML Comment API's annotations.

markdown-exec ./README.md

The command will process the content of the given file and will search for XML comments that has the following format:

<!-- markdown-exec() --><!-- /markdown-exec -->

Specify command to execute

Before:

<!-- markdown-exec(cmd:echo '123') --><!-- /markdown-exec -->

After:

<!-- markdown-exec(cmd:echo '123') -->123<!-- /markdown-exec -->

Use a regular expression to reduce the command output

Before:

<!-- markdown-exec(cmd:echo 'test123', match:\d+) --><!-- /markdown-exec -->

After:

<!-- markdown-exec(cmd:echo 'test123', match:\d+) -->123<!-- /markdown-exec -->

Tests

  • yarn test - run all tests once.
  • yarn test -- --watch - run all tests and watch for changes.

Development

To start contributing to this project, please do:

  1. Fork and clone this repo.
  2. Do your work.
  3. Create a PR.

Releases

To release this project the following tasks should be done:

  1. Using np: np




Made with ❤️ by Rubens Mariuzzo.

MIT License

Package Sidebar

Install

npm i markdown-exec

Weekly Downloads

10

Version

1.0.2

License

MIT

Last publish

Collaborators

  • rmariuzzo