Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法为使用 pip 安装的软件包安装/生成文档?
我希望安装项目所需的所有包,以及所有相关文档(例如,安装 django 时的 Django 文档、带有 dateutil 的 dateutil 文档等)。
Pip 需求文件是快速安装项目所需包的好方法,但如果我也可以安装所有相关文档会更好。
Ubuntu Python 软件包将文档安装到 /usr/share/docs,但 pip 似乎没有这样做。
当我需要离线处理项目时,这些包的文档对我来说很重要。
我认为您正在寻找与 ruby 自动(除非被抑制)从已安装的 gems/packages 生成 rdoc 的方式等效的方法。
在 python 中,有一种用文档注释代码的标准化机制——带有可选格式的文档字符串。但是,没有从 python 代码生成/存储文档的标准化方法。每个 python 包可能有不同的机制,因此 pip 无法生成它。