Grunt tutorial 3
Yuidoc plug-in
Yuidoc is a tool that can generate HTML documents by commenting on codes. The documents are generated based entirely on javadoc-style code comment rules.
When writing public modules or APIs, we often output documents to callers. yuidoc is a good assistant at this time.
The following describes how to use yuidoc in grunt.
12345678910111213141516 |
grunt.initConfig({ pkg: grunt.file.readJSON(‘package.json‘), yuidoc: { compile: { name: ‘<%= pkg.name %>‘, description: ‘<%= pkg.description %>‘, version: ‘<%= pkg.version %>‘, url: ‘<%= pkg.homepage %>‘, options: { paths: ‘path/to/source/code/‘, themedir: ‘path/to/custom/theme/‘, outdir: ‘where/to/save/docs/‘ } } }}); |
In compile, the first four attributes are easy to understand, including "name", "Description", "version", and "project homepage URL ".
The attributes in options are related to the attributes of yuidoc. They are not limited to three in the sample code. For more attributes, see yuidoc.
Path: path for storing code source files
Themedir: storage path of the generated HTML Style
Outdir: storage path of the generated html doc file
Grunt-contrib-yuidoc
Article foreverpx
Link to the original article: grunt tutorial 3
Getting started with grunt (3)