unified

Project:remarkjs/remark-contributors

Package:remark-contributors@4.0.1

  1. Dependencies:4·Dependents:6
  2. remark plugin to inject a given list of contributors into a table
  1. remark 165
  2. unified 132
  3. plugin 88
  4. markdown 82
  5. mdast 68
  6. contributors 2
  7. generation 2
  8. inject 2
  9. automatic 2

remark-contributors

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to inject a given list of contributors into a table.

Install

npm:

npm install remark-contributors

Use

Say we have the following file, example.md:

# Example

Some text.

## Contributors

## License

MIT

And our script, example.js, looks as follows:

var vfile = require('to-vfile')
var remark = require('remark')
var contributors = require('remark-contributors')

remark()
  .use(contributors)
  .process(vfile.readSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

# Example

Some text.

## Contributors

| Name                | Website                     |
| ------------------- | --------------------------- |
| **Hugh Kennedy**    | <https://hughsk.io>         |
| **Titus Wormer**    | <https://wooorm.com>        |
| **Vincent Weevers** | <https://vincentweevers.nl> |
| **Nick Baugh**      | <https://niftylettuce.com>  |

## License

MIT

API

remark().use(contributors[, options])

Inject a given list of contributors.

Options
options.contributors

List of contributors to inject (Array.<Object>). Defaults to the contributors field in the package.json, if there is one. Supports the string form (name <email> (url)) as well. Fails if no contributors are found or given.

options.align

Alignment to use for all cells in the table (left, right, center, default: null).

options.appendIfMissing

Inject the section if there is none (boolean, default: false).

options.formatters

Map of fields found in contributors to formatters (Object.<Formatter>). These given formatters extend the default formatters.

The keys in formatters should correspond directly (case-sensitive) to keys in contributors.

The values can be:

Formatters have the following properties:

Notes

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

Contributors

NameWebsite
Hugh Kennedyhttps://hughsk.io
Titus Wormerhttps://wooorm.com
Vincent Weevershttps://vincentweevers.nl
Nick Baughhttps://niftylettuce.com

License

MIT © Hugh Kennedy