Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File-level comments misapplied #1384

Open
deg-basis opened this issue Jul 13, 2021 · 1 comment
Open

File-level comments misapplied #1384

deg-basis opened this issue Jul 13, 2021 · 1 comment

Comments

@deg-basis
Copy link

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

@Shiva953
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants