Add an “Edit on GitHub” button to your code examples.

sphinxcontrib-viewsource is a Sphinx extension that enhances the literalinclude directive, adding a caption automatically with a link pointing to the source file.

Use it to add an Edit on GitHub button to your code source files, or to show the complete code when the literalinclude directive renders a subset of the file.


    print('Hello World!')

Add the extension to your project following the installation instructions.