Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjirou/embed-examples
Embed examples into README.md
https://github.com/kjirou/embed-examples
Last synced: about 1 month ago
JSON representation
Embed examples into README.md
- Host: GitHub
- URL: https://github.com/kjirou/embed-examples
- Owner: kjirou
- License: mit
- Created: 2019-01-26T06:47:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-31T07:35:23.000Z (over 3 years ago)
- Last Synced: 2024-12-07T16:37:39.530Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/embed-examples
- Size: 46.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# embed-examples
[![npm version](https://badge.fury.io/js/embed-examples.svg)](https://badge.fury.io/js/embed-examples)
[![Build Status](https://travis-ci.org/kjirou/embed-examples.svg?branch=master)](https://travis-ci.org/kjirou/embed-examples)Embed examples into README.md
## :rocket: Installation
```bash
npm install -g embed-examples
```## :eyes: Overview
Thie module embeds examples into README.md.
For example, put the following file ...
`my-lib/README.md`)
```
# my-lib```
`my-lib/examples/foo.js`)
```
const myLib = require('my-lib');
myLib.doSomething();
```Executing the following command ...
```bash
embed-examples -o ./README.md
```README.md is updated as follows!
`my-lib/README.md`)
````
# my-lib```
const myLib = require('my-lib');
myLib.doSomething();
```````
## :scroll: Usage
```bash
embed-examples [OPTIONS] README_PATH
```- `README_PATH`
- Relative path to the README.md
- `OPTIONS`
- `--examples-dir $VALUE`, `-e`
- Base path for finding examples
- **Default**: A directory path where README.md is located
- `--newline-character $VALUE`, `-n`
- Newline character used in markdown. However, do not change the sources of examples.
- The value is `"LF"`, `"CR"` or `"CRLF"`
- **Default**: `"LF"`
- `--overwrite`, `-o`
- Directly rewrite README.md with path specified
- **Default**: Disabled
- `--replacement $VALUE`, `-r`
- Keywords to replace. Represent value in the form of `from,to`.
- Can specify more than one like `-r keyword1,replacement1 -r keyword2,replacement2`
- **Default**: None