Hosting Your Documentation on GitHub
Host Your Documentation on GitHub. At this point, you’ve completed your toy
calculator’s project documentation, which was partly auto-generated from the docstrings in your code. In this step, you’ll deploy your documentation to GitHub and add additional files that should be part of a complete Python project documentation.
00:21 While you could host the documentation on any static file hosting service, here you’ll learn how to do it using GitHub Pages. As a developer, you probably already have a GitHub account, and the platform also offers some excellent features for adding additional parts to your project documentation from boilerplate.
If you don’t have a GitHub repository for your project yet, then create a new repository through the GitHub web interface. Initialize it without a
README.md file so that it starts empty, and then copy the URL of the repository.
01:13 Back in your terminal, initialize a local Git repository for your Python project. After initializing an empty Git repository at your project root, you can next add a URL to your GitHub repository as a remote, following the format seen in the slide on-screen.
02:58 After this, you can push again to send your project files to your remote repository. Next, you can push the documentation you built to a particular branch on your repository, immediately making it available for users to browse online.
Become a Member to join the conversation.