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:
- Better collaboration: Clear, consistent documentation ensures everyone’s on the same page, from your immediate team to outside stakeholders. Additionally, docs promote independent problem solving, saving core contributors the time and effort of answering every question.
- Smoother onboarding: By providing ways to get started, explaining core concepts, and including tutorial-style content, good documentation allows new team members to ramp up quickly.
- Increased adoption: The easier it is to understand, set up, and run your project, the more likely someone will use it.
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:
- Put the most important information first to help readers quickly understand if a document is relevant to them.
- Use headings and a table of contents to tell your readers where to find specific information. We suggest using documentation templates with common headings to quickly and consistently create structured content.
- Use text highlighting like boldface and formatting elements like bulleted lists to help readers scan content. Aim for 10% or less text highlighting to make sure emphasized text stands out.
- Be consistent with your styling. For example, if you put important terminology in bold in one document, do the same in your other content.
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:
- Tutorials: Learning-oriented documents
- How-to guides: Goal-oriented instructions for specific tasks
- Explanation: Discussions providing understanding of the project
- Reference: Technical specifications and information
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.
Source: Read MoreÂ