Skip to content

Commit eea6d0e

Browse files
authored
WEB: Refine PDEP presentation (#58791)
1 parent 1907822 commit eea6d0e

10 files changed

+61
-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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
html {
2+
scroll-padding-top: 5rem;
3+
}
14
body {
25
padding-top: 5em;
36
color: #444;
@@ -103,3 +106,23 @@ blockquote {
103106
color: #787878;
104107
font-size: 18px;
105108
}
109+
110+
.toc {
111+
background: #f0f0f0;
112+
padding: 10px;
113+
display: inline-block;
114+
}
115+
a.headerlink {
116+
opacity: 0;
117+
}
118+
h2:hover a.headerlink {
119+
opacity: 1;
120+
transition: opacity 0.5s;
121+
}
122+
h3:hover a.headerlink {
123+
opacity: 1;
124+
transition: opacity 0.5s;
125+
}
126+
.container {
127+
max-width: 100ch;
128+
}

web/pandas_web.py

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

0 commit comments

Comments
 (0)