https://github.com/mkdoc/mkref
Link reference collation
https://github.com/mkdoc/mkref
Last synced: about 1 year ago
JSON representation
Link reference collation
- Host: GitHub
- URL: https://github.com/mkdoc/mkref
- Owner: mkdoc
- License: other
- Archived: true
- Created: 2016-03-18T06:01:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-18T09:05:10.000Z (about 10 years ago)
- Last Synced: 2025-04-14T09:19:26.835Z (about 1 year ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Link References
[](https://travis-ci.org/mkdoc/mkref)
[](https://npmjs.org/package/mkref)
[](https://coveralls.io/github/mkdoc/mkref?branch=master)
> Collect link references
Collates link references from all documents in the stream and flushes a paragraph with the link references at the end of the stream.
## Install
```
npm i mkref --save
```
For the command line interface install [mkdoc][] globally (`npm i -g mkdoc`).
---
- [Install](#install)
- [Usage](#usage)
- [Example](#example)
- [Help](#help)
- [API](#api)
- [ref](#ref)
- [Options](#options)
- [License](#license)
---
## Usage
Create the stream and write a [commonmark][] document:
```javascript
var ref = require('mkref')
, ast = require('mkast');
ast.src('[example]: http://example.com')
.pipe(ref())
.pipe(ast.stringify({indent: 2}))
.pipe(process.stdout);
```
## Example
Collate link references:
```shell
mkcat README.md | mkref | mkout
```
## Help
```
Usage: mkref [options]
Link reference collation.
Options
-h, --help Display help and exit
--version Print the version and exit
mkref@1.0.8
```
## API
### ref
```javascript
ref([opts][, cb])
```
Gets the link reference collation stream.
Returns an output stream.
* `opts` Object processing options.
* `cb` Function callback function.
#### Options
* `input` Readable input stream.
* `output` Writable output stream.
## License
MIT
---
Created by [mkdoc](https://github.com/mkdoc/mkdoc) on April 18, 2016
[mkdoc]: https://github.com/mkdoc/mkdoc
[mkparse]: https://github.com/mkdoc/mkparse
[commonmark]: http://commonmark.org
[jshint]: http://jshint.com
[jscs]: http://jscs.info