You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have seen this new project idea where we have to create docs automatically from scancode data, these can be done using automodule method from autodoc extension,
but as @AyanSinhaMahapatra you mentioned on gitter that "we want something that parses more specifically, since the data we want to show, is only a small part of the classes, i.e. there will be (a lot) of functions and methods also documented which we don't want. We likely have to craft something similar but more specific to our requirements, which only takes out certain docstrings/class attributes having the documentation for that data field, and creates the doc from there."
Solution
autodoc is an extension of the sphinx which is used to Include documentation from docstrings that is available inside the source code, so there are many in-built methods that are available in the autodoc extension like automodule, autoclass and autoexception etc.
.. automodule:: : which can be used to import any source file having all the classes and functions
.. autoclass:: : which can be used to import any class inside the source program.
The key to using these features is the :members: attribute. If:
If we don’t include it at all, only the docstring for the object is brought in:
For example if we import api.py from src/scancode then sphinx will only parses this dockstring
if we just use :members: with no arguments, then all public functions, classes, and methods are brought it that have a docstring.
If we explictly list the members like :members: <function_1>, <function_2>, <function_3> those explict members are brought.
Description
I have seen this new project idea where we have to create docs automatically from scancode data, these can be done using automodule method from autodoc extension,
Solution
autodoc is an extension of the sphinx which is used to Include documentation from docstrings that is available inside the source code, so there are many in-built methods that are available in the autodoc extension like automodule, autoclass and autoexception etc.
For more refer this
So like this way, we can only parse that data that we want to show in docs
@MaJuRG and @AyanSinhaMahapatra need your suggestion on this solution
looking forward to your reply
Select Category
The text was updated successfully, but these errors were encountered: