Skip to content

Commit 46a8494

Browse files
author
Shuwen Qian
committed
Tidy up docs
1 parent 5ea92dd commit 46a8494

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
build/
44
build_docs/
55
.grunt
6+
.publish

Gulpfile.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
'use strict';
22
/*jslint node: true */
33

4+
//TODO(shuwen): split into multiple files
5+
//TODO(shuwen): replace path string concatenation with path.join
6+
47
var fs = require('fs');
58
var gulp = require('gulp');
69
var glob = require('glob');
@@ -158,16 +161,20 @@ gulp.task('clean:docs', function() {
158161

159162
gulp.task('copy:docs', function() {
160163
var assets = gulp.src('docs/images/**',{base:'./docs'});
161-
var bower_components = gulp.src(['bower_components/webcomponentsjs/**', 'bower_components/polymer/**'],{base:'.'});
162164
var cname = gulp.src('CNAME');
163165
var license = gulp.src('LICENSE.txt');
164166

165-
var merged_static = merge(assets, bower_components, cname, license)
167+
var merged_static = merge(assets, cname, license)
166168
.pipe(gulp.dest(BUILD_DOCS));
169+
170+
var bower_components = gulp.src(['bower_components/webcomponentsjs/**/*', 'bower_components/polymer/**/*'], {base:'bower_components'})
171+
.pipe(debug())
172+
.pipe(gulp.dest(BUILD_DOCS+'/bower_components/'));
173+
167174
var lib = gulp.src(BUILD+'**')
168175
.pipe(gulp.dest(BUILD_DOCS+'/bower_components/strand/dist'));
169176

170-
return merge(merged_static, lib);
177+
return merge(bower_components, merged_static, lib);
171178
});
172179

173180
gulp.task('sass:docs', function() {
@@ -259,8 +266,6 @@ gulp.task('docs:templates', function() {
259266
}
260267

261268
function injectArticleData(pkg, moduleMap, articleList, articleMap) {
262-
console.log(articleList);
263-
console.log(articleMap);
264269
return through.obj(function(file, enc, cb) {
265270
var articleContents = file.contents.toString('utf8');
266271
var articleDoc = {
@@ -283,8 +288,8 @@ gulp.task('docs:templates', function() {
283288
var pkg = getPkgInfo();
284289

285290
// Create moduleList from directory listing
286-
var modules = glob.sync("mm-*/", {cwd:SRC});
287-
var moduleList = modules.map(function(name) { return name.replace('/',''); });
291+
var modules = glob.sync("mm-*/doc.json", {cwd:SRC});
292+
var moduleList = modules.map(function(name) { return name.replace('/doc.json',''); });
288293
var moduleMap = moduleList.map(function(name) { return {name: name}; });
289294

290295
// Create behaviorsMap

0 commit comments

Comments
 (0)