DOC: added button to edit on GitHub


- [x] closes #39859 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

pre-commit.ci autofix hey @afeld, could you take a look at this? TIA! /preview Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/61956/ > Thanks but the links do not direct to editable pages

It seems that’s the only page that isn’t working. Sorry, but could you explain how `index.rst` works? I have the file locally for some reason, but it’s not on GitHub. Is it supposed to redirect to `index.rst.template`? Ah OK, yes I see this works for some straightforward `.rst` pages.

Yes ideally we would only only want this button on pages that are not templates or API pages. Is there a straightforward way in pydata-sphinx-theme to only add this button to select pages?  Sadly, there is no straightforward way to exclude some pages. But, I am gonna try to make a extension for this (might take some time as I am new to sphinx lol). Ok, so I added a new list called exclude_edit_page_button and it will exclude adding the button to those pages. But, I have some questions:

1. Would you like the button to be in the This Page menu? (like how it was in #61997)
2. What do you mean by API page? Should the button be excluded in every page in /reference? 1. I don't know what 'This Page' refers to, so no?
2. The `/reference` pages can have the button a page for a particular pandas API e.g. https://pandas.pydata.org/preview/pandas-dev/pandas/61956/docs/reference/api/pandas.melt.html#pandas.melt should not have the button <img width="152" height="151" alt="Screenshot 2025-08-01 at 9 52 48 AM" src="https://github.com/user-attachments/assets/7272c6ca-bec6-40cc-8eb2-83364dd917d0" />  

I was referring to this - though I noticed it's not in production?

I’ve updated the logic to exclude the index page and any pages that include api in their path.
Let me know what you think! pre-commit.ci autofix