The GitHub Blog 05月15日 00:03
Documentation done right: A developer’s guide
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文强调了项目文档对于协作、新手入门和提高采用率的重要性。清晰的文档确保团队和外部人员理解项目,促进独立解决问题,加速新成员融入。易于理解的文档能吸引更多用户。文章提出了编写文档的关键原则:使用简单易懂的语言,保持简洁,避免过多细节,以及保持结构化,优先呈现重要信息,使用标题和目录,突出重点,保持风格一致。此外,文章还介绍了Diátaxis框架,将文档分为教程、操作指南、解释和参考四类,方便用户查找所需信息,并帮助开发者识别缺失的文档。

✍️文档提升协作效率:清晰一致的文档确保团队成员和外部利益相关者对项目有统一的理解,促进独立解决问题,节省核心贡献者回答重复问题的时间。

🚀加速新手入门:通过提供入门指南、解释核心概念和包含教程式内容,优秀的文档能够帮助新团队成员快速上手项目。

✅文档结构化原则:文档应遵循结构化原则,包括优先呈现重要信息,使用标题和目录,以及利用文本高亮和格式化元素帮助读者快速浏览和理解内容。

📚Diátaxis框架:该框架将文档分为四类:教程(学习导向)、操作指南(目标导向)、解释(提供理解)和参考(技术规范),有助于用户快速找到所需信息。

🛠️实战演练:文章提供了一个示例仓库,包含文档目录结构和文档模板,方便开发者将其复制到自己的项目中进行实践。

With all the work involved in creating and maintaining a project, sometimes writing documentation can slip through the cracks. However, good docs are a huge asset to any project. Consider the benefits:

With these benefits in mind, let’s take a look at some important principles of documentation, then dive into how you can quickly create effective docs for your project.

Key tenets of documentation

There are three key principles you should follow as you document your project.

Key tenets of documentation

Use plain language that’s easy to understand. The goal is to make your documentation as accessible as possible. A good guideline is to ask yourself if there are any acronyms or technical terms in your documentation that some folks in your target audience won’t understand. If that’s the case, either swap them for simpler language, or make sure they’re defined in your document.

Keep it concise

Document only necessary information. Trying to cover every possible edge case will overwhelm your readers. Instead, write docs that help the vast majority of readers get started, understand core concepts, and use your project.

Additionally, keep each document focused on a particular topic or task. If you find yourself including information that isn’t strictly necessary, move it into separate, smaller documents and link to them when it’s helpful.

Keep it structured

Consider the structure of each document as you write it to make sure it is easy to scan and understand:

Organizing your documentation

Just as there are principles to follow when writing individual documents, you should also follow a framework for organizing documents in your repo. 

There are many approaches to organizing documentation in your repo, but one that we’ve used for several projects and recommend is the Diátaxis framework. This is a systematic approach to organizing all the documents relevant to your project. 

Applying a systematic approach to documenting your repositories can make it easier for users to know where to go to find the information that they need. This reduces frustration and gets folks contributing to your project faster. 

Diátaxis divides documents based on their purpose into four categories: 

Each document in your repository should fit into one of these categories. This helps users quickly find the appropriate resource for their current situation, whether they need to learn a new concept, solve a specific problem, understand underlying principles, or look up technical details.

This can also be a helpful guide to identify which documentation your repository is missing. Is there a tool your repository uses that doesn’t have a reference document? Are there enough tutorials for contributors to get started with your repository? Are there how-to guides to explain some of the common tasks that need to be accomplished within your repository? 

Organizing your documentation according to this framework helps ensure you’re taking a holistic approach to building and maintaining key content for your project.

The post Documentation done right: A developer’s guide appeared first on The GitHub Blog.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

项目文档 Diátaxis框架 协作效率 新手入门 结构化文档
相关文章