简体   繁体   English

Sphinx 文档 - 排除层次结构中所有模块的 class 变量

[英]Sphinx Documentation - Exclude class variables for all the modules in the hierarchy

I'm trying to remove all the class variables from my Sphinx documentation (because I haven't documented them and it doesn't look good if there's only a list of them) for all the classes of my project including the modules in the folders.我正在尝试从我的 Sphinx 文档中删除所有 class 变量(因为我没有记录它们,如果只有它们的列表,它看起来不太好)我项目的所有类,包括文件夹中的模块. Is there an easy way to do it without having to exclude each one of them?有没有一种简单的方法可以做到这一点而不必排除其中的每一个?

PS: I'm a beginner at this, so the answer could be something easy. PS:我是这方面的初学者,所以答案可能很简单。 Also, this could already be answered, but I couldn't find anything.此外,这已经可以回答,但我找不到任何东西。

You can use :no-undoc-members: to tell sphinx to ignore the undocumented (in your case the class) variables.您可以使用:no-undoc-members:告诉 sphinx 忽略未记录的(在您的情况下为类)变量。

:undoc-members: (no value)
    If set, autodoc will also generate document for the members not having docstrings:

Here is the documentation - https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-option-automodule-undoc-members这是文档 - https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-option-automodule-undoc-members

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM