简体   繁体   English

关于Github和PyPi的自述文件

[英]Readme on Github and PyPi

I have my python library on pypi and github. 我在pypi和github上有我的python库。 There's only one README file in it which is README.md and it's displayed properly on github. 其中只有一个README文件,即README.md,它已正确显示在github上。 But on pypi it doesn't, it's shown as a plain text. 但是在pypi上却没有,而是显示为纯文本。 How come and what can I do about it? 怎么来的,我该怎么办?

Preferably without involving a third-party libraries such as Pandoc. 最好不要涉及第三方库,例如Pandoc。

Please refer to this posting . 请参阅此帖子

To quote the relevant section: 引用相关部分:

Every package on PyPI needs to have a file called setup.py at the root of the directory. PyPI上的每个软件包都需要在目录的根目录下有一个名为setup.py的文件。 If your'e using a markdown-formatted read me file you'll also need a setup.cfg file. 如果您使用的是markdown格式的自述文件,则还需要setup.cfg文件。

setup.cfg setup.cfg

This tells PyPI where your README file is. 这告诉PyPI您的自述文件在哪里。

[metadata] [元数据]

description-file = README.md 说明文件= README.md

This is necessary if you're using a markdown readme file. 如果您使用Markdown自述文件,则这是必需的。 At upload time, you may still get some errors about the lack of a readme — don't worry about it. 在上载时,您可能仍然会因缺少自述文件而出现一些错误-不必担心。 If you don't have to use a markdown README file, I would recommend using reStructuredText (REST) instead. 如果您不必使用markdown自述文件,则建议您使用reStructuredText(REST)。

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

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