documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Option to automatically group files in modules

Open killercup opened this issue 10 years ago • 6 comments

I'm a big fan on inferring documentation properties from code: I'm using documentation.js mainly because it allows me to omit the ‘boring’ parts of doc comments by using Flow types. Similarly, since my code uses CommonJS/ES2015 import/exports, I've never seen the value in manually adding JSDoc's @module tag to all my files.

Thus, I want to suggest a new option for documentation.js: Infer modules from file names.

Let's say I have a src/foo/bar.js. Its module name is the same as the name I can require() or import it with, i.e. foo/bar.

I'm not sure what your plans for handling modules/grouping documentation items is in general, but for larger projects, I'd like to see a documentation.js theme that lists entries in a tree instead of a flat list.

Ideally, this would also allow me to see which items are exported from a module.

killercup avatar Nov 08 '15 18:11 killercup

Should follow the guidelines in JSDoc as well for module resolution.

The @module tag marks the current file as being its own module. All symbols in the file are assumed to be members of the module unless documented otherwise.

If the module name is not provided, it is derived from the module's path and filename.

http://usejsdoc.org/tags-module.html

carbonrobot avatar Dec 30 '15 14:12 carbonrobot

Related #183

carbonrobot avatar Dec 30 '15 15:12 carbonrobot

is there another doc generator which can group function/classes/$things into modules? I don't want to show a list with hundreds of functions without any hierarchy or structure. ohh... here's the catch: it should have ES7 support

chpio avatar Mar 05 '16 23:03 chpio

It could be this doc generator, if you help out with a PR!

tmcw avatar Jul 28 '17 16:07 tmcw

I wish this too, so far I used the documentation.yml config workaround to describe a non-flat hierarchy as described here: https://github.com/documentationjs/documentation/blob/master/docs/CONFIG.md

With a drawback, existing groups defined in yml duplicates TOC of that group :(

AndyOGo avatar Nov 30 '17 20:11 AndyOGo

Has anyone made any progress on this? As commented on #803 I'd be happy to help, but have no idea where to start.

DonGissel avatar Aug 07 '18 09:08 DonGissel