4

Background

I am documenting my own JS library, and I stumbled upon the lodash library ( https://lodash.com/docs/4.17.4 ).

It's documentation has a sidebar with categories ( Array, Collection, ect ) and each one has documentation for the functions.

Objective

I would like my documentation to have a similar structure using the latest JSDoc version.

Problem

After investigating I couldn't find the jsdoc template used by lodash. I also couldn't find a similar feature nor how to replicate it using JSDOC.

Questions

  • Which JSDoc template is lodash documentation using?
  • If the template is irrelevant, how can I have categories in my documentation?
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266

3 Answers3

5

I've just released a new version of better-docs jsdoc template and it supports @category tag. Just add it to your class/module/whatever and it will be namespaced in the sidebar.

https://github.com/SoftwareBrothers/better-docs

wojtekk
  • 606
  • 7
  • 7
3

Solution

After much research I concluded that adding a @category with jsdoc was impossible. In fact, many have tried before and failed:

The only way to somehow simulate this behavior is to use @namespace, but this solution is heavy in drawbacks and is limited in scope:

Still, until such a feature is supported, this is what I am using.

Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
0

Just wanted to share an answer that I finally had for once on stackoverflow. You can indeed add @category tags to your JSDoc, you just need to install this plugin via config file:

itsbhenry
  • 11
  • 2