documentationjs/documentation

File-level comments misapplied

deg-basis opened this issue · 1 comments

Using Documentation 13.2.5 and running it through yarn with the command

"documentation build --github --markdown-toc --config documentation.yml -f html src/utils/** -o docs/jsDocumentation"

I want to supply file-level documentation. My source file has:

/**
 * @file Utilities to manage Event Schema Files (.esf files)
 * @author David Goldfarb
 */

/**
 * Just a random function.
 */
const f = () => 42;

The file comments are applied to a ghost second copy of f:

image

I think this could be solved by including a file-level JSDoc comment at the top of your file :

/**
 * Utilities to manage Event Schema Files (.esf files)
 * @module utils/esf
 */

/**
 * Just a random function.
 * @function
 * @name f
 * @returns {number} The answer to everything.
 */
const f = () => 42;

When you run the documentation command to generate documentation, you should include the file or files that you want to generate documentation for(like for example esf.js) :

"documentation build --github --markdown-toc --config documentation.yml -f html src/utils/esf.js -o docs/jsDocumentation"

When the documentation is generated, the file-level JSDoc comment will appear at the top of the generated documentation, and the function-level comments will appear in their respective sections.