Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.23 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.23 KB

grunt-html2json

Compile the html files into a JSON file.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-html2json

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-html2json');

Documentation

Example Code

grunt.initConfig({
  html2json: {
    dist: {
       src: ['src/*.txt', 'src/*.html'],
       dest: 'dist/built.json'
    }
  }
});

You might also want to trigger the compiled process by watching the file change. Append following ine in the grunt.initConfig list.

watch: {
  files: '<config:html2json.dist.src>',
  tasks: 'default'
}

Contributing

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.

Release History

  • 0.1 ++ Well, it works (testcase is yet to be done). ++ JSON is pretty print by default. Later will add an option to switch.

License

Copyright (c) 2012 Tom Tang
Licensed under the MIT license.