jbt / docker

Documentation generator
http://jbt.github.com/docker
MIT License
234 stars 56 forks source link

Gulp task integration #69

Open gtsiokos opened 10 years ago

gtsiokos commented 10 years ago

I'm new to the node ecosystem, has anyone tried to integrate docker.js with Gulp?

jasonseney commented 9 years ago

@gtsiokos Yes, docker integrates very nicely with gulp. I have a specific gulp task that runs the docs only on updated files, making it really quick to integrate with our build process.

Here's a short snippet example of use:

var opts = {
    inDir: path.resolve(utils.relative('src')),
    outDir: path.join(utils.relative('src'), 'docs');,
    sidebarState: 'yes',
    multiLineOnly: true,
    onlyUpdated: true
};

var d = new docker(opts);

// Grab directories, drop excluded dirs, format for docker
var assetDirs = utils.globDirs('src/*/');
var assetDocs = [];
assetDirs.forEach(function(dirName){
    if (!_.contains(['docs','some_other_exclude_here'], dirName)) {
        assetDocs.push('./' + dirName);
    }
});

d.doc(assetDocs);