diff --git a/web/pandas/pdeps/0001-purpose-and-guidelines.md b/web/pandas/pdeps/0001-purpose-and-guidelines.md index bb15b8f997b11..11726fc3296ad 100644 --- a/web/pandas/pdeps/0001-purpose-and-guidelines.md +++ b/web/pandas/pdeps/0001-purpose-and-guidelines.md @@ -8,6 +8,8 @@ [Noa Tamir](https://github.com/noatamir) - Revision: 3 +[TOC] + ## PDEP definition, purpose and scope A PDEP (pandas enhancement proposal) is a proposal for a **major** change in diff --git a/web/pandas/pdeps/0004-consistent-to-datetime-parsing.md b/web/pandas/pdeps/0004-consistent-to-datetime-parsing.md index 68c6dfa26d1f1..b3f277326319e 100644 --- a/web/pandas/pdeps/0004-consistent-to-datetime-parsing.md +++ b/web/pandas/pdeps/0004-consistent-to-datetime-parsing.md @@ -6,6 +6,8 @@ - Author: [Marco Gorelli](https://github.com/MarcoGorelli) - Revision: 2 +[TOC] + ## Abstract The suggestion is that: diff --git a/web/pandas/pdeps/0005-no-default-index-mode.md b/web/pandas/pdeps/0005-no-default-index-mode.md index d543a4718e896..81222b51817d5 100644 --- a/web/pandas/pdeps/0005-no-default-index-mode.md +++ b/web/pandas/pdeps/0005-no-default-index-mode.md @@ -6,6 +6,8 @@ - Author: [Marco Gorelli](https://github.com/MarcoGorelli) - Revision: 2 +[TOC] + ## Abstract The suggestion is to add a ``NoRowIndex`` class. Internally, it would act a bit like diff --git a/web/pandas/pdeps/0006-ban-upcasting.md b/web/pandas/pdeps/0006-ban-upcasting.md index a86455b70c71a..ae3a9e6ad233e 100644 --- a/web/pandas/pdeps/0006-ban-upcasting.md +++ b/web/pandas/pdeps/0006-ban-upcasting.md @@ -6,6 +6,8 @@ - Author: [Marco Gorelli](https://github.com/MarcoGorelli) ([original issue](https://github.com/pandas-dev/pandas/issues/39584) by [Joris Van den Bossche](https://github.com/jorisvandenbossche)) - Revision: 1 +[TOC] + ## Abstract The suggestion is that setitem-like operations would diff --git a/web/pandas/pdeps/0007-copy-on-write.md b/web/pandas/pdeps/0007-copy-on-write.md index f5adb6a571120..75f9bffa970de 100644 --- a/web/pandas/pdeps/0007-copy-on-write.md +++ b/web/pandas/pdeps/0007-copy-on-write.md @@ -6,6 +6,8 @@ - Author: [Joris Van den Bossche](https://github.com/jorisvandenbossche) - Revision: 1 +[TOC] + ## Abstract Short summary of the proposal: diff --git a/web/pandas/pdeps/0009-io-extensions.md b/web/pandas/pdeps/0009-io-extensions.md index aeda990cea7df..baa661957e951 100644 --- a/web/pandas/pdeps/0009-io-extensions.md +++ b/web/pandas/pdeps/0009-io-extensions.md @@ -7,6 +7,8 @@ - Author: [Marc Garcia](https://github.com/datapythonista) - Revision: 1 +[TOC] + ## PDEP Summary This document proposes that third-party projects implementing I/O or memory diff --git a/web/pandas/pdeps/0010-required-pyarrow-dependency.md b/web/pandas/pdeps/0010-required-pyarrow-dependency.md index 4d6e928ce68bd..26549dd500a5f 100644 --- a/web/pandas/pdeps/0010-required-pyarrow-dependency.md +++ b/web/pandas/pdeps/0010-required-pyarrow-dependency.md @@ -8,6 +8,8 @@ [Patrick Hoefler](https://github.com/phofl) - Revision: 1 +[TOC] + ## Abstract This PDEP proposes that: diff --git a/web/pandas/pdeps/0012-compact-and-reversible-JSON-interface.md b/web/pandas/pdeps/0012-compact-and-reversible-JSON-interface.md index 3ae34f4bb6ebb..4c73b24a11455 100644 --- a/web/pandas/pdeps/0012-compact-and-reversible-JSON-interface.md +++ b/web/pandas/pdeps/0012-compact-and-reversible-JSON-interface.md @@ -8,36 +8,7 @@ - Author: [Philippe THOMY](https://github.com/loco-philippe) - Revision: 3 -##### Summary - -- [Abstract](./0012-compact-and-reversible-JSON-interface.md/#Abstract) - - [Problem description](./0012-compact-and-reversible-JSON-interface.md/#Problem-description) - - [Feature Description](./0012-compact-and-reversible-JSON-interface.md/#Feature-Description) -- [Scope](./0012-compact-and-reversible-JSON-interface.md/#Scope) -- [Motivation](./0012-compact-and-reversible-JSON-interface.md/#Motivation) - - [Why is it important to have a compact and reversible JSON interface ?](./0012-compact-and-reversible-JSON-interface.md/#Why-is-it-important-to-have-a-compact-and-reversible-JSON-interface-?) - - [Is it relevant to take an extended type into account ?](./0012-compact-and-reversible-JSON-interface.md/#Is-it-relevant-to-take-an-extended-type-into-account-?) - - [Is this only useful for pandas ?](./0012-compact-and-reversible-JSON-interface.md/#Is-this-only-useful-for-pandas-?) -- [Description](./0012-compact-and-reversible-JSON-interface.md/#Description) - - [Data typing](./0012-compact-and-reversible-JSON-interface.md/#Data-typing) - - [Correspondence between TableSchema and pandas](./panda0012-compact-and-reversible-JSON-interfaces_PDEP.md/#Correspondence-between-TableSchema-and-pandas) - - [JSON format](./0012-compact-and-reversible-JSON-interface.md/#JSON-format) - - [Conversion](./0012-compact-and-reversible-JSON-interface.md/#Conversion) -- [Usage and impact](./0012-compact-and-reversible-JSON-interface.md/#Usage-and-impact) - - [Usage](./0012-compact-and-reversible-JSON-interface.md/#Usage) - - [Compatibility](./0012-compact-and-reversible-JSON-interface.md/#Compatibility) - - [Impacts on the pandas framework](./0012-compact-and-reversible-JSON-interface.md/#Impacts-on-the-pandas-framework) - - [Risk to do / risk not to do](./0012-compact-and-reversible-JSON-interface.md/#Risk-to-do-/-risk-not-to-do) -- [Implementation](./0012-compact-and-reversible-JSON-interface.md/#Implementation) - - [Modules](./0012-compact-and-reversible-JSON-interface.md/#Modules) - - [Implementation options](./0012-compact-and-reversible-JSON-interface.md/#Implementation-options) -- [F.A.Q.](./0012-compact-and-reversible-JSON-interface.md/#F.A.Q.) -- [Synthesis](./0012-compact-and-reversible-JSON-interface.md/Synthesis) -- [Core team decision](./0012-compact-and-reversible-JSON-interface.md/#Core-team-decision) -- [Timeline](./0012-compact-and-reversible-JSON-interface.md/#Timeline) -- [PDEP history](./0012-compact-and-reversible-JSON-interface.md/#PDEP-history) - -------------------------- +[TOC] ## Abstract diff --git a/web/pandas/static/css/pandas.css b/web/pandas/static/css/pandas.css index ec9a4bd502dd1..503a917ee5211 100644 --- a/web/pandas/static/css/pandas.css +++ b/web/pandas/static/css/pandas.css @@ -103,3 +103,23 @@ blockquote { color: #787878; font-size: 18px; } + +.toc { + background: #f0f0f0; + padding: 10px; + display: inline-block; +} +a.headerlink { + opacity: 0; +} +h2:hover a.headerlink { + opacity: 1; + transition: opacity 0.5s; +} +h3:hover a.headerlink { + opacity: 1; + transition: opacity 0.5s; +} +.container { + max-width: 120ch; +} diff --git a/web/pandas_web.py b/web/pandas_web.py index aac07433f2712..12329078143a6 100755 --- a/web/pandas_web.py +++ b/web/pandas_web.py @@ -465,9 +465,29 @@ def main( with open(os.path.join(source_path, fname), encoding="utf-8") as f: content = f.read() if extension == ".md": - body = markdown.markdown( - content, extensions=context["main"]["markdown_extensions"] - ) + if "pdeps/" in fname: + from markdown.extensions.toc import TocExtension + + body = markdown.markdown( + content, + extensions=[ + # Ignore the title of the PDEP in the table of contents + TocExtension( + title="Table of Contents", + toc_depth="2-3", + permalink=" #", + ), + "tables", + "fenced_code", + "meta", + "footnotes", + "codehilite", + ], + ) + else: + body = markdown.markdown( + content, extensions=context["main"]["markdown_extensions"] + ) # Apply Bootstrap's table formatting manually # Python-Markdown doesn't let us config table attributes by hand body = body.replace("