pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.92k stars 18.03k forks source link

DOC: Simplify pandas theme footer #51536

Open datapythonista opened 1 year ago

datapythonista commented 1 year ago

The sphinx theme that we're using didn't let us specify what exactly to show in our footer in the configuration file. So, what we did was to create a custom template to overwrite everything. Seems like now they changed this in their end, and we should be able to implement in our end the footer we want without requiring the extra template. I didn't check in detail, so some research is needed to see if this is really possible.

Their changes haven't been released yet, so we can't really get this into production until they do. But we can get the PR ready by temporary changing the pydata-sphinx-theme dependency to the git version.

HaripriyaGnanasekaran commented 1 year ago

take

natmokval commented 1 year ago

Hi @RamanathanVaradharajan, how is it going with this issue? If you don't mind I would like to work on it.

datapythonista commented 1 year ago

You can probably go ahead @natmokval, thanks for the help!

natmokval commented 1 year ago

Hi @datapythonista. I started to work on this issue and got stuck. I created a pr #52149 to show the changes I've made so far. Could you please help and advise me on what could be my next step?

AbrhamSayd commented 1 year ago

Hi @datapythonista I'm working on it.

AbrhamSayd commented 1 year ago

Hi @datapythonista After researching and exploring different ways of displaying the pandas footer without using an extra template I haven't found a solution to stop using it. My closest approach was to use the 'html_context' setting to define the footer content inside the conf.py

#Variable for the footer
footer = f"""{datetime.now().year}
pandas via <a href="https://numfocus.org">NumFOCUS, Inc.
</a> Hosted by <a href="https://www.ovhcloud.com">OVHcloud</a>"""

html_context = {
    "redirects": dict(moved_api_pages),
    "header": header,
    "footer": footer
}

And just pass the variable to the pandas_footer.html

<p class="copyright">
    &copy {{footer}} 
</p>

But the template is still needed to render the context variable

html_theme_options = {
    "external_links": [],
    "footer_start": ["pandas_footer", "sphinx-version"],
    "github_url": "https://github.com/pandas-dev/pandas",
    "twitter_url": "https://twitter.com/pandas_dev",
    }

This is how its render image

Does anyone have any more ideas for getting rid of the template?

AbrhamSayd commented 1 year ago

Hi @datapythonista I've submitted a pull request that proposes a potential solution.

BabaYaga1221 commented 1 year ago

Hello everyone, I just continue the work from the last PR which is now drafted. Can you take a look and provide suggestions? Thank you @datapythonista

Spraveen8-chary commented 4 months ago

Hi @datapythonista , I would like to work on it.