javascript doc 여러가지 중에서 YUIDOC을 잠깐 사용해 보았습니다.
node.js 를 설치합니다.
http://nodejs.org/#download 에서 인스톨러를 다운받아서 설치합니다.
yuidocjs 를 설치합니다.
커맨드창에서 npm -g install yuidocjs 명령어로 yuidocjs 를 설치합니다.
프로젝트 홈경로에 yuidoc.json 파일을 생성합니다.
{ "name": "The Foo API", "description": "The Foo API: a library for doing X, Y, and Z", "version": "1.2.1", "url": "http://example.com/", "options": { "outdir": "../build/apidocs" } }
기본적인 프로젝트 정보들을 json 형태로 입력합니다.
{
"name": "MAP API",
"description": "MAP API: a library for using MAP control",
"version": "1.0.0",
"options": {
"exclude" : "arcgis_js",
"paths": "./WebContent/js",
"outdir": "./WebContent/apidocs"
}
}
제외할 디렉토리를 exclude로 넣고, 소스 경로를 paths로 넣고, 출력할 곳으로 outdir을 넣었습니다.
옵션은 http://yui.github.io/yuidoc/args/ 에서 확인할 수 있습니다.
커맨드 창에서 yuidoc . 입력하여 yuidoc을 실행합니다.
cmd를 통하여 위와 같이 실행되도록 스크립트를 작성합니다. 다른 작업과 depends 로 연결합니다.
<target name="apidocs" description="make api docs" > <echo message="Making api Docs" /> <exec executable="cmd"> <arg value="/c" /> <arg value="yuidoc" /> <arg value="." /> </exec> </target>