Skip to content

DOC: Styler.to_latex link is broken in DataFrame.to_latex documentation #48089

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

Closed
1 task done
FrnRmn opened this issue Aug 15, 2022 · 4 comments · Fixed by #48102
Closed
1 task done

DOC: Styler.to_latex link is broken in DataFrame.to_latex documentation #48089

FrnRmn opened this issue Aug 15, 2022 · 4 comments · Fixed by #48102

Comments

@FrnRmn
Copy link
Contributor

FrnRmn commented Aug 15, 2022

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/reference/api/pandas.DataFrame.to_latex.html

Documentation problem

In the See Also section of DataFrame.to_latex documentation the element Styler.to_latex has broken internal reference link.

Suggested fix for documentation

It could be fixed by adding the Styler.to_latex link to the corresponding element in the See Also section. This would make the doc more complete.

@FrnRmn FrnRmn added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 15, 2022
@attack68
Copy link
Contributor

PRs to fix are very welcome

@attack68 attack68 removed the Needs Triage Issue that has not been reviewed by a pandas team member label Aug 15, 2022
@attack68 attack68 added this to the Contributions Welcome milestone Aug 15, 2022
@samrao1997
Copy link
Contributor

take

@samrao1997
Copy link
Contributor

samrao1997 commented Aug 16, 2022

I have made a PR that updates the "See Also" of DataFrame.to_latex to have a corrected link to Styler.to_latex.

I attempted to make the text just Styler.to_latex but the link remained broken after some investigation, I noticed that it was a submodule. I then imitated how the link to the Styler is displayed in DataFrame.style in the "See Also" section.

This is my first contribution so I spent some time attempting to figure out how the links work. I discovered the link assume a prefix path of the module of the page you are on. What I mean by that, is the links in the "See Also" section of Styler.text_gradient only needs Styler.background_gradient because it assumes the prefix is io.formats.style so the link remains good. However, in the "See Also" section of Styler the link to DataFrame.style doesn't work because it doesn't live at the same submodule path. [<-- Potential new issue?]

That is why I hade to add io.formats.style to the text of the DataFrame.to_latex() because it assumes that path is at the highest level.

Let me know if I am misunderstanding anything here. This is my first contribution and am a noob to open-source development.

Oh and I attached a screen shot of the update to the text with working links.
Screen Shot 2022-08-15 at 17 55 45

@datapythonista
Copy link
Member

Excellent, I didn't know that was the problem, but makes sense, thanks for the research. If you find a way to validate in the CI that there are no more broken links in the see also section, that would be very useful. I think numpydoc is what should be complaining when rendering. Maybe there is a parameter or something that we can use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants