WEB: Refine PDEP presentation
State: closed

- [x] closes #51461 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Alternative to #51467. I believe this address all items in the linked issue. The main benefit in not switching to publishing PDEPs in sphinx is that it then matches the style of the rest of the webpage.

This is just a rough version to demonstrate what's possible, some refinements (highlighted below) need to be made if we are to merge this.

Labels:
name: Enhancement
name: Web
description: pandas website

Comments:
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/58791/
[PDEP6](https://pandas.pydata.org/preview/pandas-dev/pandas/58791/pdeps/0006-ban-upcasting.html) shows code highlighting.

cc @jorisvandenbossche @datapythonista 
@rhshadrach thanks a lot for looking into this!

I certainly think this is a nice improvement, and if we don't have agreement on using sphinx instead, we should definitely merge this one. But if you ask my honest opinion, I personally still think https://github.com/pandas-dev/pandas/pull/51467 gives the better result.

Concrete feedback on the changes here:

- The header links need some offset (it doesn't know about the top navbar). Eg https://pandas.pydata.org/preview/pandas-dev/pandas/58791/pdeps/0006-ban-upcasting.html#detailed-description

  I think with the sphinx theme this is solved with

  ```
  html {
    scroll-padding-top: calc(var(--pst-header-height) + 1rem);
  }
  ```
  
  (and here this can be be fixed number, I assume)

- I would personally further reduce the width
Personal preference, but I think the "On this page" sidebar (from @jorisvandenbossche's PR) is cleaner and resembles the docs more than the table of contents here. (I guess that's a benefit of using Sphinx?)
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
/preview
@rhshadrach should we merge this?
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/58791/
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/58791/
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/58791/
Thanks @rhshadrach, very nice. Maybe the ecosystem can also benefit from this, I'll create an issue.
This PR still suffered from the height issue that @jorisvandenbossche pointed out above.
It works well in my browser, visualization is fine, and links work perfect. I use Brave on Linux. Not sure if I can't see the problem, or just works well for me.

Feel free to open an issue with the exact problem, if I can reproduce it happy to take a look, otherwise someone else will probably fix it if you label it as good first issue.
Weird I'm not seeing the same. Perhaps I was testing an old link when I last looked at this. But now I'm noticing that the Table of Contents is gone.
Ah, it's only on the Implemented pages.
Only thing I was thinking is whether it's been this PR that decreased the width of the content of the website. Maybe just my perception, but I think it was wider (maybe it became narrower before).

But the tables of content look fine everywhere I checked, also in the implemented section, at list the first one: https://pandas.pydata.org/pdeps/0004-consistent-to-datetime-parsing.html
> This PR still suffered from the height issue that @jorisvandenbossche pointed out above.

With the latest deployed docs, this also looks fine now for me (Firefox on linux)