Create _ext/
and _templates/
subdirectories.
Move edit_on_github.py
into the _ext/
subdirectory.
Move sourcelink.html
into the _templates/
subdirectory.
Add the following after the import sys, os
line
sys.path.insert(0, os.path.abspath('_ext'))
Add edit_on_github
to the list of extensions
extensions = ['edit_on_github']
Configure the extension
edit_on_github_project = 'username/reponame'
edit_on_github_branch = 'master'
Make sure the template path is specified correctly
templates_path = ['_templates']
This is very helpful, thanks. A quick question : line 31 of edit_on_github.py breaks when I
make html
becausedoctree
isNone
. Any thoughts on wherehtml_page_context()
gets called during build, so I can ensure that the variable is valid ?Thanks !