0

I'm trying to build docs for a simple set of JS code (given below). If I use gulp, the docs are created how I would expect them. If I use the CLI, the docs are incomplete.

Here's my JS code:

// BASE.js
/** @module BASE */
var BASE = {};

// MOD1.js
/** @class MOD1 - Test module */
BASE.MOD1 = Object.create({});

/**
 * Just a test function
 * @param {Object} var1 - A test variable
 */
BASE.MOD1.testFunction = function(var1){
    alert('hi');
};

My gulp file:

var gulp = require('gulp'),
    jsdoc = require('gulp-jsdoc'),
    outDir = './gulp-docs/',
    docInfo = {},
    docOptions = {},
    docTemplate = {},
    srcFiles = [
        "BASE.js",
        "MOD1.js"
    ];

gulp.task('default', function() {
    return gulp.src(srcFiles)
            .pipe(jsdoc.parser(docInfo))
            .pipe(jsdoc.generator(outDir, docTemplate, docOptions))
});

And my command line:

C:\DocTest> jsdoc BASE.js MOD1.js --configure rawconf.json --destination raw-docs

rawconf.json:

{
    "tags": {
        "allowUnknownTags": true
    },
    "plugins": [],
    "templates": {},
    "opts": {
        "package": "./rawpackage.json"
    }
}

rawpackage.json:

{}

I run both gulp and the jsdoc command from the Node.js command prompt.

Output from gulp is the following files:

BASE.js.html
BASE.MOD1.html
index.html
MOD1.js.html
module-BASE.html

Output from the CLI is the following files:

BASE.js.html
index.html
MOD1.js.html
module-BASE.html
module-BASE-BASE.MOD1.html

There are some small differences which I can chalk up to the differences between the gulp-jsoc version of jsdoc (3.3.0-alpha5) and the current version (3.3.0-beta3).

But the biggest difference is that while in the gulp output, I can find information on testFunction, there is no information to be found at all regarding testFunction anywhere in the CLI output. I've even searched the HTML code--nothing.

So did I do something wrong? I'm just trying to achieve parity at this point, and I've exhausted any documentation I could find online.

TheJim01
  • 6,362
  • 1
  • 17
  • 44

1 Answers1

0

If you look at the gulp-jsdoc github page here, there's a "Big Fat Warning" that this plugin isn't being kept up to date.

Try using the gulp-shell plugin. You can use exactly what you typed into the command line.

  • Thanks for the tip on gulp-shell, but the issue is actually the other way around, as it's the CLI output that's broken. This is more of a jsdoc CLI question than a gulp-jsdoc question. I'm actually trying to migrate away from gulp-jsdoc to use the CLI, but the issue above is currently preventing that. – TheJim01 Apr 21 '15 at 14:32