typescripttypedoc

Why sometimes the top-most comment in TSDoc doesn't show in the generated documentation?


I'm using TSDoc to document my TypeScript project and using TypeDoc to generate HTML documentation.

I can't seem to find the answer as to why sometimes the top comment in the file shows up in the generated documentation (which is useful to explain the purpose of a whole file) and sometimes it doesn't.

I tried pasting a top comment that works in a file into another file but it didn't show up. The comment is properly formatted. This is the comment, in case it's relevant:

/**
 * This file provides functions for interacting with CNPJ data.
 * You might want to use some more complex functions from the **cpf_cnpj** library.
 */

Does anyone know why it happens and how can I work around this issue?


Solution

  • This depends on whether there is another comment between the top comment and any other expressions. The fix is to follow your top level comments with another doc comment.

    /**
     * This file provides functions for interacting with CNPJ data.
     * You might want to use some more complex functions from the **cpf_cnpj** library.
     */
    /** End file docs */
    

    More context is found in this issue.