-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
WEB: Add code highlighting in PDEPs and render tables correctly #51458
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
WEB: Add code highlighting in PDEPs and render tables correctly #51458
Conversation
Nvm, we basically have the same thing as pydata-sphinx-theme, the only difference is that we don't have the box around the code block so it still looks kinda nasty. |
We clearly have been noticing the same things ;) The last days, I was thinking we could also use sphinx (with myst) instead to solve many of those issues. I wrote up #51461 about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lookg great, thanks @lithomas1
@@ -418,6 +418,9 @@ def main( | |||
body = markdown.markdown( | |||
content, extensions=context["main"]["markdown_extensions"] | |||
) | |||
# Apply Bootstrap's table formatting manually | |||
# Python-Markdown doesn't let us config table attributes by hand | |||
body = body.replace("<table>", '<table class="table table-bordered">') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice. At some point I thought on creating a plugin for python markdown to do this (the core dev doesn't want to add anything into the project, which is probably good). But didn't think about this as a workaround.
Preview docs at: https://pandas.pydata.org/preview/51458/ |
Looks like you're changing the background color of the navigation bar, not sure if that's intended. I like how it looks like actually, but feels like this PR shouldn't change it, right? Also, we can address it in a follow up PR, but I think we can add some padding and maybe a border to the code boxes: https://pandas.pydata.org/preview/51458/pdeps/0004-consistent-to-datetime-parsing.html Happy to take care of that myself in a follow up PR, but probably easy to add it here too. |
My bad. Just realized now that I'm in a different monitor, where the color looks darker. Interesting that everything else looks the same, except of our navigation bar. Sorry about the noise. |
Thanks @lithomas1. I think we can address the above comment in a follow up, but nice improvement to the website! |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Discovered that tables were rendering really nastily and there was no code highlighting so PDEPs were looking a little bland while working on PDEP 7.
Note: The codehilite.css file that I added was generated by pygments, and is based on the
friendly
style(I'll try to find the pydata-sphinx-theme style css file though).