Skip to content

DOC: added button to edit on GitHub #61956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Sivayogeith
Copy link

@Sivayogeith
Copy link
Author

pre-commit.ci autofix

@Sivayogeith
Copy link
Author

hey @afeld, could you take a look at this? TIA!

@mroeschke
Copy link
Member

/preview

@mroeschke mroeschke added the Docs label Jul 28, 2025
Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/61956/

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks but the links do not direct to editable pages e.g. the edit link in https://pandas.pydata.org/preview/pandas-dev/pandas/61956/docs/

@Sivayogeith
Copy link
Author

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?

@mroeschke
Copy link
Member

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?

@Sivayogeith
Copy link
Author

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).

@Sivayogeith
Copy link
Author

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 DOC: add button to edit on GitHub #61997)
  2. What do you mean by API page? Should the button be excluded in every page in /reference?

@mroeschke
Copy link
Member

  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

@Sivayogeith
Copy link
Author

Sivayogeith commented Aug 1, 2025

Screenshot 2025-08-01 at 9 52 48 AM

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!

@Sivayogeith
Copy link
Author

pre-commit.ci autofix

@Sivayogeith Sivayogeith requested a review from mroeschke August 4, 2025 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: add button to edit on GitHub
2 participants