-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Add table of contents support to ecosystem page #61595
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
Conversation
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.
Some changes needed, but the general idea looks good, thanks for helping with this.
web/pandas_web.py
Outdated
@@ -487,7 +488,15 @@ def main( | |||
) | |||
else: | |||
body = markdown.markdown( | |||
content, extensions=context["main"]["markdown_extensions"] | |||
content, |
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.
Instead of repeating this here, we should probably add the ecosystem page to this condition above: if "pdeps/" in fname:
web/pandas_web.py
Outdated
@@ -45,6 +45,7 @@ | |||
from packaging import version | |||
import requests | |||
import yaml | |||
from markdown.extensions.toc import TocExtension |
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.
This is not needed if we follow the approach mentioned below
@akafle01 do you have time to continue the work on this? |
Yes I will work on it today |
da81062
to
ab14673
Compare
/preview |
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/61595/ |
Thanks @akafle01 for the contribution. I was checking this, as the table of contents looked different than in the other pages, and realized besides adding the ToC we needed to do some refactoring. I better add the ToC to Ecosystem in #61655 where I've implemented the refactor, so we can test both things together. I'll close this PR, sorry about it, as the work you've been doing is great, just more practical to add this in the other PR. |
This PR adds a table of contents to the Ecosystem page using the Markdown
TocExtension
.[TOC]
placeholder inecosystem.md
toc
extension inweb.py
toc_depth
for h2 and h3 headers