diff options
author | Teemu Pöntelin <teemu@vaadin.com> | 2016-09-29 15:17:38 +0300 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2016-10-06 10:12:31 +0300 |
commit | f19fba5bebbb11466146a44fe10052ac36a0bd8a (patch) | |
tree | 6afe49030010b9bddffdeff3aa917683d92a843a /tasks | |
parent | ef511503883617447331b26a8cd84e7cbb214877 (diff) | |
download | vaadin-core-f19fba5bebbb11466146a44fe10052ac36a0bd8a.tar.gz vaadin-core-f19fba5bebbb11466146a44fe10052ac36a0bd8a.zip |
Replace React integration demo with proper documentation
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/docsite.js | 57 |
1 files changed, 2 insertions, 55 deletions
diff --git a/tasks/docsite.js b/tasks/docsite.js index 175df48..46ecf68 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -42,18 +42,9 @@ gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], functi }); gulp.task('cdn:docsite:core-elements', function() { - return gulp.src(['docs/*', '!docs/angular2.adoc']) - .pipe(gulp.dest(docPath)); + return gulp.src(['docs/**']).pipe(gulp.dest(docPath)); }); -gulp.task('cdn:docsite:core-elements-ng2-integration', function() { - return gulp.src('docs/angular2.adoc') - .pipe(gulp.dest(docPath + '/integrations')); -}); - -gulp.task('cdn:docsite:core-elements-integrations', function() { - return getDocModifyTask('demo/**', docPath + '/integrations'); -}); gulp.task('cdn:docsite:core-elements-elements', ['cdn:docsite:bower_components'], function() { var bowerJson = require('../' + stagingPath + '/bower.json'); @@ -68,52 +59,8 @@ gulp.task('cdn:docsite:core-elements-elements', ['cdn:docsite:bower_components'] .pipe(gulp.dest(docPath + '/')); }); -function getDocModifyTask(sourceFiles, targetFolder, n) { - fs.mkdirsSync(targetFolder); - gutil.log('Generating site documentation from ' + sourceFiles + ' into ' + targetFolder); - - return gulp.src([sourceFiles, '!**/*-embed.html']) - // Remove bad tags - .pipe(replace(/^.*<(!doctype|\/?html|\/?head|\/?body|meta|title).*>.*\n/img, '')) - // Uncomment metainfo, and enclose all the example in {% raw %} ... {% endraw %} to avoid liquid conflicts - // We use gulp-modify instead of replace in order to handle the github url for this file - .pipe(modify({ - fileModifier: function(file, contents) { - var re = new RegExp(".*/" + n + "/"); - var gh = 'https://github.com/vaadin/' + n + '/edit/master/' + file.path.replace(re, ''); - return contents.replace(/^.*<!--[ \n]+([\s\S]*?title:[\s\S]*?)[ \n]+-->.*\n([\s\S]*)/img, - '---\n$1\nsourceurl: ' + gh + '\n---\n{% raw %}\n$2\n{% endraw %}'); - } - })) - .pipe(replace(/^.*<section>[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, '')) - // Add ids to headers, so as site configures permalinks - .pipe(replace(/<h(\d+)>(.*)(<\/h\d+>)/img, function($0, $1, $2, $3){ - var id = $2.trim().toLowerCase().replace(/[^\w]+/g,'_'); - return '<h' + $1 + ' id="' + id + '">' + $2 + $3; - })) - // Remove webcomponents polyfill since it's added at top of the site - .pipe(replace(/^.*<script.*?\/webcomponents.*\.js[\"'].*?<\/script>\s*?\n?/img, '')) - // embed files are displayed as iframe, we don't remove above fragments like body or polyfill - .pipe(addsrc(sourceFiles + '/*-embed.html')) - // Remove Analytics - .pipe(replace(/^.*<script.*?ga\.js[\"'].*?<\/script>\s*?\n?/img, '')) - // Adjust bowerComponents variable in common.html - .pipe(replace(/(bowerComponents *= *)'..\/..\/'/, "$1'../bower_components/'")) - // Adjust location of the current component in bower_components (..) - .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) - // Adjust location of dependencies in bower_components (../..) - .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) - // Remove references to demo.css file - .pipe(replace(/^.*<link.*demo.css.*\n/im, '')) - // Remove table of contents - .pipe(replace(/^.*table-of-contents.html.*\n/im, '')) - .pipe(gulp.dest(targetFolder)); -} - gulp.task('cdn:docsite:stage', ['cdn:docsite:core-elements', - 'cdn:docsite:core-elements-elements', - 'cdn:docsite:core-elements-integrations', - 'cdn:docsite:core-elements-ng2-integration']); + 'cdn:docsite:core-elements-elements']); gulp.task('cdn:docsite:zip', ['cdn:docsite:stage'], function() { var src = docPath + '/**/*'; |