示例#1
0
gulp.task('gitbook:generate', ['gitbook:install'], function(){
    ffs.rmdirRecursiveSync('app/documentation');
    var book = new Book('documentation');
    return book.parse().then(function() {
        return book.generate('website');
    });
});
示例#2
0
// Generate the book
function build(done) {
  const startTime = Date.now();
  console.log('Build styleguide: started');

  const input = '.tmp';
  const output = 'build/styleguide';

  const book = new gitbook.Book(input, {
    logLevel: gitbook.LOG_LEVELS.INFO,
    config: { output }
  });

  return book.parse()
    .then(() => book.generate('website'))
    .then(() => {
      const diff = Date.now() - startTime;
      console.log(`Build styleguide: done (${diff}ms)`);
      return done();
    });
}
exports.default = function (cb) {
  try {
    _fs2.default.statSync('./manual');
  } catch (err) {
    cb();
    return;
  }

  // The below is required inline because of issues with Gitbook.
  var gitbook = require('gitbook'); // eslint-disable-line global-require
  var book = new gitbook.Book('./manual', {
    config: {
      output: './docs/manual'
    }
  });
  book.parse().then(function () {
    return book.generate('website');
  }).then(function () {
    return cb();
  }).catch(function (err) {
    return cb(err);
  });
};
 book.parse().then(function () {
   return book.generate('website');
 }).then(function () {