diff --git a/gulpfile.js b/gulpfile.js index fac6248f..d2a62ab0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,6 +7,7 @@ var fs = require('fs'); var rimraf = require('rimraf'); var cp = require('child_process'); var httpServer = require('http-server'); +var typedoc = require("gulp-typedoc"); var WEBSITE_GENERATED_PATH = path.join(__dirname, 'website/playground/new-samples'); var MONACO_EDITOR_VERSION = (function() { @@ -238,22 +239,38 @@ gulp.task('clean-website', function(cb) { rimraf('../monaco-editor-website', { m gulp.task('website', ['clean-website'], function() { return ( - gulp.src('website/**/*', { dot: true }) - .pipe(es.through(function(data) { - if (!data.contents || !/\.(html)$/.test(data.path)) { - return this.emit('data', data); - } + es.merge( + gulp.src('website/**/*', { dot: true }) + .pipe(es.through(function(data) { + if (!data.contents || !/\.(html)$/.test(data.path)) { + return this.emit('data', data); + } - var contents = data.contents.toString(); - contents = contents.replace(/\.\.\/release\/dev/g, 'node_modules/monaco-editor/min'); - contents = contents.replace(/{{version}}/g, MONACO_EDITOR_VERSION); - // contents = contents.replace('© 2016 Microsoft', '© 2016 Microsoft [' + builtTime + ']'); + var contents = data.contents.toString(); + contents = contents.replace(/\.\.\/release\/dev/g, 'node_modules/monaco-editor/min'); + contents = contents.replace(/{{version}}/g, MONACO_EDITOR_VERSION); + // contents = contents.replace('© 2016 Microsoft', '© 2016 Microsoft [' + builtTime + ']'); - data.contents = new Buffer(contents); + data.contents = new Buffer(contents); + + this.emit('data', data); + })) + .pipe(gulp.dest('../monaco-editor-website')), + + // node_modules\.bin\typedoc --mode file --out out src\monaco.d.ts --includeDeclarations --theme default --entryPoint monaco --name "Monaco Editor v0.7.0 API" --readme none --hideGenerator + gulp.src('monaco.d.ts') + .pipe(typedoc({ + mode: 'file', + out: '../monaco-editor-website/api', + includeDeclarations: true, + theme: 'default', + entryPoint: 'monaco', + name: 'Monaco Editor API v' + MONACO_EDITOR_VERSION, + readme: 'none', + hideGenerator: true + })) + ) - this.emit('data', data); - })) - .pipe(gulp.dest('../monaco-editor-website')) .pipe(es.through(function(data) { this.emit('data', data); }, function() { @@ -366,22 +383,22 @@ gulp.task('generate-test-samples', function() { } var index = [ -'', -'', -'', -'', -' ', -'', -'', -'[<< BACK]
', -'THIS IS A GENERATED FILE VIA gulp generate-test-samples

', -locations.map(function(location) { - return '' + location.name + ''; -}).join('
\n'), -'', -'', -'', -'', + '', + '', + '', + '', + ' ', + '', + '', + '[<< BACK]
', + 'THIS IS A GENERATED FILE VIA gulp generate-test-samples

', + locations.map(function(location) { + return '' + location.name + ''; + }).join('
\n'), + '', + '', + '', + '', ] fs.writeFileSync(path.join(__dirname, 'test/playground.generated/index.html'), index.join('\n')); }); diff --git a/package.json b/package.json index 638646d6..608eeee3 100644 --- a/package.json +++ b/package.json @@ -18,13 +18,15 @@ "devDependencies": { "event-stream": "^3.3.2", "gulp": "^3.9.1", + "gulp-typedoc": "^2.0.0", "http-server": "^0.9.0", "monaco-css": "1.2.1", "monaco-editor-core": "0.7.3", - "monaco-json": "1.1.1", "monaco-html": "1.1.0", + "monaco-json": "1.1.1", "monaco-languages": "0.6.0", "monaco-typescript": "2.0.1", - "rimraf": "^2.5.2" + "rimraf": "^2.5.2", + "typedoc": "^0.5.0" } }