File tree Expand file tree Collapse file tree 3 files changed +11
-24
lines changed Expand file tree Collapse file tree 3 files changed +11
-24
lines changed Original file line number Diff line number Diff line change 1
1
# Ecosystem
2
2
3
+ [ TOC]
4
+
3
5
Increasingly, packages are being built on top of pandas to address
4
6
specific needs in data preparation, analysis and visualization. This is
5
7
encouraging because it means pandas is not only helping users to handle
Original file line number Diff line number Diff line change 14
14
- pandas_web.Preprocessors.home_add_releases
15
15
- pandas_web.Preprocessors.roadmap_pdeps
16
16
markdown_extensions :
17
- - toc
18
17
- tables
19
18
- fenced_code
20
19
- meta
Original file line number Diff line number Diff line change 42
42
import feedparser
43
43
import jinja2
44
44
import markdown
45
+ from markdown .extensions .toc import TocExtension
45
46
from packaging import version
46
47
import requests
47
48
import yaml
@@ -470,29 +471,14 @@ def main(
470
471
with (source_path / fname ).open (encoding = "utf-8" ) as f :
471
472
content = f .read ()
472
473
if extension == ".md" :
473
- if len (fname .parts ) > 1 and fname .parts [1 ] == "pdeps" :
474
- from markdown .extensions .toc import TocExtension
475
-
476
- body = markdown .markdown (
477
- content ,
478
- extensions = [
479
- # Ignore the title of the PDEP in the table of contents
480
- TocExtension (
481
- title = "Table of Contents" ,
482
- toc_depth = "2-3" ,
483
- permalink = " #" ,
484
- ),
485
- "tables" ,
486
- "fenced_code" ,
487
- "meta" ,
488
- "footnotes" ,
489
- "codehilite" ,
490
- ],
491
- )
492
- else :
493
- body = markdown .markdown (
494
- content , extensions = context ["main" ]["markdown_extensions" ]
495
- )
474
+ toc = TocExtension (
475
+ title = "Table of Contents" ,
476
+ toc_depth = "2-3" ,
477
+ permalink = " #" ,
478
+ )
479
+ body = markdown .markdown (
480
+ content , extensions = context ["main" ]["markdown_extensions" ] + [toc ]
481
+ )
496
482
# Apply Bootstrap's table formatting manually
497
483
# Python-Markdown doesn't let us config table attributes by hand
498
484
body = body .replace ("<table>" , '<table class="table table-bordered">' )
You can’t perform that action at this time.
0 commit comments