Skip to content

Commit 3380ef6

Browse files
Address review comments
- Restore the non-breakable space before "(package)" in module index links. - Indent the navigation bar HTML template. - Use the "keyword" CSS class for keyword help pages, in addition to "topic" for topic help pages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 99571ba commit 3380ef6

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

Lib/pydoc.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def modpkglink(self, modpkginfo):
706706
else:
707707
url = '%s.html' % name
708708
if ispackage:
709-
text = '<strong>%s</strong> (package)' % name
709+
text = '<strong>%s</strong>&nbsp;(package)' % name
710710
else:
711711
text = name
712712
return '<a href="%s">%s</a>' % (url, text)
@@ -2499,22 +2499,22 @@ def html_navbar():
24992499
platform.python_compiler()))
25002500
return """
25012501
<nav class="navbar">
2502-
<div class="navbar-version">Python %s<br>%s</div>
2503-
<ul>
2504-
<li><a href="index.html">Module Index</a></li>
2505-
<li><a href="topics.html">Topics</a></li>
2506-
<li><a href="keywords.html">Keywords</a></li>
2507-
</ul>
2508-
<div>
2509-
<form action="get">
2510-
<input type="search" name="key" size="15" placeholder="Get help on ...">
2511-
<input type="submit" value="Get">
2512-
</form>
2513-
<form action="search">
2514-
<input type="search" name="key" size="15" placeholder="Search modules">
2515-
<input type="submit" value="Search">
2516-
</form>
2517-
</div>
2502+
<div class="navbar-version">Python %s<br>%s</div>
2503+
<ul>
2504+
<li><a href="index.html">Module Index</a></li>
2505+
<li><a href="topics.html">Topics</a></li>
2506+
<li><a href="keywords.html">Keywords</a></li>
2507+
</ul>
2508+
<div>
2509+
<form action="get">
2510+
<input type="search" name="key" size="15" placeholder="Get help on ...">
2511+
<input type="submit" value="Get">
2512+
</form>
2513+
<form action="search">
2514+
<input type="search" name="key" size="15" placeholder="Search modules">
2515+
<input type="submit" value="Search">
2516+
</form>
2517+
</div>
25182518
</nav>
25192519
""" % (version, html.escape(platform.platform(terse=True)))
25202520

@@ -2601,7 +2601,8 @@ def html_topicpage(topic):
26012601
else:
26022602
title = 'TOPIC'
26032603
heading = html.heading('%s %s' % (title.capitalize(), topic))
2604-
contents = '<pre class="topic">%s</pre>' % html.markup(contents)
2604+
contents = ('<pre class="%s">%s</pre>'
2605+
% (title.lower(), html.markup(contents)))
26052606
if xrefs:
26062607
xrefs = sorted(xrefs.split())
26072608

Lib/pydoc_data/_pydoc.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ section section {
127127
margin: 0.3em 0;
128128
}
129129

130-
pre.topic {
130+
pre.topic, pre.keyword {
131131
background-color: var(--block-background-color);
132132
border: 1px solid var(--block-border-color);
133133
border-radius: 3px;

0 commit comments

Comments
 (0)