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

This issue has been created since 2022-09-22.

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"

Pro-Coder04 wrote this answer on 2022-09-27

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

tehunter wrote this answer on 2022-09-27

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

Pro-Coder04 wrote this answer on 2022-09-28

take

Pro-Coder04 wrote this answer on 2022-09-28

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 wrote this answer on 2022-09-28

@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 wrote this answer on 2022-09-28

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 wrote this answer on 2022-09-28

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.

More Details About Repo
Owner Name pandas-dev
Repo Name pandas
Full Name pandas-dev/pandas
Language Python
Created Date 2010-08-24
Updated Date 2022-09-29
Star Count 35374
Watcher Count 1122
Fork Count 15034
Issue Count 3579

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Cannot compile also how do I open a script in the terminal? 6 2022-06-14 2022-08-24
Can't disable all built-in command 3 2021-09-24 2022-09-21
Crash when calling VirtualDesktop.Current.Id on latest Windows 11 Insider build 8 2022-04-20 2022-07-18
run spellcheck on documentation 0 2022-02-11 2022-09-18
Implement analytics 0 2018-08-07 2022-09-17
ListAccounts interface I'm not sure if I have the next page how do I improve this one 1 2022-04-20 2022-09-20
ILM Applied - but getting rollover error does not match pattern 27 2020-05-03 2022-08-06
Could not communicate to Elasticsearch, resetting connection and trying again. getaddrinfo: Name does not resolve (SocketError) 6 2020-03-25 2022-08-14
Numerical issue with some Bluestein FFT dimensions 3 2021-10-28 2022-07-21
Make it easier to ping users whose names start with non-ASCII characters 2 2021-10-06 2022-09-22
Does LinVst support sendVstTimeInfo as both client and host? 5 2020-12-15 2022-09-02
Introduced HEAD Http method for Product 0 2021-10-20 2022-09-23
Local microphone, camera support 0 2022-09-13 2022-09-22
Please allow passing the charset to use for the created database 1 2020-02-24 2022-08-24
Symfony\Component\Debug\Exception\FatalThrowableError in GET /report 0 2021-10-09 2022-09-14
Balance details screen 0 2021-04-16 2022-08-27
Make `request_parser` movable without changing body type 3 2022-09-07 2022-09-28
Pack: CockroachDB 1 2021-10-21 2022-01-12
Pack: Boundary 0 2021-10-21 2022-01-12
Limit alerts to project without version 2 2022-06-21 2022-09-14
LND sync stuck after upgrade to 1.7.1 2 2021-11-02 2022-07-24
JDK 17 support 1 2021-09-19 2022-01-12
Cancelation of a process leaves the process running 0 2022-01-14 2022-08-06
Where to find example mod for 1.16.5 2 2021-07-06 2022-09-27
calico-node not ready after node reboot with WireGuard enabled 12 2021-11-30 2022-08-18
[Bug]: docs formatting - contributing guidelines 1 2022-01-27 2022-08-16
RFC 697: Run schema+data migrations over multiple versions in the `migrator` 1 2022-06-30 2022-09-03
Unable to set user password following documentation 6 2021-09-29 2022-09-22
How can I create a line with anchor in the middle of another line ? 4 2021-03-09 2022-09-02
Animation on LeaderLine instance init 2 2021-02-18 2022-09-07
`doctypehtml_` seems impossible to use in an html5-compliant way 2 2021-10-11 2022-08-29
`Markdown in MDN` page isn't indexed 3 2022-06-14 2022-09-01
Firebase/auth import source-map error 0 2022-09-08 2022-09-17
Proposal: django-auto-serializer 0 2021-06-12 2022-09-02
[Blood]: Need to fix issues loading some mods by drag-and-drop. 2 2021-07-18 2022-09-12
Basic usage 2 2021-11-19 2022-01-07
Add --replace flag to run command 3 2021-01-28 2022-09-26
How to get logits from generate() method ? 7 2021-11-23 2022-09-02
ESP32 C3 2mb flash version keeps rebooting 11 2022-08-02 2022-08-25
x/website/blog: missing embedding metadata 0 2021-09-17 2022-07-24
mockkStatic is not threadsafe 5 2021-12-10 2022-09-28
Make structopt an optional dependency 0 2022-03-24 2022-09-27
Bug: Failed to persist entry: API_ERROR: GitRPC::BadObjectState 9 2022-03-05 2022-09-21
Apple Silicon support 4 2021-02-16 2022-09-26
Add linux-arm64 binary to the generated nuget package 11 2021-05-25 2022-09-23
No pylint error messages when multiple pylint jobs used 30 2019-02-27 2022-08-30
killing a process does not return tty from raw mode 3 2022-07-29 2022-09-18
Reduce/document differences between cdktf synth and running app directly 4 2021-06-24 2022-09-26
是否可以支持cmake构建系统 0 2021-12-07 2022-01-15
[Admin Web UI Kit] [Icon] Add a 3 column icons 3 2021-12-14 2022-09-12