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 11# Ecosystem
22
3+ [ TOC]
4+
35Increasingly, packages are being built on top of pandas to address
46specific needs in data preparation, analysis and visualization. This is
57encouraging because it means pandas is not only helping users to handle
Original file line number Diff line number Diff line change 1414 - pandas_web.Preprocessors.home_add_releases
1515 - pandas_web.Preprocessors.roadmap_pdeps
1616 markdown_extensions :
17- - toc
1817 - tables
1918 - fenced_code
2019 - meta
Original file line number Diff line number Diff line change 4242import feedparser
4343import jinja2
4444import markdown
45+ from markdown .extensions .toc import TocExtension
4546from packaging import version
4647import requests
4748import yaml
@@ -470,29 +471,14 @@ def main(
470471 with (source_path / fname ).open (encoding = "utf-8" ) as f :
471472 content = f .read ()
472473 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+ )
496482 # Apply Bootstrap's table formatting manually
497483 # Python-Markdown doesn't let us config table attributes by hand
498484 body = body .replace ("<table>" , '<table class="table table-bordered">' )
You can’t perform that action at this time.
0 commit comments