Browse Source

Fixes to tasks for serving docs

pull/1191/head
jlukic 10 years ago
parent
commit
d96b19c148
5 changed files with 113 additions and 20 deletions
  1. 18
      docs.json
  2. 71
      gulpfile.js
  3. 6
      tasks/defaults.js
  4. 19
      tasks/maintainer/docs-files.json
  5. 19
      tasks/maintainer/docs-output.json

18
docs.json

@ -0,0 +1,18 @@
{
"base": "",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"packaged": "../docs/docs/dist/",
"uncompressed": "../docs/docs/dist/components/",
"compressed": "../docs/docs/dist/components/",
"themes": "../docs/docs/dist/themes/"
},
"clean": "../docs/docs/dist/"
}
}

71
gulpfile.js

@ -75,18 +75,11 @@ var
*******************************/
try {
// settings
// try to load json
var
config = require('./semantic.json'),
package = require('./package.json')
;
// shorthand
base = config.base;
clean = config.paths.clean;
output = config.paths.output;
source = config.paths.source;
}
catch(error) {
var config = false;
@ -97,7 +90,13 @@ catch(error) {
*******************************/
var
getDerivedValues = function() {
getConfigValues = function() {
// shorthand
base = config.base;
clean = config.paths.clean;
output = config.paths.output;
source = config.paths.source;
// create glob for matching filenames from selected components
componentGlob = (typeof config.components == 'object')
@ -129,7 +128,7 @@ var
}
;
getDerivedValues();
getConfigValues();
/*******************************
Tasks
@ -268,9 +267,9 @@ gulp.task('build', 'Builds all files from source', function(callback) {
console.info('Building Semantic');
// get relative asset path (path returns wrong path? hardcoded)
// get relative asset path (path returns wrong path?)
// assetPaths.source = path.relative(srcPath, path.resolve(source.themes));
assetPaths.source = '../../themes';
assetPaths.source = '../../themes'; // hardcoded
// copy assets
gulp.src(source.themes + '**/assets/**')
@ -538,7 +537,7 @@ gulp.task('install', 'Set-up project for first time', function () {
}
if(answers.build == 'yes') {
config = require('./semantic.json');
getDerivedValues();
getConfigValues();
gulp.start('build');
}
}))
@ -553,8 +552,39 @@ gulp.task('install', 'Set-up project for first time', function () {
Maintainer
---------------*/
/* Serve files to an instance of docs hosted adjacent */
gulp.task('serve', false, function () {
/* Moves watched files to static site generator output */
gulp.task('serve-docs', false, function () {
config = require('./tasks/maintainer/docs-output.json');
getConfigValues();
// copy source files
gulp
.watch([
'src/**/*.*'
], function(file) {
console.clear();
return gulp.src(file.path, { base: 'src/' })
.pipe(gulp.dest(output.less))
.pipe(print(log.created))
;
})
;
gulp.start('watch');
});
/* Builds files to docs source */
gulp.task('build-docs', false, function () {
console.clear();
// pushes to docpad files
config = require('./tasks/maintainer/docs-output.json');
getConfigValues();
gulp.start('build');
// copy source
gulp.src('src/**/*.*')
.pipe(gulp.dest(output.less))
.pipe(print(log.created))
;
});
@ -562,15 +592,18 @@ gulp.task('serve', false, function () {
/* Bump Version */
gulp.task('bump', false, function () {
// Create RTL Release
// Create Node Release
// bump package.json
// bump composer.json
});
/* Release */
gulp.task('release', false, function () {
gulp.task('release', false, function() {
});
gulp.task('release all', false, function () {
// Create SCSS Version

6
tasks/defaults.js

@ -17,6 +17,10 @@ module.exports = {
compressed : 'dist/components/',
themes : 'dist/themes/'
},
clean : 'dist/'
clean : 'dist/',
docs : {
source : '../docs/server/files/release/',
output : '../docs/release/'
}
}
};

19
tasks/maintainer/docs-files.json

@ -0,0 +1,19 @@
{
"base": "",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"less": "../docs/server/files/src/",
"packaged": "../docs/server/files/dist/",
"uncompressed": "../docs/server/files/dist/components/",
"compressed": "../docs/server/files/dist/components/",
"themes": "../docs/server/files/dist/themes/"
},
"clean": "../docs/server/files/dist/"
}
}

19
tasks/maintainer/docs-output.json

@ -0,0 +1,19 @@
{
"base": "",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"less": "../docs/out/src/",
"packaged": "../docs/out/dist/",
"uncompressed": "../docs/out/dist/components/",
"compressed": "../docs/out/dist/components/",
"themes": "../docs/out/dist/themes/"
},
"clean": "../docs/out/dist/"
}
}
Loading…
Cancel
Save