Getting started#

So you want to build some documentation for your project. Follow this guide to get started.

Note

If you are already working on a project, you may start at step 3 after navigating to your project directory.

  1. Create an empty repository (e.g. using GitHub, GitLab, or Bitbucket)

  2. Clone the repository onto your local machine

  3. Create and move to the documentation directory,

    mkdir docs
    cd docs
    
  4. Add sphinx to a requirements file and install it,

    echo sphinx >> requirements.txt
    pip install sphinx
    
  5. Run quickstart to setup the documentation,

    sphinx-quickstart
    
  6. Build and preview the documentation locally,

    make html
    open _build/html/index.html
    
  7. Add build directory to gitignore

    echo _build >> .gitignore
    
  8. Commit the documentation to the repository,

    cd ../
    git add .
    git commit -m "Initial documentation"
    git push
    

You now have a working Sphinx project!