Create inventory of components from individual files or data stored in JSON file.
This plugin requires Grunt ~0.4.5
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-content-inventory --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-content-inventory');
In your project's Gruntfile, add a section named content-inventory
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
'content-inventory': {
options: {
// Task specific options goes here.
},
your_target: {
// Target specific file lists and/or options goes here.
},
},
});
grunt.initConfig({
'content-inventory': {
options: {
// Template file path
template: path.resolve(__dirname, '../tmpl/template.html'),
// Storage file path
storage: 'component-inventory.json',
// Partial directory where individual partial files will be stored (relative to base)
partials: './partials',
// Component inventory file path
dest: 'component-inventory.html',
// Expand: create file per category
expand: false,
// Create partial files
storePartials: false,
// Partial extension when stored
partialExt: '.html',
// Category for items without category
categoryFallback: 'No category'
},
files: {
'dest/default_options': ['src/testing', 'src/123'],
},
},
});
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.
(Nothing yet)