-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
WEB: Refine PDEP presentation #58791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9b66357
351b79c
39c569b
acdff9c
e793a7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
[Patrick Hoefler](https://github.com/phofl) | ||
- Revision: 1 | ||
|
||
[TOC] | ||
|
||
## Abstract | ||
|
||
This PDEP proposes that: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
html { | ||
scroll-padding-top: 5rem; | ||
} | ||
body { | ||
padding-top: 5em; | ||
color: #444; | ||
|
@@ -103,3 +106,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: 100ch; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, this is what's making the page narrower. Seems intentional, do you think it looks better? I personally prefer the default bootstrap sizing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The intention here was to decrease it only on PDEP pages. Looks like that's not what's happening. On pages that are more like articles, I do indeed prefer a more narrow text (this is pretty standard in academia). |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -466,9 +466,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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because of the use of |
||
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("<table>", '<table class="table table-bordered">') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be able to combine these two, but wasn't able to figure out the syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's
You can avoid repeating the content, but I don't think you can avoid repeating a.headerlink or other things in the label.