Skip to content

Commit 0d34925

Browse files
committed
Add table of contents support to ecosystem page
1 parent e6da5f2 commit 0d34925

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

web/pandas/community/ecosystem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Ecosystem
2+
[TOC]
23

34
Increasingly, packages are being built on top of pandas to address
45
specific needs in data preparation, analysis and visualization. This is

web/pandas_web.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from packaging import version
4646
import requests
4747
import yaml
48+
from markdown.extensions.toc import TocExtension
4849

4950
api_token = os.environ.get("GITHUB_TOKEN")
5051
if api_token is not None:
@@ -487,7 +488,15 @@ def main(
487488
)
488489
else:
489490
body = markdown.markdown(
490-
content, extensions=context["main"]["markdown_extensions"]
491+
content,
492+
extensions= [
493+
TocExtension(toc_depth="2-3", permalink=" #"),
494+
"tables",
495+
"fenced_code",
496+
"meta",
497+
"footnotes",
498+
"codehilite",
499+
]
491500
)
492501
# Apply Bootstrap's table formatting manually
493502
# Python-Markdown doesn't let us config table attributes by hand

0 commit comments

Comments
 (0)