繁体   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