문서화를 위한 툴
/** * secret key used in crypt() and decrypt() * @name secretKey */ var secretKey = "It should be defined";
name 속성은 명시하지 않아도 된다.
/** * @param {string} s - String to encode * @return {string} encoded string */ function crypt(s) { //some code return enc; }
/** * Define a cat * @class Cat */ var Cat = cc.Animal.extend({ /** * constructor */ ctor : function() { this._super(); } });
자바로 짜여진 JSDoc 문서 자동 생성 코드. 자바 실행파일이 위치한 폴더를 운영체제의 PATH에 등록한 후 다음 명령을 실행한다.
java -jar jsrun.jar app/run.js {js 파일} -t=templates/jsdoc -d="{JSDoc 문서 폴더}"
아래의 명령은 ../src/*.js 파일들의 주석을 문서화하여 out 폴더에 저장한다.
java -jar jsrun.jar app/run.js ../src/*.js -t=templates/jsdoc -d="out"