1.0.2 • Published 8 years ago

mdast-contributors v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

mdast-contributors

npm.io npm.io npm.io npm.io

mdast-contributors has been renamed to remark-contributors in light of mdast's rename to remark.

mdast plugin to inject a given list of contributors into a table in a markdown file.

Safe to be run on your README.md file before each commit without creating unnecessary noise!

Usage

NPM

Used as a plugin for mdast like so:

const plugin = require('mdast-contributors')
const mdast  = require('mdast')

readme = mdast.use(plugin, {
  contributors: [
    {
      name: 'Hugh Kennedy',
      twitter: 'hughskennedy',
      github: 'hughsk'
    }
  ]
}).process(readme)

This will add a "Contributors" section to your document if one is not already present. If one is present, a list of contributors will be added to that section.

For example, the following input markdown:

# My Readme

Hello World!

Would yield:

# My Readme

Hello World!

## Contributors

| Name             | GitHub                              | Twitter                                           |
| ---------------- | ----------------------------------- | ------------------------------------------------- |
| **Hugh Kennedy** | [hughsk](https://github.com/hughsk) | [@hughskennedy](https://twitter.com/hughskennedy) |

Any other text in the contributors section will still be preserved, so you can still include appreciative personal gratitude of your choosing.

options.contributors

Required. An array of contributors, each with the following properties:

  • name: the preferred name of the contributor.
  • github: the GitHub account of the contributor.
  • twitter: the Twitter account of the contributor, with or without an @.

License

MIT. See LICENSE.md for details.

Contributors

NameGitHubTwitter
Hugh Kennedyhughsk@hughskennedy