Skip to content
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

DOC: "Show Source" button on API pages does not link to expected source code #48715

Open
1 task done
tehunter opened this issue Sep 22, 2022 · 7 comments
Open
1 task done
Assignees
Labels

Comments

@tehunter
Copy link
Contributor

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.html

Documentation problem

The "Show Source" button on the new version of the documentation pages is not useful to most users and is likely to cause confusion. In addition, it conflicts with the "[source]" link which also exists on the page (and on previous versions of the documentation).

image

Rather than showing the relevant API source code, the "Show Source" button shows the source code for the current documentation page (.e.g. https://pandas.pydata.org/docs/_sources/reference/api/pandas.DataFrame.rst.txt).

Suggested fix for documentation

I suggest the "Show Source" button be removed, or it should be remapped to the same link as the current "[source]" link (which should then be removed).

I could see some value for developers wanted to access the documentation source. If that is important, then I would propose (1) move to the bottom or out of a high-visibility area, and (2) rename it to "Show Documentation Source"

@tehunter tehunter added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 22, 2022
@Pro-Coder04
Copy link

Hello @tehunter !
I would help to solve this issue could you assign it to me?

@tehunter
Copy link
Contributor Author

If you comment on this thread with the single word "take", the bot will assign it to you. Thanks!

@lithomas1 lithomas1 removed the Needs Triage Issue that has not been reviewed by a pandas team member label Sep 27, 2022
@lithomas1 lithomas1 added this to the Contributions Welcome milestone Sep 27, 2022
@Pro-Coder04
Copy link

take

@Pro-Coder04
Copy link

Hey @tehunter could you help me find the file which has the source code for the page which you have raised the issue for?
Since I'm new to open source your guidance will be helpful to make my first contribution

@tehunter
Copy link
Contributor Author

@Pro-Coder04 , I'm fairly new to it as well. Perhaps @phofl or @datapythonista could point you in the right direction. If I had to guess, I bet it is related to the recent version update of the API documentation theme (see #48285) and not directly in pandas code. The documentation pages are autogenerated from a package called "Sphinx", the API pages are defined in /doc/source/reference and it uses a configuration defined in /doc/source/conf.py.

@datapythonista
Copy link
Member

Happy to get the Show source link removed, doesn't seem it's working for the API, and not sure in what cases this can be useful.
I think this should be done in our conf.py file, see the docs of the theme here: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html

CC: @jorisvandenbossche, I guess you added this when we started using the pydata theme, probably it's just the default

@tehunter
Copy link
Contributor Author

Looks like pydata-sphinx-theme added a default sourcelink.html component around June of this year (See pydata/pydata-sphinx-theme#714), which makes their documentation incomplete. I believe the correct way to remove it is now to set html_show_sourcelink = False in the conf.py.

Alternative option is to override the sourcelink.html template and have it point to our current "[source]" link.

@mroeschke mroeschke removed this from the Contributions Welcome milestone Oct 13, 2022
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 a pull request may close this issue.

5 participants