readme
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseREADME Guidelines
README 编写指南
Each top-level package directory (e.g., ) has a symlink pointing to the actual README inside the package (e.g., ). Only edit the README inside the package itself.
plain-api/README.mdplain-api/plain/api/README.mdSee as a good example.
plain-jobs/plain/jobs/README.md每个顶层包目录(例如 )都有一个 符号链接,指向包内部的实际README文件(例如 )。仅编辑包内部的README文件。
plain-api/README.mdplain-api/plain/api/README.md可参考 作为优秀示例。
plain-jobs/plain/jobs/README.mdPurpose
目的
The README answers: "How do I use this?" It gets users productive quickly and points them to code for deeper exploration. It is not a complete API reference.
README需要回答:“我该如何使用这个包?” 它要帮助用户快速上手,并引导他们查看代码以进行深入探索。它并非完整的API参考文档。
Required Structure
必备结构
Every README follows this order:
- h1 with package name
- Bold one-liner describing the package
- Table of contents with links to h2s and h3s
- Overview section with basic working examples
- Feature sections as needed
- FAQs section (second to last) using h4s for questions
- Installation section (always last)
所有README都需遵循以下顺序:
- 一级标题(h1):包名称
- 加粗单行描述:包的简介
- 目录:包含指向二级和三级标题的链接
- 概述部分:包含基础可运行示例
- 功能模块部分:按需添加
- **常见问题(FAQs)**部分:倒数第二部分,使用四级标题(h4)作为问题
- 安装部分:始终放在最后
Style
风格规范
- Conversational tone: "You can..." not "The module provides..."
- First code example must be copy-paste ready with imports included
- Subsequent examples can be minimal, building on what was shown
- Link to source for advanced features:
[ClassName](./file.py#ClassName) - Cross-package references:
[plain.auth](../../plain-auth/plain/auth/README.md)
- 口语化语气:使用“你可以……”而非“该模块提供……”
- 首个代码示例必须可直接复制粘贴使用,包含导入语句
- 后续示例可简化,基于前面展示的内容扩展
- 高级功能链接至源码:
[ClassName](./file.py#ClassName) - 跨包引用:
[plain.auth](../../plain-auth/plain/auth/README.md)
What to Document
需记录的内容
- If users import it, document it
- Mention all public features, even advanced ones briefly, then link to code
- Internal APIs stay undocumented (functions and
_prefix)@internalcode - Don't fully document every parameter - mention features exist, link to code
- 只要用户会导入的内容,都需要记录
- 提及所有公开功能,即使是高级功能也要简要说明,然后链接至代码
- 内部API无需记录(带有前缀的函数和
_装饰的内容)@internalcode - 无需详细记录每个参数——只需说明功能存在,然后链接至代码
Writing Tips
编写技巧
- Keep paragraphs short
- Put takeaways up front
- Use bullets and tables
- Bold important text
- Keep sentences simple and unambiguous
- 段落简短
- 重点内容前置
- 使用项目符号和表格
- 重要文本加粗
- 句子简洁明确