Angular use compodoc

Angular use compodoc

compodoc是一個用於產生 Angular 靜態網頁的工具

Angular 使用 compodoc 產生說明文件

安裝compodoc

以 local 模式安裝

npm install --save-dev @compodoc/compodoc

產生檔案

./node_modules/.bin/compodoc -p tsconfig.json

RUN server

./node_modules/.bin/compodoc -s

以global(全域) 模式安裝

npm install -g @compodoc/compodoc

產生文件

compodoc -p tsconfig.json

啟用本地文件網站

compodoc -p tsconfig.json -s

使用 npx(推薦)

npx compodoc -p tsconfig.json -s -r 8888

指令

  • p : 表示 產生文件
  • s : 啟用文件網站

jsDoc Tags

@Injectab()

export class HelloService{

constructor(){

}

/**

* Represents a hellWord.

* @param {string} UserName - The UserName of the hellWord.

* @param {string} age - The age of the hellWord.

*/

hellWord(UserName: string, age : string) {

}

}

參考

Angular 工具篇之文档管理 | 前端修仙之路

Angular #10 Angular Documentation

Javascript文檔註解規則使用方式@use JSDoc - ucamc

你寫的文件別人看得懂嗎?:compodoc | Jonny Huang 的學習筆記 (jonny-huang.github.io)