An open API service indexing awesome lists of open source software.

https://github.com/goto-bus-stop/md-insert

insert content under a markdown header or into a comment delimited region
https://github.com/goto-bus-stop/md-insert

Last synced: 3 months ago
JSON representation

insert content under a markdown header or into a comment delimited region

Awesome Lists containing this project

README

        

# md-insert

insert content under a markdown header or into a comment delimited region

with a cli!

[Install](#install) [![npm][npm-image]][npm-url] - [Usage](#usage) - [License: Apache-2.0](#license)

[npm-image]: https://img.shields.io/npm/v/md-insert.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/md-insert

## Install

```
npm install md-insert
```

## Usage

```bash
$ md-insert
usage: md-insert [--header name] [--region name] [-i]

--header name Insert content under the header with this name.
--region name Insert content under the comment-delimited region with this
name.

-i Update in place. If given, the result is written to ,
instead of to standard output.

Examples:

md-insert -i README.md --header API < generated-doc.md

make-toc README.md | md-insert -i README.md --region toc

document-prop-types src/index.js | md-insert TEMPLATE.md --header Props > README.md
```

### Regions

`--region` inserts content into a comment-delimited region like this:

```md

```

```bash
md-insert FILE.md -i --region toc < TOC.md
```

```md

contents of TOC.md

```

### Headers

`--header` inserts content below a header like this:

```md
## Props
```

```bash
document-prop-types src/index.js | md-insert README.md -i --header Props
```

## License

[Apache-2.0](LICENSE.md)