markmac

Embed program outputs in markdown

Showing:

Popularity

Downloads/wk

278

GitHub Stars

7

Maintenance

Last Commit

2d ago

Contributors

11

Package

Dependencies

0

License

Apache-2.0

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

markmac

Markdown macros - embed program outputs in markdown

Let's say I have a markdown file test.md which looks like this:

# Hello, World

This is _just markdown_.

## Current date is:

<!-- <macro exec="date +%x"> -->
<!-- </macro> -->

## Current time is:

<!-- <macro exec="date +%R"> -->
<!-- </macro> -->

If I pipe it through markmac, the macro commands will be executed and their STDOUT will be embedded between <macro> and </macro>.

$ cat test.md | markmac
# Hello, World

This is _just markdown_.

## Current date is:

<!-- <macro exec="date +%x"> -->
10/07/2020
<!-- </macro> -->

## Current time is:

<!-- <macro exec="date +%R"> -->
15:48
<!-- </macro> -->

markmac searches for the <macro> directives inside your markdown file, executes the command in exec and substitutes the contents between <macro> and </macro> with STDOUT.

Installation

This program is distributed via npm, so it can be installed through yarn or npm or any other supporting client:

npm i -g markmac

License

Apache 2.0

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100