简体   繁体   English

使用 pdoc 记录来自不同模块的函数

[英]Document functions from different modules using pdoc

I've got two modules:我有两个模块:

first_module containing functions a , b and c first_module包含函数abc

second_module containing functions d , e and f second_module包含函数def

I would like to generate an HTML documentation using pdoc such that it doesn't document both modules in whole, but rather contains only functions b , e , and f .我想使用pdoc生成HTML文档,这样它不会完整记录两个模块,而是仅包含函数bef

Any ideas?有任何想法吗?

You can declare __all__ in your modules as pdoc respects it .你可以在你的模块中声明__all__ ,因为pdoc 尊重它

You can override some docstrings with a __pdoc__ dict in each module:您可以在每个模块中使用__pdoc__ dict覆盖一些文档字符串:

# first_module.py:
___pdoc___ = {
    'a': False,
    'c': False,
}

and:和:

# second_module.py:
___pdoc___ = {
    'd': False,
}

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

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