Skip to content

Commit 9b66357

Browse files
committed
WEB: Refine PDEP presentation
1 parent 3f8f704 commit 9b66357

10 files changed

+58
-33
lines changed

web/pandas/pdeps/0001-purpose-and-guidelines.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
[Noa Tamir](https://github.com/noatamir)
99
- Revision: 3
1010

11+
[TOC]
12+
1113
## PDEP definition, purpose and scope
1214

1315
A PDEP (pandas enhancement proposal) is a proposal for a **major** change in

web/pandas/pdeps/0004-consistent-to-datetime-parsing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- Author: [Marco Gorelli](https://github.com/MarcoGorelli)
77
- Revision: 2
88

9+
[TOC]
10+
911
## Abstract
1012

1113
The suggestion is that:

web/pandas/pdeps/0005-no-default-index-mode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- Author: [Marco Gorelli](https://github.com/MarcoGorelli)
77
- Revision: 2
88

9+
[TOC]
10+
911
## Abstract
1012

1113
The suggestion is to add a ``NoRowIndex`` class. Internally, it would act a bit like

web/pandas/pdeps/0006-ban-upcasting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- 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))
77
- Revision: 1
88

9+
[TOC]
10+
911
## Abstract
1012

1113
The suggestion is that setitem-like operations would

web/pandas/pdeps/0007-copy-on-write.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- Author: [Joris Van den Bossche](https://github.com/jorisvandenbossche)
77
- Revision: 1
88

9+
[TOC]
10+
911
## Abstract
1012

1113
Short summary of the proposal:

web/pandas/pdeps/0009-io-extensions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- Author: [Marc Garcia](https://github.com/datapythonista)
88
- Revision: 1
99

10+
[TOC]
11+
1012
## PDEP Summary
1113

1214
This document proposes that third-party projects implementing I/O or memory

web/pandas/pdeps/0010-required-pyarrow-dependency.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
[Patrick Hoefler](https://github.com/phofl)
99
- Revision: 1
1010

11+
[TOC]
12+
1113
## Abstract
1214

1315
This PDEP proposes that:

web/pandas/pdeps/0012-compact-and-reversible-JSON-interface.md

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,7 @@
88
- Author: [Philippe THOMY](https://github.com/loco-philippe)
99
- Revision: 3
1010

11-
##### Summary
12-
13-
- [Abstract](./0012-compact-and-reversible-JSON-interface.md/#Abstract)
14-
- [Problem description](./0012-compact-and-reversible-JSON-interface.md/#Problem-description)
15-
- [Feature Description](./0012-compact-and-reversible-JSON-interface.md/#Feature-Description)
16-
- [Scope](./0012-compact-and-reversible-JSON-interface.md/#Scope)
17-
- [Motivation](./0012-compact-and-reversible-JSON-interface.md/#Motivation)
18-
- [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-?)
19-
- [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-?)
20-
- [Is this only useful for pandas ?](./0012-compact-and-reversible-JSON-interface.md/#Is-this-only-useful-for-pandas-?)
21-
- [Description](./0012-compact-and-reversible-JSON-interface.md/#Description)
22-
- [Data typing](./0012-compact-and-reversible-JSON-interface.md/#Data-typing)
23-
- [Correspondence between TableSchema and pandas](./panda0012-compact-and-reversible-JSON-interfaces_PDEP.md/#Correspondence-between-TableSchema-and-pandas)
24-
- [JSON format](./0012-compact-and-reversible-JSON-interface.md/#JSON-format)
25-
- [Conversion](./0012-compact-and-reversible-JSON-interface.md/#Conversion)
26-
- [Usage and impact](./0012-compact-and-reversible-JSON-interface.md/#Usage-and-impact)
27-
- [Usage](./0012-compact-and-reversible-JSON-interface.md/#Usage)
28-
- [Compatibility](./0012-compact-and-reversible-JSON-interface.md/#Compatibility)
29-
- [Impacts on the pandas framework](./0012-compact-and-reversible-JSON-interface.md/#Impacts-on-the-pandas-framework)
30-
- [Risk to do / risk not to do](./0012-compact-and-reversible-JSON-interface.md/#Risk-to-do-/-risk-not-to-do)
31-
- [Implementation](./0012-compact-and-reversible-JSON-interface.md/#Implementation)
32-
- [Modules](./0012-compact-and-reversible-JSON-interface.md/#Modules)
33-
- [Implementation options](./0012-compact-and-reversible-JSON-interface.md/#Implementation-options)
34-
- [F.A.Q.](./0012-compact-and-reversible-JSON-interface.md/#F.A.Q.)
35-
- [Synthesis](./0012-compact-and-reversible-JSON-interface.md/Synthesis)
36-
- [Core team decision](./0012-compact-and-reversible-JSON-interface.md/#Core-team-decision)
37-
- [Timeline](./0012-compact-and-reversible-JSON-interface.md/#Timeline)
38-
- [PDEP history](./0012-compact-and-reversible-JSON-interface.md/#PDEP-history)
39-
40-
-------------------------
11+
[TOC]
4112

4213
## Abstract
4314

web/pandas/static/css/pandas.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,23 @@ blockquote {
103103
color: #787878;
104104
font-size: 18px;
105105
}
106+
107+
.toc {
108+
background: #f0f0f0;
109+
padding: 10px;
110+
display: inline-block;
111+
}
112+
a.headerlink {
113+
opacity: 0;
114+
}
115+
h2:hover a.headerlink {
116+
opacity: 1;
117+
transition: opacity 0.5s;
118+
}
119+
h3:hover a.headerlink {
120+
opacity: 1;
121+
transition: opacity 0.5s;
122+
}
123+
.container {
124+
max-width: 120ch;
125+
}

web/pandas_web.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,29 @@ def main(
465465
with open(os.path.join(source_path, fname), encoding="utf-8") as f:
466466
content = f.read()
467467
if extension == ".md":
468-
body = markdown.markdown(
469-
content, extensions=context["main"]["markdown_extensions"]
470-
)
468+
if "pdeps/" in fname:
469+
from markdown.extensions.toc import TocExtension
470+
471+
body = markdown.markdown(
472+
content,
473+
extensions=[
474+
# Ignore the title of the PDEP in the table of contents
475+
TocExtension(
476+
title="Table of Contents",
477+
toc_depth="2-3",
478+
permalink=" #",
479+
),
480+
"tables",
481+
"fenced_code",
482+
"meta",
483+
"footnotes",
484+
"codehilite",
485+
],
486+
)
487+
else:
488+
body = markdown.markdown(
489+
content, extensions=context["main"]["markdown_extensions"]
490+
)
471491
# Apply Bootstrap's table formatting manually
472492
# Python-Markdown doesn't let us config table attributes by hand
473493
body = body.replace("<table>", '<table class="table table-bordered">')

0 commit comments

Comments
 (0)