Index: Lib/pydoc_data/_pydoc.css =================================================================== --- Lib/pydoc_data/_pydoc.css (revision 87546) +++ Lib/pydoc_data/_pydoc.css (working copy) @@ -2,5 +2,177 @@ CSS file for pydoc. Contents of this file are subject to change without notice. +*/ -*/ + +/* Setting underline on hover only is less busy. */ +a:link{ + text-decoration: none; + } +a:visited{ + text-decoration: none; + } +a:hover, a:active{ + text-decoration: underline; + } + + +body{background-color: #f0f0f8} + + +/* Contains header, navbar, and content. */ +div.page { + padding: .5em; + overflow: auto; + } + + +/* Contains title, version, and navigation bar. */ +div.header{ + margin-bottom: .5em; + width: 100%; + overflow: auto; + } + +/* Title */ +div.header > h1{ + display: inline-block; + margin: 0; + padding: 0 2em 0 0; + color: #59c; + background-color: inherit; + } + +/* Version info */ +div.header > p{ + display: inline-block; + margin: 0; + padding: 0; + font-style: italic; + color: gray; + } + +/* Navigation bar. */ +ul.navbar{ + padding: 0; + margin: .2em; + min-width: 16em; + background-color: #eee; + border: 1px solid #888; + overflow: auto; + } +ul.navbar li{ + margin: 0em; + padding: .25em .5em .25em .5em; + list-style: none; + display: inline-block; + } +ul.navbar form{ + margin: 0em; + padding: 0em; + display: inline-block; + } + + +/* Contains main content. */ +div.content{ + overflow: auto; + } + +/* Content title. */ +div.content > h2{ + padding: .25em; + color: white; + background-color: #59c; + } + +/* A content section that has a title. */ +dl.section{ + color: white; + background-color: #59c; + } +dl.section > dt{ + font-weight: bold; + padding: .25em .25em .25em .5em; + } +dl.section > dd{ + padding: 1ex; + color: black; + background-color: #f8f8ff; + } + + +/* A section with no left vertical bar. */ +dl.subsection{ + color: white; + background-color: #59c; + } +dl.subsection > dt{ + font-weight: bold; + padding: .25em .25em .25em .5em; + } +dl.subsection > dd{ + margin-left: 0; + padding: 1ex; + color: black; + background-color: #f8f8ff; + } + +/* sections types */ +dl.modules{background-color: #a0a;} + +dl.module{background-color: #b3a;} + +dl.classes{background-color: #e7a;} + +dl.class{ + color: black; + background-color: #fbc; + } + +dl.methods{background-color: #fdd;} + +dl.method{} + +dl.data{background-color: #090;} + +dl.data-item{} + +dl.functions{background-color: #f80;} + +dl.function{} + + +pre.docstring{ + margin: 0 0 0 4ex; + padding: 1ex; + } +pre.docstring > code{ + background-color: #eeeeff; + } + + +ul.data li{ + list-style: none; + margin: .25em; + padding: .25em .25em .25em 1em; + background-color: #eeeeff; + } + + +/* index */ +ul.index{ + padding-left: 9ex; + } +ul.index > li{ + text-indent: -8ex; + list-style: none; + } + +/* index columns */ +ul.index.columns{overflow: auto;} +ul.index.columns > li{ + float: left; + min-width: 13em; + } + Index: Lib/pydoc.py =================================================================== --- Lib/pydoc.py (revision 87546) +++ Lib/pydoc.py (working copy) @@ -2471,16 +2471,32 @@ def page(self, title, contents): """Format an HTML page.""" - css_path = "pydoc_data/_pydoc.css" - css_link = ( - '' % - css_path) - return '''\ + values = dict( + title = title, + css_path = "pydoc_data/_pydoc.css", + header = html_header(), + content = contents, + ) + template = \ +'''\ -
{version} - [{build}, {compiler}, {platform}] +
+%s' % contents + contents = '
%s' % html.markup(contents) contents = html.bigsection(topic , '#ffffff','#ee77aa', contents) xrefs = sorted(xrefs.split()) @@ -2685,7 +2703,7 @@ contents = html_error( 'no Python documentation found for %r' % url) title = 'Error' - return html.page(title, html_navbar() + contents) + return html.page(title, contents) if url.startswith('/'): url = url[1:]