mozilla / sphinx-js

Autodoc-style extraction into Sphinx for your JS project
https://pypi.python.org/pypi/sphinx-js/
MIT License
282 stars 81 forks source link

How to document entire module #138

Closed munawarb closed 4 years ago

munawarb commented 4 years ago

I have a module like this:

module.exports = exports = {
    /**
    ...
    **/
    someFunction: (...args) => {...},
    ...
};

In my index file I'm explicitly writing directives like .. autofunction:: someFunction. Is there a way to have SphinxJS automatically iterate over my module and build the documentation instead of me writing a directive for each function? I've looked at the module directive but am confused by it. Is there any way to achieve this like we can with autoclass? Or do I have to convert my module into a class to get this functionality with auto-iterating over members?

erikrose commented 4 years ago

It's a great idea! There's no automodule directive yet, but it shouldn't be too hard to add one. See #5.