簡體   English   中英

TypeDoc創建空文檔

[英]TypeDoc creating empty documentation

我有一個gulp任務,應該采取我的文件並為他們創建文檔。 任務看起來像這樣:

var gulp = require('gulp');
var gulptypedoc = require('gulp-typedoc');

gulp.task('typedoc-gamesmart', function () {
    return gulp.src([
        './src/util/Config.ts',
        './src/util/Http.ts',
        './typings/crypto-js/crypto-js.d.ts',
        './src/gamesmart/GameSmart.ts',
        './src/gamesmart/apis/Client.ts',
        './src/gamesmart/apis/Data.ts',
        './src/gamesmart/apis/Game.ts',
        './src/gamesmart/apis/Score.ts',
        './src/gamesmart/apis/Store.ts',
        './src/gamesmart/apis/User.ts',
        './src/gamesmart/main.ts',
    ]).pipe(gulptypedoc({
        // module: 'system',
        target: 'es5',
        out: 'docs/gamesmart/',
        name: 'GameSmart SDK',
        excludeNotExported: true,
        mode: 'file',
        version: true
    }));
});

完成后,我會得到空的文檔。

空文件

以下是類結構的示例:

class Score extends GameSmart {

    /**
     * Saves a score for the game
     *
     * @param {number} score        The score to be saved.
     * @param {Function} callback   The callback to run once complete.
     * @returns
     */
    public save(options: { score?: number } = {}, callback: Function = null, obj: Object = null): void {
        if ((options.score || 0) <= 0) { return; }
        this.makeRequest('/save', HttpMethod.Post, options, callback, obj);
    }

}

正如您所看到的,我沒有使用模塊,因此文檔說使用mode: 'file'所以我做了,我沒有得到任何東西。

如果我使用mode: 'modules' ,我會得到一個類列表,但是沒有文檔:

空Doc模塊

有什么我做錯了嗎?

重申@Sven所說的,如果在不導出任何符號的情況下使用excludedNotExported功能,則不會生成任何文檔。 更改此標志以記錄整個項目。

{ // TypeDoc config
    target: 'es5',
    out: 'docs/gamesmart/',
    name: 'GameSmart SDK',
    excludeNotExported: false,
    mode: 'file',
    version: true
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM