Skip to content

Instantly share code, notes, and snippets.

@Aratramba
Last active May 8, 2018
Embed
What would you like to do?
Design Manual setup with Gulp / Pug-doc
//- @pugdoc
name: hello world
div hello world

!{hello world}

const gulp = require('gulp');
const pugDoc = require('pug-doc');
const DesignManual = require('design-manual');
gulp.watch('src/**/*.pug', ['design-manual']);
gulp.watch('design-manual/**/*.md', ['design-manual']);
/**
* Pug Doc
*/
gulp.task('pug-doc', (gulpDone) => {
pugDoc({
input: 'src/**/*.pug',
output: 'httpdocs/design-manual/pugdoc.json',
complete: gulpDone
});
});
/**
* Design Manual
*/
function buildDesignManual(cb) {
DesignManual.build({
output: 'httpdocs/design-manual/',
components: 'httpdocs/design-manual/pugdoc.json',
pages: 'design-manual/pages',
meta: {
domain: '',
title: 'Design Manual',
avatar: 'http://placehold.it/80x80',
version: 'v' + require('../../package.json').version
},
nav: [
{ label: 'Home', href: '/index.html' },
{ label: 'Components', href: '/components.html' }
],
renderComponents: true,
renderCSS: true,
prerender: {
port: 3000,
path: '',
serveFolder: 'httpdocs/',
},
onComplete: cb
});
}
gulp.task('design-manual', ['pug-doc'], (gulpDone) => {
buildDesignManual(gulpDone);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment