This markdown-magic will list out the contributors of your repository.
npm i markdown-magic markdown-magic-github-contributors --save-dev/* generate-docs.js */
const fs = require('fs')
const path = require('path')
const markdownMagic = require('markdown-magic')
const config = {
transforms: {
CONTRIBUTORS: require('markdown-magic-github-contributors')
}
}
const markdownPath = path.join(__dirname, 'README.md')
markdownMagic(markdownPath, config)<!-- ⛔️ AUTO-GENERATED-CONTENT:START (CONTRIBUTORS) -->
table will be placed here
<!-- ⛔️ AUTO-GENERATED-CONTENT:END -->This is an option step but will allow you to generate docs easily with npm run docs
"scripts": {
"docs": "node generate-docs.js",
}repo (string) (optional) - username/repoName. Will use the current working directory git remote origin as a default.
format (string) (optional) - Default is table. possible values: list, aligned, & table. See example
You can configure the plugin when required in as a tranform. This will apply to all instances of the <!-- ⛔️ AUTO-GENERATED-CONTENT (CONTRIBUTORS) --> comment, unless overriden inline.
const fs = require('fs')
const path = require('path')
const markdownMagic = require('markdown-magic')
const config = {
transforms: {
CONTRIBUTORS: require('markdown-magic-github-contributors')({
format: 'list'
})
}
}
const markdownPath = path.join(__dirname, 'README.md')
markdownMagic(markdownPath, config)You can override global config settings with inline options like so:
<!-- ⛔️ AUTO-GENERATED-CONTENT:START (CONTRIBUTORS:format=list) -->
table will be placed here
<!-- ⛔️ AUTO-GENERATED-CONTENT:END -->Many thanks to jonschlinkert and his github-contributors package that powers this under the hood.