parse bower.json and update html header
inspired by:
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-bj2html --save-dev
or npm install git://github.com/boeckMt/grunt-bj2html.git --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('bj2html');
In your project's Gruntfile, add a section named bj2html
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
bj2html: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
Type: String
Default value: '<!-- bj2html:json -->'
A string value that is used as start-tag.
Type: String
Default value: '<!-- endbj2html -->'
A string value that is used as end-tag.
Type: String
Default value: './test/app/bower.json'
A string value that is used as path to your bower.json.
So if the file test/app/index.html
has the content <!-- bj2html:json --> <!-- endbj2html -->
, it will create a temp-file and populate it with title
, version
, description
and author
from the bower.json file.
grunt.initConfig({
bj2html: {
my_options: {
options: {},
files: {
'tmp/index.html': ['test/app/bower.json']
}
}
},
})
grunt.initConfig({
bj2html: {
my_options: {
options: {
starttag: '<!-- bj2html:json -->',
endtag: '<!-- endbj2html -->',
bowerPath: 'test/app/bower.json'
},
files: {
'tmp/index.html': ['test/app/bower.json']
}
}
},
})
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)
Copyright (c) 2015 boeckMt. Licensed under the MIT license.