Building Python Project Documentation With MkDocs (Summary)
In this course, you learned how to quickly build documentation for a Python package based on Markdown files and docstrings using MkDocs and mkdocstrings.
You created a partly auto-generated documentation for your Python project by linking information in your docstrings to the documentation pages. Not content to rest at this, you added additional documentation pages that made your project more appealing to users by guiding them through examples and use cases.
You styled your documentation with the Material for MkDocs theme and deployed it to the Internet through GitHub Pages.
In this course, you learned how to:
- Write docstrings for your code objects
- Work with MkDocs to produce static pages from Markdown
- Pull in code documentation from docstrings using mkdocstrings
- Follow best practices for project documentation
- Customize your documentation using the Material for MkDocs theme
- Deploy your documentation on GitHub Pages
Building your project documentation using MkDocs and mkdocstrings allows you to write Markdown and auto-generate parts of the documentation directly from your docstrings. This setup means that you can create excellent documentation with less effort.
If you’re looking for next steps, then consider:
- Adding a code of conduct
- Adding a license
- Setting guidelines for contributors
- Exploring advanced MkDocs configuration
- Adding relative links to your docstrings
- Customizing the Materials for MkDocs theme
- Automating your deployment with GitHub Actions
- Publishing your project to PyPI
- Python’s doctest: Document and Test Your Code at Once
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
00:00 Summary. Well done. You’ve made it to the end of the course. In it, you learned how to build documentation for a Python package based on Markdown files and docstrings using MkDocs and mkdocstrings.
00:15 You created a partly auto-generated documentation for your Python project by linking information in your docstrings to the documentation pages. You also added additional documentation pages that made your project more appealing to users by guiding them through examples and use cases.
00:31 You styled your documentation with the Material for MkDocs theme and deployed it to the internet through GitHub Pages. In this course, you learned how to write docstrings for code objects, work with MkDocs to produce static pages from Markdown, pull in code documentation from docstrings using mkdocstrings, follow best practices for project documentation, customize your documentation using the Material for MkDocs theme, and deploy your documentation on GitHub Pages.
01:05 Building your project documentation using MkDocs and mkdocstrings allows you to write Markdown and auto-generate parts of the documentation directly from your docstrings.
01:14 This means you can create excellent documentation with less effort. We hope you found this course useful, and we’ll see you again soon at realpython.com.
Become a Member to join the conversation.
k-taylor on July 30, 2024
Great course, thanks Darren.
One thing that might be helpful is a list of all the commands (from the installs to the
mkdocs gh-deploy
) might be a very useful quick ref. when next building a project and wanting to add MKDocs to it.