-
-
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed if we follow the approach mentioned below |
||
|
||
api_token = os.environ.get("GITHUB_TOKEN") | ||
if api_token is not None: | ||
|
@@ -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 commentThe 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: |
||
extensions= [ | ||
TocExtension(toc_depth="2-3", permalink=" #"), | ||
"tables", | ||
"fenced_code", | ||
"meta", | ||
"footnotes", | ||
"codehilite", | ||
] | ||
) | ||
# Apply Bootstrap's table formatting manually | ||
# Python-Markdown doesn't let us config table attributes by hand | ||
|
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.