如何从PyPi中删除文档

9 投票
2 回答
841 浏览
提问于 2025-04-16 20:31

我刚发现有个很老的文档版本可以直接在 http://pypi.python.org/pypi/gensim 这个链接上找到(就在页面顶部,标注为 Package Documentation)。我可能在很久以前第一次尝试使用PyPi的时候测试过这个功能。

现在我这个包的真正文档是在其他地方维护的。我想把那个PyPi的链接和那个没用的页面去掉。有没有办法做到这一点?


到目前为止,我通过PyPi的包管理界面“重新上传”了一个包含空的index.html的zip文件。我想这样至少能给那些不幸点击了PyPi文档链接的用户提供一个空白页面。有没有办法完全删除它?

但是“上传什么都不上传”或者“上传一个空的zip”都不行,PyPi会检查zip文件,里面必须包含一个index.html文件。

2 个回答

4

Pypi 最近新增了一个选项,可以删除文档。

登录你的包后,现在有一个选项叫做 删除文档

在这里输入图片描述

10

只需要创建一个新的 index.html 文件,里面放上指向新文档的链接,或者直接设置一个重定向:

<html>
    <head>
        <title>A web page that points a browser to a different page after 2 seconds</title>
        <meta http-equiv="refresh" content="2; URL=http://www.example.com">
        <meta name="keywords" content="automatic redirection">
    </head>
    <body>
        {PACKAGE_NAME}'s documentation is maintained elsewhere.
        You will be redirected to the new documentation within 2 seconds.
        If the browser does not automatically redirect you, you may want to go to <a href="http://www.example.com">the destination</a> manually.
    </body>
</html>

然后把这个文件压缩成一个.zip文件,接着去 http://pypi.python.org/pypi 网站。登录后,找到你包的管理页面。在那里,你会看到一个按钮,可以上传刚才压缩的文档:

在这里输入图片描述

撰写回答