GithubHelp home page GithubHelp logo

krampstudio / grunt-jsdoc Goto Github PK

View Code? Open in Web Editor NEW
390.0 10.0 83.0 761 KB

A grunt plugin to generate javascript doc by running jsdoc3 on your grunt projects.

License: MIT License

JavaScript 100.00%

grunt-jsdoc's Introduction

grunt-jsdoc Build Status NPM version Built with Grunt

Npm Downloads

This plugin enables you to integrate the generation of comments based documentation into your Grunt build.

Generate your documentation

Install

This plugin requires Grunt >=0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-jsdoc --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-jsdoc');

Configuration

First, add the jsdoc entry to the options of the initConfig method of your Gruntfile.js :

grunt.initConfig({
    jsdoc : {
        dist : {
            src: ['src/*.js', 'test/*.js'],
            options: {
                destination: 'doc'
            }
        }
    }
});

The supported options are

  • src : an array of pattern that matches the files to extract the documentation from. You can also include a README.
  • dest : (alias to options.destination) set up the destination folder, the grunt way
  • jsdoc: (optional) the path to the jsdoc bin (needed only for some border line cases)
  • options : options used by jsdoc
    • destination: the folder where the doc is generated
    • ... All jsdoc options are available (see usejsdocCli documentation).
    • ignoreWarnings : (optional) do not show jsdoc warnings

Code Documentation

This plugin is a wrapper around jsdoc3. Please refer to the documentation for the documentation details.

Templates

The plugin includes only the jsdoc3 template but you can configure any other jsdoc3 template. For example you can use ink-docstrap.

npm install --save-dev ink-docstrap

And in your Gruntfile.js :

jsdoc : {
    dist : {
        src: ['src/**/*.js', 'README.md'],
        options: {
            destination : 'doc',
               template : "node_modules/ink-docstrap/template",
              configure : "node_modules/ink-docstrap/template/jsdoc.conf.json"
        }
    }
}

Generation

To generate the documentation, you need to call the jsdoc task :

$> grunt jsdoc

or integrate it to your build sequence :

grunt.registerTask('default', ['lint', 'test', 'jsdoc']);

Compatibility

⚠️ Migrate from 0.x.x to 1.x.x branch :

I have removed the direct dependency to ink-docstrap. If you still want it, grab the dependency by yourself (npm install --save-dev ink-docstrap)

⚠️ Migrate from 1.x.x to 2.x.x branch :

The private option follows now the default jsdoc behavior : false by default.

Contributions

