js-dossier icon indicating copy to clipboard operation
js-dossier copied to clipboard

how to add namespace description?

Open myphysicslab opened this issue 9 years ago • 3 comments

Namespaces occupy a prominent place in the docs now, and they have a nice list of Interfaces and Classes. But they always say "No description available" underneath the namespace name at top.

I've tried adding variants of the @namespace tag as shown at http://usejsdoc.org/tags-namespace.html but nothing has worked so far.

It's unclear where that tag would be added, however when I click on the "show source" button it takes me to the goog.provide statement of one of the classes of the namespace and I've tried adding the @namespace tag there. For the myphysicslab.lab.app namespace:

/** Helper classes for applications
@namespace
*/
goog.provide('myphysicslab.lab.app.EventHandler');

I've also tried

/** Helper classes for applications
@namespace myphysicslab.lab.app
*/
goog.provide('myphysicslab.lab.app.EventHandler');

myphysicslab avatar Aug 27 '16 00:08 myphysicslab

You can't add a namespace description. I should probably change that to not output anything when a description is missing.

If you use goog.module (or an ES6 module), it will use the block comment with a @fileoverview tag as the module description. We can't do that for namespaces since you could have multiple goog.provide statements in a file.

With respect to the @namespace tag - is that recognized by the compiler? I want the code you run through dossier to be valid input for the closure compiler without extra tag declarations.

jleyba avatar Sep 11 '16 01:09 jleyba

With respect to the @namespace tag - is that recognized by the compiler? I want the code you run through dossier to be valid input for the closure compiler without extra tag declarations.

You can use the compiler option --extra_annotation_name which specifies "a whitelist of tag names in JSDoc."

A set of extra annotation names which are accepted and silently ignored when encountered in a source file.

But would need to invent some way to gather the information for the namespaces.

BTW, the list of interfaces & classes in a namespace has disappeared, would be nice to get that back.

myphysicslab avatar Apr 17 '17 20:04 myphysicslab

So do you just ignore @fileoverview tags in files using goog.provide? Many of the closure-library files have useful @fileoverview's, that seem to disappear in the docs. For example: https://github.com/google/closure-library/blob/master/closure/goog/dom/animationframe/animationframe.js#L99 Maybe you could attach them to the first provided namespace? Or even all of them?

ribrdb avatar Jun 01 '17 04:06 ribrdb