Add documentation task

This commit is contained in:
Kamil Nikel 2015-11-04 17:32:31 +01:00
parent a21de2a744
commit c19a760691
3 changed files with 15 additions and 0 deletions

View File

@ -1,6 +1,7 @@
var gulp = require('gulp')
var browserify = require('browserify')
var documentation = require('gulp-documentation')
var source = require('vinyl-source-stream')
var serve = require('gulp-serve')
var standard = require('gulp-standard')
@ -87,4 +88,10 @@ gulp.task('browserify', ['typescript'], function () {
.pipe(gulp.dest('./dist/'))
})
gulp.task('documentation', ['typescript'], function () {
gulp.src('./dist/Viewer.js')
.pipe(documentation({format: 'html' }))
.pipe(gulp.dest('html-documentation'))
})
gulp.task('default', ['serve', 'watch-ts', 'typescript'])

View File

@ -24,6 +24,7 @@
"browserify": "12.0.1",
"ghooks": "0.3.2",
"gulp": "3.9.0",
"gulp-documentation": "2.0.0",
"gulp-serve": "1.2.0",
"gulp-standard": "5.2.2",
"gulp-tsd": "0.0.4",

View File

@ -2,6 +2,13 @@ interface INode {
node: string;
}
/**
* This function initializes the viewer
* @param { string } id of the viewer
* @param { Node } initialNode which the viewer displays
* @returns { Viewer } a new viewer
*/
export class Viewer {
constructor (id: string, node: INode ) {
return "Viewer -- id: " + id + ", node: " + node.node;