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 结构的例子:
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'
,我会得到一个 class 的列表,但没有文档:
我做错了什么吗?
重申@Sven 所说的,如果您在不导出任何符号的情况下使用 excludedNotExported
功能,则不会生成任何文档。更改此标志以记录整个项目。
{ // TypeDoc config
target: 'es5',
out: 'docs/gamesmart/',
name: 'GameSmart SDK',
excludeNotExported: false,
mode: 'file',
version: true
}
我有一个 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 结构的例子:
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'
,我会得到一个 class 的列表,但没有文档:
我做错了什么吗?
重申@Sven 所说的,如果您在不导出任何符号的情况下使用 excludedNotExported
功能,则不会生成任何文档。更改此标志以记录整个项目。
{ // TypeDoc config
target: 'es5',
out: 'docs/gamesmart/',
name: 'GameSmart SDK',
excludeNotExported: false,
mode: 'file',
version: true
}