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

add js autodoc default options #175

Open xsjad0 opened 3 years ago

xsjad0 commented 3 years ago

This allows us to omit the options :members: and private-members on every single autoclass directive.

conf.py

js_autodoc_default_options = {
    "members": True,            # by default False
    "private-members": True,    # by default False
}

JavaScript source

/**
 * TestClass
 */
class TestClass {
    /**
     * A.
     */
    a() {}

    /**
     * B.
     */
    b() {}

    /**
     * C.
     * @private
     */
    c() {}
}

.rst file

.. js:autoclass:: TestClass

html result

image

Notable changes: