Skip to content

Latest commit

 

History

History
87 lines (57 loc) · 6.26 KB

DOCUMENTATION.md

File metadata and controls

87 lines (57 loc) · 6.26 KB

Documentation

Have a good README

The README.md of a GitHub repo is like a welcome mat: It's the first thing you see when you arrive on a project's doorstep. The easier you can make it for users or other developers to glean important information about your project, the better.

Here are some great examples of README.md files:

Many of these README.md files include a series of badges at the top. These badges are not only visual indicators of certain information---whether the repo is in a healthy state with passing tests, which channels are available for obtain the tool, which version number is current, and how many times the software has been downloaded---they provide quick links to a variety of useful integrated services.

Some useful badges:

Documentation is the primary way to learn about how code works.

There are many tools that can be used to write documentation. The easiest to start with is the GitHub wiki, which uses markdown syntax just like the rest of GitHub.

GitHub wiki

If you're already hosting your project on GitHub, perhaps the easiest to start with is Github wiki which uses the same GitHub markdown syntax. GitHub wikis are version controlled, and can even be edited like a standard Git repository.

Helpful guide on GitHub wikis: https://guides.github.com/features/wikis/

Some good examples of wiki-based documentation:

Sphinx

If you need something slightly more powerful, consider using Sphinx, which has excellent support for producing beautiful Python documentation. From the same documentation source, you can build both HTML (online) and PDF (offline) versions, among many others supported.

Hosting a sphinx project can be tricky on its own, but is almost trivial if you have a public GitHub repository, since you can use Read the Docs (RTD), which automatically rebuilds and hosts the documentation every time you commit to your repository. This template and this tutorial can help you easily get started.

If you're using conda for your code, you may want to check out this step by step guide on setting up a conda project with RTD.

Some good examples of Sphinx documentation:

Other documentation schemes

  • readme.io: A collaborative system for writing documentation
  • GitBook: An online collaborative publishing toolchain

Clear examples encourage use of code

Almost nobody reads the complete user documentation for a tool before jumping in. Attention spans are limited; if it takes more than a few minutes to figure out how to accomplish the desired action with a new code---especially if that action is perceived as common---it's likely the user will give up and try a different approach.

Many users---yourself included---find the easiest way to get started with a new code is to try out a working example similar to the task of interest and then tweak things from there. Clear, simple, working examples are the quickest way to get someone using your code.

Good examples of good examples:

Changelogs

Documenting what has changed with each revision or release of your code is an important part of recording when new features were added, existing features were changed, or when critical bugs were fixed.

autoprotocol has a great example of good changelog documentation using RTD

Help Make this Page Better

Want to contribute to this repository? Have a suggestion for an improvement? Spot a typo? We're always looking to improve this document for the betterment of all.

Previous: Next:
Continuous Integration Back to Top Python Optimization