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
If a module has an if __name__ == '__main__: block, the first element is analysed and its documentation is generated. The next ones are ignored. This is regardless if it the first a variable or a function.
I expect the behaviour to be that everything in if __name__ == '__main__: blocks would be ignored like sphinx-autodoc does.
Minimal working example:
Analysing
defnormal_function():
""" Function with docstring """passif__name__=='__main__':
defnew_example():
""" This function will appear in the docs """passthis_variable_is_ignored=52
gives
When variable is first, this appears in the docs while the function new_example is ignored.
The text was updated successfully, but these errors were encountered:
If a module has an
if __name__ == '__main__:
block, the first element is analysed and its documentation is generated. The next ones are ignored. This is regardless if it the first a variable or a function.Uses python 3.11, sphinx-autoapi 3.0.0, Sphinx 7.2.6
I expect the behaviour to be that everything in
if __name__ == '__main__:
blocks would be ignored like sphinx-autodoc does.Minimal working example:
Analysing
gives
When variable is first, this appears in the docs while the function
new_example
is ignored.The text was updated successfully, but these errors were encountered: