Skip to content

Add "Edit on Github" to secondary sidebar#982

Merged
TimMonko merged 3 commits intonapari:mainfrom
TimMonko:enh/edit-on-github
Apr 9, 2026
Merged

Add "Edit on Github" to secondary sidebar#982
TimMonko merged 3 commits intonapari:mainfrom
TimMonko:enh/edit-on-github

Conversation

@TimMonko
Copy link
Copy Markdown
Contributor

@TimMonko TimMonko commented Apr 9, 2026

References and relevant issues

xref napari/napari-sphinx-theme#216

Description

This adds an "Edit this Page" button to the secondary (right) sidebar on our docs.
Minimal setup was done via here: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html

And edit_page_url_template points not to the edit URL but instead to blob. I noticed from pydantic sphinx theme that clicking through leads me to the "You need to fork this" and not a nice clean document. I think being met with the fork screen would be a WTF moment as a new contributor, so I'd prefer something more welcoming (and where you can actually see the code right away)

Also ran into #981 while developing

image

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 9, 2026
@TimMonko TimMonko added this to the 0.7.1 milestone Apr 9, 2026
@brisvag
Copy link
Copy Markdown
Contributor

brisvag commented Apr 9, 2026

Can it also be renamed to "propose an edit" or something like that? Might be less intimidating, as "edit on github" might sound like it's off-limits to the casual visitor.

@TimMonko
Copy link
Copy Markdown
Contributor Author

TimMonko commented Apr 9, 2026

Hmm, at first my counter argument was that this language is "standardized", but I think you are on to something.

To do this, it does require a customized html template. If I do this I will add it to napari-sphinx-theme, so all repos benefit. So, in that sense this PR can be merged and then the upstream napari-sphinx-theme will override it later.

@TimMonko
Copy link
Copy Markdown
Contributor Author

TimMonko commented Apr 9, 2026

We collectively decided at the docs meeting, that it should remain "Edit on Github" since that is a standard. @brisvag if you feel strongly you can open an issue in napari-sphinx-theme ❤️

@TimMonko TimMonko merged commit d2185f6 into napari:main Apr 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants