Skip to content

Commit

Permalink
REF: HTML: Minor template changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Jun 21, 2024
1 parent 448c7be commit 5ca8395
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
32 changes: 15 additions & 17 deletions pdoc/templates/css.mako
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
#sidebar {
padding: 30px;
padding: 1.5em;
overflow: hidden;
}
#sidebar > *:last-child {
Expand Down Expand Up @@ -63,11 +63,11 @@
}
h2 {
font-size: 1.75em;
margin: 1em 0 .50em 0;
margin: 2em 0 .50em 0;
}
h3 {
font-size: 1.4em;
margin: 25px 0 10px 0;
margin: 1.6em 0 .7em 0;
}
h4 {
margin: 0;
Expand All @@ -86,11 +86,10 @@
a {
color: #058;
text-decoration: none;
transition: color .3s ease-in-out;
}
a:hover {
color: #e82;
transition: color .2s ease-in-out;
}
a:visited {color: #503}
a:hover {color: #b62}
.title code {
font-weight: bold;
Expand All @@ -100,27 +99,27 @@
}
.ident {
color: #900;
font-weight: bold;
}
pre code {
background: #f8f8f8;
font-size: .8em;
line-height: 1.4em;
padding: 1em;
display: block;
}
code {
background: #f2f2f1;
background: #f3f3f3;
font-family: "DejaVu Sans Mono", monospace;
padding: 1px 4px;
overflow-wrap: break-word;
}
h1 code { background: transparent }
pre {
background: #f8f8f8;
border: 0;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
margin: 1em 0;
padding: 1ex;
}
#http-server-module-list {
Expand Down Expand Up @@ -181,7 +180,6 @@
}
.name {
background: #eee;
font-weight: bold;
font-size: .85em;
padding: 5px 10px;
display: inline-block;
Expand Down Expand Up @@ -271,7 +269,7 @@
}
.admonition {
padding: .1em .5em;
padding: .1em 1em;
margin-bottom: 1em;
}
.admonition-title {
Expand Down Expand Up @@ -318,7 +316,7 @@
pre code {
font-size: 1em;
}
.item .name {
.name {
font-size: 1em;
}
main {
Expand All @@ -327,8 +325,8 @@
justify-content: flex-end;
}
.toc ul ul,
#index ul {
padding-left: 1.5em;
#index ul ul {
padding-left: 1em;
}
.toc > ul > li {
margin-top: .5em;
Expand Down
9 changes: 4 additions & 5 deletions pdoc/templates/html.mako
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@
<%include file="_lunr_search.inc.mako"/>
% endif
<h1>Index</h1>
${extract_toc(module.docstring) if extract_module_toc_into_sidebar else ''}
<ul id="index">
% if supermodule:
Expand Down Expand Up @@ -367,19 +366,19 @@
<html lang="${html_lang}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc ${pdoc.__version__}" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 ${pdoc.__version__}">

<%
module_list = 'modules' in context.keys() # Whether we're showing module list in server mode
%>

% if module_list:
<title>Python module list</title>
<meta name="description" content="A list of documented Python modules." />
<meta name="description" content="A list of documented Python modules.">
% else:
<title>${module.name} API documentation</title>
<meta name="description" content="${module.docstring | glimpse, trim, h}" />
<meta name="description" content="${module.docstring | glimpse, trim, h}">
% endif

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
Expand Down

0 comments on commit 5ca8395

Please sign in to comment.