markmac
TypeScript icon, indicating that this package has built-in type declarations

0.1.659 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i markmac

Weekly Downloads

435

Version

0.1.659

License

Apache-2.0

Unpacked Size

25.2 kB

Total Files

11

Last publish

Collaborators

  • eladb
  • cdklabs-automation