2016-09-07 4 views
1

Ich habe eine gulp Aufgabe, die meine Dateien nehmen und Dokumentation für sie erstellen soll. Die Aufgabe sieht folgendermaßen aus:TypeDoc erstellt leere Dokumentation

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 
    })); 
}); 

Wenn es abgeschlossen ist, bekomme ich leere Dokumente. Hier

Empty Docs

ist ein Beispiel für die Klassenstruktur:

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); 
    } 

} 

Wie Sie sehen, ich bin nicht-Module verwenden, um die Dokumentation mode: 'file' zu verwenden, sagt, so habe ich, und ich Ich bekomme nichts.

Wenn ich mode: 'modules' verwenden, erhalte ich eine Liste der Klassen, aber keine Dokumentation:

Empty Doc Modules

Gibt es etwas, was ich falsch mache?

+3

Sie exportieren Ihre 'Score' Klasse nicht, also sollte' excludeNotExported' 'false' statt' true' sein? –

+0

Das sieht aus wie es das Problem behoben hat! Vielen Dank! –

Antwort

0

Um zu wiederholen, was @Sven gesagt hat, wird keine Dokumentation generiert, wenn Sie die excludedNotExported Funktion verwenden, während Sie keine Symbole exportieren. Ändern Sie diese Markierung, um das gesamte Projekt zu dokumentieren.

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