Creating Javascript Documentation

I am looking for a way to generate documentation automatically from my Javascript project . Does anyone know how I can do this?

As far as I know, there are tools like JSDoc , but I want to know your opinion, your best choice and why.

Thank!

EDIT: just to be clear, I need something like JavaDOC or PHPDocumentor, but for use with my Javascript source code.

+43
javascript documentation
Apr 30 2018-11-11T00:
source share
7 answers

I found a great tutorial for creating JS documentation using JSDoc. I hope this helps someone who needs it.

Create useful Javascript documentation with JSDoc

That was exactly what I needed. Thanks for your answer stackers.

+9
May 30 '11 at 10:32 a.m.
source share

There are tools for this, such as Natural Docs . I have personally used it in the past and this works great with javascript.

There are also tools like docco for documenting source code.

In general, auto-generated documentation tends to be too restrictive, and sometimes manual APIs like the jQuery API are easier to use.

The documentation for dynamic languages ​​is also different from the documentation for static languages. Since the APIs are used in different ways, and the state exists in a freer sense.

+11
Apr 30 2018-11-11T00:
source share

If you are working with node.js, I created a module that generates a class diagram for javascript / node / html / css. It is based on the WAE UML extension. He is called wavi. For javascript, the function, variable, and use of other modules are automatically recognized. You can use it to document your application.

https://www.npmjs.org/package/wavi

Diagram generated by wavi

+5
Nov 29 '14 at 5:18
source share

SmartComments + YUIDocs

Using this unusual pair, you can document a large JavaScript project in less than one minute.

SmartComments is a tool that allows you to create implicit comments from JavaScript source code.

You can use it in the console or through the Sublime Text Plugin.

For more information, go to http://smartcomments.imtqy.com .

+4
Oct 30 '13 at 20:27
source share

autodoc is doping; https://www.npmjs.org/package/autodoc | https://github.com/dtao/autodoc

Autodoc allows you to write tests in comments directly above your JavaScript functions, and then run these tests from the command line and automatically generate documentation with the same tests that are built-in and run directly in the browser.

Think literate programming, look at http://danieltao.com/lazy.js/docs/ for a nice example. These green checkmarks are tests.

 βœ“ Lazy([1, 2, 4]) // instanceof Lazy.ArrayLikeSequence βœ“ Lazy({ foo: "bar" }) // instanceof Lazy.ObjectLikeSequence βœ“ Lazy("hello, world!") // instanceof Lazy.StringLikeSequence βœ“ Lazy() // sequence: [] βœ“ Lazy(null) // sequence: [] 

Here is what github.com/../lazy.js # L86 source looks like

 /** * Wraps an object and returns a {@link Sequence}. For `null` or `undefined`, * simply returns an empty sequence (see {@link Lazy.strict} for a stricter * implementation). * * - For **arrays**, Lazy will create a sequence comprising the elements in * the array (an {@link ArrayLikeSequence}). * - For **objects**, Lazy will create a sequence of key/value pairs * (an {@link ObjectLikeSequence}). * - For **strings**, Lazy will create a sequence of characters (a * {@link StringLikeSequence}). * * @public * @param {Array|Object|string} source An array, object, or string to wrap. * @returns {Sequence} The wrapped lazy object. * * * @examples * Lazy([1, 2, 4]) // instanceof Lazy.ArrayLikeSequence * Lazy({ foo: "bar" }) // instanceof Lazy.ObjectLikeSequence * Lazy("hello, world!") // instanceof Lazy.StringLikeSequence * Lazy() // sequence: [] * Lazy(null) // sequence: [] */ 

It extends JSDoc https://developers.google.com/closure/compiler/docs/js-for-compiler , so you can have a Google closure compiler that checks and optimizes a lot for you.

+3
Mar 16 '14 at 22:03
source share

What structure are you using? (if there's). I think the tool you choose depends on this, because ideally he will have to understand class extensions and that’s it. Otherwise, I think jsDoc is a great place to start.

0
Apr 30 '11 at 12:35
source share

Hi, I just found YUIDoc . I know little about it, but it looks good ...

0
Oct 10 '13 at 7:21
source share



All Articles