-
Notifications
You must be signed in to change notification settings - Fork 176
Home
i5ting edited this page Nov 17, 2014
·
4 revisions
Welcome to the i5ting_ztree_toc wiki!
我一般的用法,写一个generate.sh
cp -rf img preview/
tocmd_conf -f README.md
然后只需执行这个shell就可以了,README.md 是你要生成的markdown文件
- 参考https://github.com/i5ting/gp-pages-import-test
- 视频http://haoqicat.com/shiren1118/nodejs/3
如果您要是熟悉nodejs,可以参考
使用gulp管理,自动提交到git pages上
// npm install --save gulp
// npm install --save gulp-gh-pages
// npm install --save gulp-open
// npm install --save gulp-rename
// npm install --save gulp-i5ting-toc
// npm install --save shelljs
var gulp = require('gulp');
var gp_deploy = require('gulp-gh-pages');
var open = require("gulp-open");
var rename = require("gulp-rename");
var i5ting_toc = require('gulp-i5ting-toc');
require('shelljs/global');
var options = {}
gulp.task('deploy', function () {
return gulp.src('./preview/**/*')
.pipe(gp_deploy(options));
});
gulp.task('rename',function () {
cp('-R', 'img', './preview/');
if (exec('cp ./preview/README.html ./preview/index.html').code !== 0) {
echo('Error: rename exec failed');
exit(1);
}
});
gulp.task('generate', function() {
var opt = {
source_file: 'README.md',
is_open: true,
markd_config: {
debug: false
}
}
gulp.src('README.md')
.pipe(i5ting_toc(opt));
});
gulp.task('default',['generate', 'rename', 'deploy'] ,function () {
console.log('default');
});
执行
gulp