Every contribution is more than welcomed. You can:

  • report issues
  • Fix, improve the configuration, add new features. The best is to fork and submit a pull request
  • Test and adapt to other OS
  • Fix my English mistakes
  • Update the documentation
  • Create a better logo
  • Offer me a coffee (I'm maintaining this plugin on my free time)

Upstream issues

For documentation related issues, please use the jsdoc issue tracker

To be sure the issue comes from the Grunt plugin, you can check by comparing the results with a jsdoc command. Run the task with the --debug flag to retrieve the jsdoc command to run.

Release History

  • 2.4.0 jsdoc 3.6.0 (security update) and upgrade node support
    • 2.4.1 security update
  • 2.3.0 jsdoc 3.5.5 and up to date dependencies
    • 2.3.1 fix version of transitive dependency marked to prevent regex dos
  • 2.2.0 jsdoc 3.5.0
    • 2.2.1 fix version of transitive dependency marked to prevent xss
  • 2.1.0 use cross-spawn instead of cross-spawn-async, add generating and generated grunt events
  • 2.0.0 private behavior, cross-spawn-async instead of manual windows management
  • 1.1.0 update to jsdoc 3.4.0 and make dest optional if a config file is set.
  • 1.0.0 remove direct dependency to docstrap
  • 0.6.0 jsdoc 3.0.0
    • 0.6.4 first stable using jsdoc 3.3.0
    • 0.6.5 code refactoring, docstrap 0.5.3, PR #120, better path management
    • 0.6.6 fix failing test
    • 0.6.7 Fix bug #136 and add more tests
    • 0.6.8 Fix bug #140, #143,
    • 0.6.9 Fix bug #144
    • 0.6.10 Revert wrong moving away docstrap dep
  • 0.5.0 Move to NPM dependencies instead of git, jsdoc 3.2.2 (Fix #65)
    • 0.5.1 Update repo name to prevent confusion with previous version
    • 0.5.2 Upgrade to Grunt 0.4.3 (PR #74)
    • 0.5.3 Fix peer deps issue
    • 0.5.4 Fix peer deps issue
    • 0.5.5 Update docstrap version
    • 0.5.6 Fix dependencies version and bug #87
    • 0.5.7 Update readme, docstrap version
    • 0.5.8 Fix bug #116
  • 0.4.0 Update to jsdoc 3.2.0 stable, Fix #37, add integration tests
    • 0.4.1 Fix #53 and #54
    • 0.4.2 Fix #57
    • 0.4.3 Grunt 0.4.2 compliance, upgrade to jsdoc 3.2.2 and undeprecate the dest option (#60, #63 and #66)
  • 0.3.0 Partial rewrite, Fix #29 and minor typos fixs
  • 0.2.0 Migrate to grunt 0.4
    • 0.2.1 Fix #10
    • 0.2.2 Fix #11
    • 0.2.3 Fix #14 and #15
    • 0.2.4 Fix Jsdoc 3 dependency to 3.1.1 tag, enables jsdoc options #19, enable to add jsdoc path #13 and add peerDependencies
  • 0.1.0 First release, includes basic support of [jsdoc3]
    • 0.1.1 Fix #2
    • 0.1.2 Fix #4
    • 0.1.3 Fix #7, Add feature #8
    • 0.1.4 Use child_process.spawn instead of exec to run the command

License

Copyright (c) 2012 Bertrand Chevrier Licensed under the MIT license.

grunt-jsdoc's People

Contributors

craig0990 avatar donotknow avatar ey-intuitive avatar gknobloch avatar jzaefferer avatar krampstudio avatar martindoyleuk avatar mightyiam avatar muxa avatar niyazpk avatar phated avatar plumlee avatar raynes avatar riobe avatar shinnn avatar tschaub avatar vladikoff avatar vseventer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-jsdoc's Issues

npm install fails on Mac

Here's my console output:

ian-gilmans-mac-pro-2:site-build iangilman$ npm install grunt-jsdoc --save-dev
npm http GET https://registry.npmjs.org/grunt-jsdoc
npm http 200 https://registry.npmjs.org/grunt-jsdoc
npm http GET https://registry.npmjs.org/grunt-jsdoc/-/grunt-jsdoc-0.2.4.tgz
npm http 200 https://registry.npmjs.org/grunt-jsdoc/-/grunt-jsdoc-0.2.4.tgz
npm http GET https://registry.npmjs.org/async/0.1.22
npm http GET https://registry.npmjs.org/js2xmlparser/0.1.0
npm http GET https://registry.npmjs.org/jshint/0.9.1
npm http GET https://registry.npmjs.org/wrench/1.3.9
npm http GET https://registry.npmjs.org/underscore/1.4.2
npm http 200 https://registry.npmjs.org/js2xmlparser/0.1.0
npm http GET https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.0.tgz
npm http 200 https://registry.npmjs.org/jshint/0.9.1
npm http GET https://registry.npmjs.org/jshint/-/jshint-0.9.1.tgz
npm http 200 https://registry.npmjs.org/wrench/1.3.9
npm http GET https://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz
npm http 200 https://registry.npmjs.org/underscore/1.4.2
npm http GET https://registry.npmjs.org/underscore/-/underscore-1.4.2.tgz
npm http 200 https://registry.npmjs.org/async/0.1.22
npm http GET https://registry.npmjs.org/async/-/async-0.1.22.tgz
npm http 200 https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.0.tgz
npm http 200 https://registry.npmjs.org/jshint/-/jshint-0.9.1.tgz
npm http 200 https://registry.npmjs.org/underscore/-/underscore-1.4.2.tgz
npm http 200 https://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.1.22.tgz
npm ERR! addPlacedTarball Could not remove "/Users/iangilman/.npm/async/0.1.22/package"
npm ERR! Error: EACCES, unlink '/Users/iangilman/.npm/async/0.1.22/package'
npm ERR!  { [Error: EACCES, unlink '/Users/iangilman/.npm/async/0.1.22/package']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/iangilman/.npm/async/0.1.22/package' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 12.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-jsdoc" "--save-dev"
npm ERR! cwd /Users/iangilman/projects/openseadragon/site-build
npm ERR! node -v v0.8.18
npm ERR! npm -v 1.2.2
npm ERR! path /Users/iangilman/.npm/async/0.1.22/package
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/Users/iangilman/.npm/async/0.1.22/package'
npm ERR! addPlacedTarball Could not remove "/Users/iangilman/.npm/jshint/0.9.1/package"
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/iangilman/projects/openseadragon/site-build/npm-debug.log
npm ERR! not ok code 0

private is always passed as command line option

Even if declared as private: false in the task options, it still passes the option to the command line and because it is just a flag, it triggers private always.

I tried setting it in my config.json but I guess command line flags take precedent.

jsdoc terminated \n Warning: jsdoc failure

I've just tried to add jsdoc to my project. I'm passing this to grunt.initConfig

    jsdoc: {
        dist: {
            src: ['charFunk-1.1.0.js'], 
            options: {
                destination: 'doc',
                private: true
            }
        }
    }

and I'm loading this:

grunt.loadNpmTasks('grunt-jsdoc');

and then finally here is my registerTask:

grunt.registerTask('default', ['jshint','uglify','jsdoc']);

Anyway, when I attempt to run grunt, I get this output:

...

Running "jsdoc:dist" (jsdoc) task
>> jsdoc terminated
Warning: jsdoc failure Use --force to continue.

Aborted due to warnings.

How can I figure out why this is happening? I am new to npm and grunt in general so my ability to trace through all these layers is challenged...

/node_modules/grunt-jsdoc/package.json claims "version": "0.2.4", which appears to be the latest version.

I installed using the following:

npm install grunt-jsdoc --save-dev

What other information would be helpful?

Fails on Windows

I'm using relative paths

        jsdoc : {
            dist : {
                src: ['appv2/**/*.js'], 
                options: {
                    destination: 'doc'
                }
            }
        }

And getting the following error:

E:\Users\md\Documents\Visual Studio 2010\Projects\MyProject>grunt jsdoc
Running "jsdoc:dist" (jsdoc) task
>> An error occurs in jsdoc process:
>> 'E:\Users\md\Documents\Visual' is not recognized as an internal or external c
ommand,
>> operable program or batch file.
Warning: jsdoc failure Use --force to continue.

Aborted due to warnings.

Cannot read property 'src' of undefined

I've created a very simple configuration for the jsdoc in my gruntfile as follows:

jsdoc : {
    dist : {
        src: ['./scripts/*.js'],
        options: {
            destination: 'doc'
        }
    }
}

I've tried various permutations of what I put in the 'src' property. On running, I get the following error:

Running "jsdoc:dist" (jsdoc) task
Warning: Cannot read property 'src' of undefined Use --force to continue.

I'm on a mac running the latest version of grunt-jsdoc-plugin, downloaded earlier today.

Error installing jsdoc on windows.

I'm running "npm install grunt-jsdoc"

Part of the debug log that gets created has these lines in it

262 info postuninstall [email protected]
263 error Error: spawn ENOENT
263 error at errnoException (child_process.js:975:11)
263 error at Process.ChildProcess._handle.onexit (child_process.js:766:34)
264 error If you need help, you may report this log at:
264 error http://github.com/isaacs/npm/issues

Any help would be gratefully received.

Problems with setting jsdoc path

Hi there,

since the version of jsdoc bundled with the plugin still has a rather annoying bug that prevents me from sucessfully compiling the docs, I have to use a newer dev version of jsdoc. So I installed a newer jsdoc version from git (in another dir) and tried to set a custom jsdoc path as mentioned in your docs:

jsdoc: '/Applications/WebDev/buildTools/jsdoc3/jsdoc'

But, the plugin does not find the executable. I do not know which fault it is, but I noticed the following line in the debug output:

[D] look up node_modules/jsdoc/jsdoc at /Applications/WebDev/buildTools/jsdoc3/jsdoc/

So it seems that "/" is appended to the search path here, so that the jdoc file cannot be found. Also I looked into the source and found line 65 in "jsdoc-plugin.js":

jsDoc = exec.lookup(grunt, jsDocNpmPath, [jsDocPath, 'node_modules/grunt-jsdoc/']);

If I - for testing purposes - change this line to:

jsDoc = jsDocPath;

Then everything works, the newer jsdoc is used and the output is OK.

So I think the Problem is either:

a) me, not correctly specifying the path, or
b) the plugin does not correctly parse this option

Since I think it should just find my custom jsdoc, I tend to b), but I am not 100% sure. Any help / insight is therefore much appreciated!

Issue with relative path?

Running "jsdoc:dist" (jsdoc) task >> No source files defined

For :

    jsdoc : {
        dist : {
            src: ['../dist/src/*.js', '../dist/test/*.js'], 
            options: {
                destination: 'doc'
            }
        }
    }
});`

Unable to locate jsdoc

I still get this error, because my project structure forces me to load the task from another location than the current one (via loadTasks("path/to/jsdoc-contrib")).

The task tries to resolve jsdoc based on the current path (cwd) and not from the script location (__dirname).

Changing the line

var base = 'node_modules/jsdoc/jsdoc',

to

var base = __dirname + '/../node_modules/jsdoc/jsdoc',

would fix this issue.

Support for grunt-collection

Hello,

currently jsdoc is required in node_modules for every folder containing a Gruntfile.js and package.json.
For bigger projects there are grunt-collections where in the project root all needed modules are stored in the node_modules folder.

For now I need to have jsdoc in every subproject node_module folder, to be found from grunt-jsdoc-plugin.

BR,
mybecks

Inclusion of template option failing

Using the template option results in an error.

An error occurs in jsdoc process:
org.mozilla.javascript.EcmaError: TypeError: Cannot find function addEventListeners in object [object Object].
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3785)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3763)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3791)
Warning: jsdoc failure Use --force to continue.

Aborted due to warnings.

removing the template option the task will complete with out error. There seems to be a problem with the setup in grunt-jsdoc/node_modules/jsdoc/jsdoc

If take the command generated from grunt-sjdoc/tasks/lib/exec.js#buildSpawned and pass it directly to my local jsdoc binary instead for the jsdoc shell script in the npm package it runs with out errors.

here is my task configuration

         ,jsdoc:{
             "v2.0":{
                 src:[
                     "README.md",
                     "v2.0/**/*.js"
                 ]
                 ,options:{
                     jsdoc:"bin/jsdoc/jsdoc"
                     ,destination:"work/docs/v2.0"
                     ,configure:"include/docstrap/template/jsdoc.conf.json"
                     ,tutorials:"docs/tutorials"
                 }
             }
         }

Grunt 0.4 Release

I'm posting this issue to let you know that we will be publishing Grunt 0.4 on Monday, February 18th.

If your plugin is not already Grunt 0.4 compatible, would you please consider updating it? For an overview of what's changed, please see our migration guide.

If you'd like to develop against the final version of Grunt before Monday, please specify "grunt": "0.4.0rc8" as a devDependency in your project. After Monday's release, you'll be able to use "grunt": "~0.4.0" to actually publish your plugin. If you depend on any plugins from the grunt-contrib series, please see our list of release candidates for compatible versions. All of these will be updated to final status when Grunt 0.4 is published.

Also, in an effort to reduce duplication of effort and fragmentation in the developer community, could you review the grunt-contrib series of plugins to see if any of your functionality overlaps significantly with them? Grunt-contrib is community maintained with 40+ contributors—we'd love to discuss any additions you'd like to make.

Finally, we're working on a new task format that doesn't depend on Grunt: it's called node-task. Once this is complete, there will be one more conversion, and then we'll never ask you to upgrade your plugins to support our changes again. Until that happens, thanks for bearing with us!

If you have any questions about how to proceed, please respond here, or join us in #grunt on irc.freenode.net.

Thanks, we really appreciate your work!

grunt-jsdoc not working on my mac(10.9)

sh-3.2# grunt jsdoc --force
Running "jsdoc:dist" (jsdoc) task

An error occurs in jsdoc process:
Exception in thread "main"
Warning: jsdoc failure Used --force, continuing.
An error occurs in jsdoc process:
java.lang.NoClassDefFoundError: org/mozilla/javascript/tools/shell/Main
Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.tools.shell.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Warning: jsdoc failure Used --force, continuing.
jsdoc terminated
Warning: jsdoc failure Used --force, continuing.
sh-3.2#

Template producing an error

This is part of my grunt file:

jsdoc : {
  dist : {
    src: [
      jsPath + 'controllers/**/*.js',
      jsPath + 'directives/**/*.js',
      jsPath + 'filters/**/*.js',
      jsPath + 'modules/**/*.js',
      jsPath + 'services/**/*.js',
      jsPath + 'app.js',
    ],
    options: {
      destination: rootPath + 'doc',
      template: 'haruki'
    }
  }
},

When adding

 template: 'haruki'

the error produced is as follows:

js: "C:/folder/folder2/folder3/server/node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc.js", line 306: exception from uncaught JavaScript throw: Error: Unable to load template: Module "haruki/publish" not found.

I'm running a Windows 7 machine.

Could someone help me out, please?

Not all CLI options are passed to jsdoc

If I configure a 'match' or 'query' option, the values aren't passed to the jsdoc CLI:

jsdoc: {
    dist: {
        src: ['tasks/**.js', 'tasks/lib/*.js'],
        options: {
            destination: 'doc',
            match: 'tag',
            query: 'param=value'
        }
    },
},

The options in debug mode show:

[D] { private: true, destination: 'doc' }

And the jsdoc that runs is:

[D] Running : node_modules/jsdoc/jsdoc --private --destination doc tasks/jsdoc-plugin.js tasks/lib/exec.js

I believe the match and query (not sure what query does though, but I noticed it was missing as well when match wasn't there), should be passed to the CLI options?

TypeError: Cannot call method 'split' of undefined

I'am not sure is it a bug, But when I run jsdoc task I got:

->./node_modules/.bin/grunt jsdoc
Running "jsdoc:dist" (jsdoc) task

TypeError: Cannot call method 'split' of undefined
    at module.exports.jsDocLookup (/home/nick/dev/ged/www/ged.js/node_modules/grunt-jsdoc-plugin/tasks/jsdoc-plugin.js:69:19)
    at Object.registerJsdocTask (/home/nick/dev/ged/www/ged.js/node_modules/grunt-jsdoc-plugin/tasks/jsdoc-plugin.js:83:11)
    at Object.task.registerMultiTask.thisTask (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/grunt/task.js:109:15)
    at Object.task.registerTask.thisTask.fn (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/grunt/task.js:58:16)
    at Task.<anonymous> (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/util/task.js:343:36)
    at Task.<anonymous> (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/util/task.js:319:9)
    at Task.<anonymous> (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/util/task.js:346:11)
    at Task.start (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/util/task.js:359:5)
    at Object.grunt.tasks (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/grunt.js:143:8)
    at Object.module.exports [as cli] (/home/nick/dev/ged/www/ged.js/node_modules/grunt/lib/grunt/cli.js:36:9)

The reason is that nodePath is undefined in jsDocLookup function in tasks/jsdoc-plugin.js

So if I run task as

->NODE_PATH=`which node` ./node_modules/.bin/grunt jsdoc

everything seems ok

Error while running jsdoc:dist task in jsdoc's path.js

Hi,

When I try to just compile jsdocs for my project using grunt, I'm getting the following error:

Running "jsdoc:dist" (jsdoc) task
>> An error occurs in jsdoc process:
>> org.mozilla.javascript.EcmaError: TypeError: Cannot read property "length" from undefined

I traced the bug down to something wrong in path.js:56. Since the variable common is undefined, when calling .length() on it, the exception is being thrown.

I know this is a bug upstream with jsdoc, and I'm presently using v0.1.4 (not your newer 0.2.x releases). But, this is the only version that works with the latest, stable grunt release. And I didn't see any reference to this problem in the issue tracker or on the internet, so I'm curious if it's a known issue, and if it's persisting in later releases? Could it be something with my environment? Do you have any suggestion for debugging? I'm doing some really simple stuff, just have a single JSDoc comment in a single JS file that it's running through. Even removing the comment doesn't seem to make a difference. I'm on OS X 10.8.2.

Thanks for your input in advance. And for your grunt plugin.

Daniel

Output to JSON?

The one thing I have always wanted from a doc tool is to output as a sane JSON document. The HTML, etc. is nice, but JSON has the obvious benefit of being independent of display--so it may be formatted gracefully in to any document, formatted in to a printed book, or used for help on a command line or console interface.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1217401-output-to-json?utm_campaign=plugin&utm_content=tracker%2F294645&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F294645&utm_medium=issues&utm_source=github).

Wrong installation/environment

I am getting an error when trying to run jsDoc through Grunt. Here is the terminal output:

Running "jsdoc:dist" (jsdoc) task
>> JAVA_HOME is not set, but java is required by jsdoc to run.
Warning: Wrong installation/environnement Use --force to continue.

Aborted due to warnings.

I don't have the same problem if I run jsDocs via the terminal, and can find java when I run:

~> which java
/usr/bin/java

The solution I found (on OSX) was to add to .bashrc:

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home

Unable to locate jsdoc

I'm getting this error when im running the task.

Running "jsdoc:dist" (jsdoc) task

Unable to locate jsdoc
Warning: Wrong installation/environnement Use --force to continue.

When i look in the plugin folder jsdoc is installed in the following folder:

node_modules/grunt-contrib-jsdoc/node_modules/jsdoc

What am i doing wrong?

Npm install error.

When i try to install the package i get :

pm ERR! Error: ENOENT, chmod '/Users/maartenbaijs/NetBeansProjects/imageCreator/node_modules/grunt-contrib-jsdoc/bin/grunt-contrib-jsdoc'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-contrib-jsdoc"
npm ERR! cwd /Users/maartenbaijs/NetBeansProjects/imageCreator
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.70
npm ERR! path /Users/maartenbaijs/NetBeansProjects/imageCreator/node_modules/grunt-contrib-jsdoc/bin/grunt-contrib-jsdoc
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/maartenbaijs/NetBeansProjects/imageCreator/npm-debug.log
npm ERR! not ok code 0

It seems there is a error in the new 0.2.0 version?

config unknown

0.2.4
Error with parameter options.config: "jsdoc.json"

grunt-jsdoc/node_modules/jsdoc/jsdoc.js", line 286: exception from uncaught JavaScript throw: Error Unknown command line option found: config

In 0.2.3 everything was ok.

Why is "dest" deprecated, all grunt modules use it? Or only dest of jsdoc3 deprecated ?

In README.md line 57 are some texterrors congif and optionnal:

   * `congif` : (optionnal) path to a config file

Fatal error: spawn ENOENT

Hello,
I've been trying to get grunt-jsdoc to work for a while. I'm getting this error in my console whenever I try to run the plugin.

C:\Users\Ajay\Desktop\GruntTut>grunt jsdoc
Running "jsdoc:dist" (jsdoc) task
Fatal error: spawn ENOENT

Here is my Gruntfile.js

module.exports = function(grunt)
{
grunt.initConfig({



   jsdoc : {
        dist : {
            src: ['./scripts/*.js'], 
            options: {
                destination: 'doc'
            }
        }
    }


});

grunt.loadNpmTasks('grunt-jsdoc');

};  

Any help would be much appreciated! I have JAVA_HOME set to: C:\Program Files\Java\jre7

Thanks!
Ajay

The command line is too long.

Running "jsdoc:dist" (jsdoc) task
>> An error occurs in jsdoc process:
>> The command line is too long.
Warning: jsdoc failure Use --force to continue.

For a heavy src, these seems more like a java issue :/

NPM Documentation Typos

I noticed two typos on the NPM module page:

The old package name is still used for initializing the library within Grunt:

grunt.loadNpmTasks('grunt-contrib-jsdoc');

Also, in the options documentation, "optional" is misspelled ("optionnal")

Depend on published version of jsdoc3

If there is an npmjs-published version of jsdoc3 that could be added as a dependency, that would be preferable to the current git+https url. At least on Windows, this makes git a dependency for running npm install on grunt-jsdoc-plugin.

JsDoc produces no documentation and no errors

Using grunt-jsdoc v 0.4.0, I cannot get any documentation output from my project. I've attached a complete gist with the debug output here and you can view my project on Github: OJ.

If I run grunt jsdoc with only a single file, in the doc folder specified I get an index.html file with a single link to Main, which points to file:///C:/. If I run it against all of my JS files, I get an index.html file with links to only 2 classes, each with a single method defined. No errors are reported in either case.

I'm a bit perplexed. I have scrupulously documented nearly every public and private method in my codebase with jsdoc3 style comments.

Further, grunt-jsdoc does not seem to be recognizing the additional options I specify, such as for the markdown plugin and the verbose output.

FR : Option for file exclusions

jsdoc : {
       dist : {
          src: '../dist/js/', 
          exclude: ['lib/util.js','test'],
           options: {
               destination: 'doc'
            }
         }
}

It would be useful to exclude few files and folders like the above?

Where exclude excludes certain specified paths relative to the src path.

Contrib

Hi, I'm on the grunt team. I noticed you're still using contrib in your plugin name on npm. The grunt-contrib namespace is reserved for tasks maintained by the grunt team. I would kindly ask you to remove contrib from the name of the npm package. Thanks.

jsdoc template option

It would be nice to set different templates in the options. I want to use the (http://orgachem.github.com/JsDoc2-Template-Bootstrap/) template.

jsdoc : {
            options: {
                template: 'bootstrap'
            },
            dist : {
                src: ['lib/app.js'],
                dest: 'doc'
            }
        }

Not sure if this would be the best way but the easiest way would be to put the template files in: {Project Folder}/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/bootstrap

Template

Is this defaulting to a non-standard template? Is it possible to instead default to the standard jsdoc template?

npm install fails on Linux

w@w:~$ npm install grunt-jsdoc
npm http GET https://registry.npmjs.org/grunt-jsdoc
npm http 304 https://registry.npmjs.org/grunt-jsdoc
npm http GET https://registry.npmjs.org/async/0.1.22
npm http GET https://registry.npmjs.org/js2xmlparser/0.1.0
npm http GET https://registry.npmjs.org/jshint/0.9.1
npm http GET https://registry.npmjs.org/underscore/1.4.2
npm http GET https://registry.npmjs.org/wrench/1.3.9
npm http 304 https://registry.npmjs.org/wrench/1.3.9
npm http 304 https://registry.npmjs.org/js2xmlparser/0.1.0
npm http 304 https://registry.npmjs.org/underscore/1.4.2
npm http 304 https://registry.npmjs.org/async/0.1.22
npm http 304 https://registry.npmjs.org/jshint/0.9.1
npm ERR! git fetch -a origin (git://github.com/dominictarr/crypto-browserify.git) error: cannot open FETCH_HEAD: ???????? ? ???????
npm ERR! Error: git "fetch" "-a" "origin" failed with 1
npm ERR! at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:56:20)
npm ERR! at ChildProcess.EventEmitter.emit (events.js:99:17)
npm ERR! at maybeClose (child_process.js:638:16)
npm ERR! at Process._handle.onexit (child_process.js:680:5)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 3.2.0-38-generic-pae
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "grunt-jsdoc"
npm ERR! cwd /home/w/project
npm ERR! node -v v0.8.18
npm ERR! npm -v 1.2.2
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/w/project/npm-debug.log
npm ERR! not ok code 0

variable number of parameters with mixed type

/**
 * Abcdef
 * @param {...*} abc
 */

generates an error:

An error occurs in jsdoc process:
js: "/node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc.js",
line 304: exception from uncaught JavaScript throw:
Error: cannot create a doclet in the file test.js for the comment
"/* * Abcdef * @param {...} abc */":
unable to parse the type expression "...
": Expected "$", "", "_",
Unicode letter number, Unicode lowercase letter, Unicode modifier letter,
Unicode other letter, Unicode titlecase letter or Unicode uppercase
letter but "
" found.

The same goes for {...?} I tried also {...(undefined|boolean|null|string|number|Object)} but that fails also :/

I'm using "grunt-jsdoc"

Missing JAVA_HOME envvar leads to confusing message

The message "JAVA_HOME is not set. Jsdoc requires Java to run." is misleading since it implies that the missing JAVA_HOME envvar will cause JSDoc to fail which is not the case if the java executable is on the PATH (or similar for Windows).

I propose a change of the message that better reflects reality:

"JAVA_HOME is not set. Jsdoc may fail if it cannot find the java executable."

Better yet, grunt-jsdoc-plugin shouldn't check for a Java installation at all since the error message printed out by jsdoc itself is pretty self-explanatory:

>> node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc: 40: node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc: java: not found

This is related to #34.

Multiple documentation engines

Refactor the task and the configuration to be able to select the documentation engine. The following engines may be implemented:

  • jsdoc3 (the default engine, as it is now)
  • jsdoc-toolkit
  • dox
  • docco

Find a better way to load jsDoc

As jsdoc3 isn't yet wrapped in a proper module, I can't use require to load him and to resolve the path.
I have to check if the file exists in the common locations:

  • ./nodes_modules/jsdoc
  • ./node_modules/grunt-jsdoc-plugin/nodes_modules/jsdoc
  • or in each NODE_PATH entry

Any advise is welcome

Cannot install grunt-jsdoc

When running npm install grunt-jsdoc I get the following error. Please advise.

npm ERR! git fetch -a origin (https://github.com/hegemonic/taffydb.git) error: cannot open FETCH_HEAD: Permission denied
npm ERR! git fetch -a origin (https://github.com/jsdoc3/markdown-js.git) error: cannot open FETCH_HEAD: Permission denied
npm ERR! git fetch -a origin (https://github.com/dominictarr/crypto-browserify.git) error: cannot open FETCH_HEAD: Permission denied
npm ERR! Error: Command failed: error: cannot open FETCH_HEAD: Permission denied
npm ERR!
npm ERR!
npm ERR! at ChildProcess.exithandler (child_process.js:637:15)
npm ERR! at ChildProcess.EventEmitter.emit (events.js:98:17)
npm ERR! at maybeClose (child_process.js:735:16)
npm ERR! at Socket. (child_process.js:948:11)
npm ERR! at Socket.EventEmitter.emit (events.js:95:17)
npm ERR! at Pipe.close (net.js:466:12)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Darwin 12.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-jsdoc" "--save-dev"
npm ERR! cwd /Users/vachandran/Dropbox/Projects/nnet
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.7
npm ERR! code 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/vachandran/Dropbox/Projects/nnet/npm-debug.log
npm ERR! not ok code 0

Grunt 0.4 Release

I'm posting this issue to let you know that we will be publishing Grunt 0.4 on Monday, February 18th.

If your plugin is not already Grunt 0.4 compatible, would you please consider updating it? For an overview of what's changed, please see our migration guide.

If you'd like to develop against the final version of Grunt before Monday, please specify "grunt": "0.4.0rc8" as a devDependency in your project. After Monday's release, you'll be able to use "grunt": "~0.4.0" to actually publish your plugin. If you depend on any plugins from the grunt-contrib series, please see our list of release candidates for compatible versions. All of these will be updated to final status when Grunt 0.4 is published.

Also, in an effort to reduce duplication of effort and fragmentation in the developer community, could you review the grunt-contrib series of plugins to see if any of your functionality overlaps significantly with them? Grunt-contrib is community maintained with 40+ contributors—we'd love to discuss any additions you'd like to make.

Finally, we're working on a new task format that doesn't depend on Grunt: it's called node-task. Once this is complete, there will be one more conversion, and then we'll never ask you to upgrade your plugins to support our changes again. Until that happens, thanks for bearing with us!

If you have any questions about how to proceed, please respond here, or join us in #grunt on irc.freenode.net.

Thanks, we really appreciate your work!

The input line is too long

@krampstudio I am getting the following issue and I am on a windows 7 machine.

Running "jsdoc:dist" (jsdoc) task
An error occurs in jsdoc process:
The input line is too long.
Warning: jsdoc failure Use --force to continue.
Aborted due to warnings.

I did some investigation and there was a one particular file which creates this issue on my project. Then I delete all content in the file and try to generate the document. But that did not resolve the issue. However when I add a exclude to that particular file in config, then it resolve the issue and create the documentation.

I have successfully created the documentation for same project using JSDoc Rhino version. But I am willing to integrate JSDoc creation to my grunt build process. It would be great if you can help it out.

Nothing generated?

I followed the setup to the letter for a Windows install, and all signals are that everything runs ok, but nothing is generated in the index.html file. I gotta be missing something here. In my gruntfile I have:

...
    jsdoc: {
        dist : {
            src: ['app/*.js'], 
            options: {
                destination: 'doc'
            }
        }
    }
...
    grunt.loadNpmTasks('grunt-jsdoc');
...

I also have the following file, test.js, in the app folder that hangs off the root relative to the gruntfile.js:

//** Testing comments in JSDocs */   
function test(){
    console.log('Testing JSDoc');
}

When I run > grunt jsdoc at the command prompt, I get a doc directory with scripts and styles directories, plus an index.html file at the root of doc. However, the index.html does not have any parsing of the comments in the one test file....what am I missing?

Java versions reported are:

java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

Thanks...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.