generate README.md from documented code
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-readmejs --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('readmejs');
README-CUSTOM.md generated by this plugin.
In your project's Gruntfile, add a section named readmejs
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
readmejs: {
options: {
separator: '----------------------',
},
index: {
options: {
showFilePath: false,
header: 'HEADER.md',
footer: 'LICENSE.md'
},
files: {
'README.md': ['*.js']
}
},
lib: {
options: {
showFilePath: true
},
files: {
'README.md': ['lib/**/*.js']
}
}
},
})
Type: Boolean
Default value: false
Set to true
if you wish to output the path of the file.
Type: Boolean
Default value: false
Set to true
if you want your output compressed (titles and such are taken out).
Type: Boolean
Default value: false
Set to true
if you want to quote >
your summary block.
Type: String
Default value: ''
Path to a header file to be concatenated at top of output.
Type: String
Default value: ''
Path to a footer file to be concatenated at bottom of output.
In this example, no header or footer will be used, and the result will be the parsing from all the matched files.
grunt.initConfig({
readmejs: {
options: {},
files: {
'lib/README.md': ['lib/*.js']
},
},
})
grunt.initConfig({
readmejs: {
options: {
showFilePath: true,
compressed: true,
quoteSummary: true,
header: 'HEADER.md',
footer: 'LICENSE.md'
},
files: {
'README.md': ['lib/**/*.js']
},
},
})
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Initial release)
Copyright (c) 2014 Acatl Pacheco. Licensed under the MIT license.