Big documentation and structure updates
- Split math into fdmath package - Rename waveguide into _2d _3d and _cyl variants - pdoc-based documentation
This commit is contained in:
parent
f0ef31c25d
commit
d6e7e3dee1
25 changed files with 2590 additions and 1349 deletions
46
pdoc_templates/config.mako
Normal file
46
pdoc_templates/config.mako
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<%!
|
||||
# Template configuration. Copy over in your template directory
|
||||
# (used with --template-dir) and adapt as required.
|
||||
html_lang = 'en'
|
||||
show_inherited_members = False
|
||||
extract_module_toc_into_sidebar = True
|
||||
list_class_variables_in_index = True
|
||||
sort_identifiers = True
|
||||
show_type_annotations = True
|
||||
|
||||
# Show collapsed source code block next to each item.
|
||||
# Disabling this can improve rendering speed of large modules.
|
||||
show_source_code = True
|
||||
|
||||
# If set, format links to objects in online source code repository
|
||||
# according to this template. Supported keywords for interpolation
|
||||
# are: commit, path, start_line, end_line.
|
||||
#git_link_template = 'https://github.com/USER/PROJECT/blob/{commit}/{path}#L{start_line}-L{end_line}'
|
||||
#git_link_template = 'https://gitlab.com/USER/PROJECT/blob/{commit}/{path}#L{start_line}-L{end_line}'
|
||||
#git_link_template = 'https://bitbucket.org/USER/PROJECT/src/{commit}/{path}#lines-{start_line}:{end_line}'
|
||||
#git_link_template = 'https://CGIT_HOSTNAME/PROJECT/tree/{path}?id={commit}#n{start-line}'
|
||||
git_link_template = None
|
||||
|
||||
# A prefix to use for every HTML hyperlink in the generated documentation.
|
||||
# No prefix results in all links being relative.
|
||||
link_prefix = ''
|
||||
|
||||
# Enable syntax highlighting for code/source blocks by including Highlight.js
|
||||
syntax_highlighting = True
|
||||
|
||||
# Set the style keyword such as 'atom-one-light' or 'github-gist'
|
||||
# Options: https://github.com/highlightjs/highlight.js/tree/master/src/styles
|
||||
# Demo: https://highlightjs.org/static/demo/
|
||||
hljs_style = 'github'
|
||||
|
||||
# If set, insert Google Analytics tracking code. Value is GA
|
||||
# tracking id (UA-XXXXXX-Y).
|
||||
google_analytics = ''
|
||||
|
||||
# If set, render LaTeX math syntax within \(...\) (inline equations),
|
||||
# or within \[...\] or $$...$$ or `.. math::` (block equations)
|
||||
# as nicely-formatted math formulas using MathJax.
|
||||
# Note: in Python docstrings, either all backslashes need to be escaped (\\)
|
||||
# or you need to use raw r-strings.
|
||||
latex_math = True
|
||||
%>
|
||||
389
pdoc_templates/css.mako
Normal file
389
pdoc_templates/css.mako
Normal file
|
|
@ -0,0 +1,389 @@
|
|||
<%!
|
||||
from pdoc.html_helpers import minify_css
|
||||
%>
|
||||
|
||||
<%def name="mobile()" filter="minify_css">
|
||||
.flex {
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
body {
|
||||
line-height: 1.5em;
|
||||
background: black;
|
||||
color: #DDD;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
padding: 30px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.http-server-breadcrumbs {
|
||||
font-size: 130%;
|
||||
margin: 0 0 15px 0;
|
||||
}
|
||||
|
||||
#footer {
|
||||
font-size: .75em;
|
||||
padding: 5px 30px;
|
||||
border-top: 1px solid #ddd;
|
||||
text-align: right;
|
||||
}
|
||||
#footer p {
|
||||
margin: 0 0 0 1em;
|
||||
display: inline-block;
|
||||
}
|
||||
#footer p:last-child {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-weight: 300;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2.5em;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.75em;
|
||||
margin: 1em 0 .50em 0;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.4em;
|
||||
margin: 25px 0 10px 0;
|
||||
}
|
||||
h4 {
|
||||
margin: 0;
|
||||
font-size: 105%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
transition: color .3s ease-in-out;
|
||||
}
|
||||
a:hover {
|
||||
color: #18d;
|
||||
}
|
||||
|
||||
.title code {
|
||||
font-weight: bold;
|
||||
}
|
||||
h2[id^="header-"] {
|
||||
margin-top: 2em;
|
||||
}
|
||||
.ident {
|
||||
color: #7ff;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background: transparent;
|
||||
font-size: .8em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
code {
|
||||
background: #0d0d0e;
|
||||
padding: 1px 4px;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
h1 code { background: transparent }
|
||||
|
||||
pre {
|
||||
background: #111;
|
||||
border: 0;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: 1em 0;
|
||||
padding: 1ex;
|
||||
}
|
||||
|
||||
#http-server-module-list {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
}
|
||||
#http-server-module-list div {
|
||||
display: flex;
|
||||
}
|
||||
#http-server-module-list dt {
|
||||
min-width: 10%;
|
||||
}
|
||||
#http-server-module-list p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.toc ul,
|
||||
#index {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#index code {
|
||||
background: transparent;
|
||||
}
|
||||
#index h3 {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
#index ul {
|
||||
padding: 0;
|
||||
}
|
||||
#index h4 {
|
||||
font-weight: bold;
|
||||
}
|
||||
#index h4 + ul {
|
||||
margin-bottom:.6em;
|
||||
}
|
||||
/* Make TOC lists have 2+ columns when viewport is wide enough.
|
||||
Assuming ~20-character identifiers and ~30% wide sidebar. */
|
||||
@media (min-width: 200ex) { #index .two-column { column-count: 2 } }
|
||||
@media (min-width: 300ex) { #index .two-column { column-count: 3 } }
|
||||
|
||||
dl {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
dl dl:last-child {
|
||||
margin-bottom: 4em;
|
||||
}
|
||||
dd {
|
||||
margin: 0 0 1em 3em;
|
||||
}
|
||||
#header-classes + dl > dd {
|
||||
margin-bottom: 3em;
|
||||
}
|
||||
dd dd {
|
||||
margin-left: 2em;
|
||||
}
|
||||
dd p {
|
||||
margin: 10px 0;
|
||||
}
|
||||
.name {
|
||||
background: #111;
|
||||
font-weight: bold;
|
||||
font-size: .85em;
|
||||
padding: 5px 10px;
|
||||
display: inline-block;
|
||||
min-width: 40%;
|
||||
}
|
||||
.name:hover {
|
||||
background: #101010;
|
||||
}
|
||||
.name > span:first-child {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.name.class > span:nth-child(2) {
|
||||
margin-left: .4em;
|
||||
}
|
||||
.inherited {
|
||||
color: #777;
|
||||
border-left: 5px solid #eee;
|
||||
padding-left: 1em;
|
||||
}
|
||||
.inheritance em {
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Docstrings titles, e.g. in numpydoc format */
|
||||
.desc h2 {
|
||||
font-weight: 400;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.desc h3 {
|
||||
font-size: 1em;
|
||||
}
|
||||
.desc dt code {
|
||||
background: inherit; /* Don't grey-back parameters */
|
||||
}
|
||||
|
||||
.source summary,
|
||||
.git-link-div {
|
||||
color: #aaa;
|
||||
text-align: right;
|
||||
font-weight: 400;
|
||||
font-size: .8em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.source summary > * {
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
.git-link {
|
||||
color: inherit;
|
||||
margin-left: 1em;
|
||||
}
|
||||
.source pre {
|
||||
max-height: 500px;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
}
|
||||
.source pre code {
|
||||
font-size: 12px;
|
||||
overflow: visible;
|
||||
}
|
||||
.hlist {
|
||||
list-style: none;
|
||||
}
|
||||
.hlist li {
|
||||
display: inline;
|
||||
}
|
||||
.hlist li:after {
|
||||
content: ',\2002';
|
||||
}
|
||||
.hlist li:last-child:after {
|
||||
content: none;
|
||||
}
|
||||
.hlist .hlist {
|
||||
display: inline;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.admonition {
|
||||
padding: .1em .5em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.admonition-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
.admonition.note,
|
||||
.admonition.info,
|
||||
.admonition.important {
|
||||
background: #610;
|
||||
}
|
||||
.admonition.todo,
|
||||
.admonition.versionadded,
|
||||
.admonition.tip,
|
||||
.admonition.hint {
|
||||
background: #202;
|
||||
}
|
||||
.admonition.warning,
|
||||
.admonition.versionchanged,
|
||||
.admonition.deprecated {
|
||||
background: #02b;
|
||||
}
|
||||
.admonition.error,
|
||||
.admonition.danger,
|
||||
.admonition.caution {
|
||||
background: darkpink;
|
||||
}
|
||||
</%def>
|
||||
|
||||
<%def name="desktop()" filter="minify_css">
|
||||
@media screen and (min-width: 700px) {
|
||||
#sidebar {
|
||||
width: 30%;
|
||||
}
|
||||
#content {
|
||||
width: 70%;
|
||||
max-width: 100ch;
|
||||
padding: 3em 4em;
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
pre code {
|
||||
font-size: 1em;
|
||||
}
|
||||
.item .name {
|
||||
font-size: 1em;
|
||||
}
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.toc ul ul,
|
||||
#index ul {
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
.toc > ul > li {
|
||||
margin-top: .5em;
|
||||
}
|
||||
}
|
||||
</%def>
|
||||
|
||||
<%def name="print()" filter="minify_css">
|
||||
@media print {
|
||||
#sidebar h1 {
|
||||
page-break-before: always;
|
||||
}
|
||||
.source {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media print {
|
||||
* {
|
||||
background: transparent !important;
|
||||
color: #000 !important; /* Black prints faster: h5bp.com/s */
|
||||
box-shadow: none !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
|
||||
a[href]:after {
|
||||
content: " (" attr(href) ")";
|
||||
font-size: 90%;
|
||||
}
|
||||
/* Internal, documentation links, recognized by having a title,
|
||||
don't need the URL explicity stated. */
|
||||
a[href][title]:after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
abbr[title]:after {
|
||||
content: " (" attr(title) ")";
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't show links for images, or javascript/internal links
|
||||
*/
|
||||
|
||||
.ir a:after,
|
||||
a[href^="javascript:"]:after,
|
||||
a[href^="#"]:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
pre,
|
||||
blockquote {
|
||||
border: 1px solid #999;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
thead {
|
||||
display: table-header-group; /* h5bp.com/t */
|
||||
}
|
||||
|
||||
tr,
|
||||
img {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
@page {
|
||||
margin: 0.5cm;
|
||||
}
|
||||
|
||||
p,
|
||||
h2,
|
||||
h3 {
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
page-break-after: avoid;
|
||||
}
|
||||
}
|
||||
</%def>
|
||||
421
pdoc_templates/html.mako
Normal file
421
pdoc_templates/html.mako
Normal file
|
|
@ -0,0 +1,421 @@
|
|||
<%
|
||||
import os
|
||||
|
||||
import pdoc
|
||||
from pdoc.html_helpers import extract_toc, glimpse, to_html as _to_html, format_git_link
|
||||
|
||||
|
||||
def link(d, name=None, fmt='{}'):
|
||||
name = fmt.format(name or d.qualname + ('()' if isinstance(d, pdoc.Function) else ''))
|
||||
if not isinstance(d, pdoc.Doc) or isinstance(d, pdoc.External) and not external_links:
|
||||
return name
|
||||
url = d.url(relative_to=module, link_prefix=link_prefix,
|
||||
top_ancestor=not show_inherited_members)
|
||||
return '<a title="{}" href="{}">{}</a>'.format(d.refname, url, name)
|
||||
|
||||
|
||||
def to_html(text):
|
||||
return _to_html(text, module=module, link=link, latex_math=latex_math)
|
||||
%>
|
||||
|
||||
<%def name="ident(name)"><span class="ident">${name}</span></%def>
|
||||
|
||||
<%def name="show_source(d)">
|
||||
% if (show_source_code or git_link_template) and d.source and d.obj is not getattr(d.inherits, 'obj', None):
|
||||
<% git_link = format_git_link(git_link_template, d) %>
|
||||
% if show_source_code:
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
% if git_link:
|
||||
<a href="${git_link}" class="git-link">Browse git</a>
|
||||
%endif
|
||||
</summary>
|
||||
<pre><code class="python">${d.source | h}</code></pre>
|
||||
</details>
|
||||
% elif git_link:
|
||||
<div class="git-link-div"><a href="${git_link}" class="git-link">Browse git</a></div>
|
||||
%endif
|
||||
%endif
|
||||
</%def>
|
||||
|
||||
<%def name="show_desc(d, short=False)">
|
||||
<%
|
||||
inherits = ' inherited' if d.inherits else ''
|
||||
docstring = glimpse(d.docstring) if short or inherits else d.docstring
|
||||
%>
|
||||
% if d.inherits:
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
% if hasattr(d.inherits, 'cls'):
|
||||
<code>${link(d.inherits.cls)}</code>.<code>${link(d.inherits, d.name)}</code>
|
||||
% else:
|
||||
<code>${link(d.inherits)}</code>
|
||||
% endif
|
||||
</p>
|
||||
% endif
|
||||
<section class="desc${inherits}">${docstring | to_html}</section>
|
||||
% if not isinstance(d, pdoc.Module):
|
||||
${show_source(d)}
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="show_module_list(modules)">
|
||||
<h1>Python module list</h1>
|
||||
|
||||
% if not modules:
|
||||
<p>No modules found.</p>
|
||||
% else:
|
||||
<dl id="http-server-module-list">
|
||||
% for name, desc in modules:
|
||||
<div class="flex">
|
||||
<dt><a href="${link_prefix}${name}">${name}</a></dt>
|
||||
<dd>${desc | glimpse, to_html}</dd>
|
||||
</div>
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="show_column_list(items)">
|
||||
<%
|
||||
two_column = len(items) >= 6 and all(len(i.name) < 20 for i in items)
|
||||
%>
|
||||
<ul class="${'two-column' if two_column else ''}">
|
||||
% for item in items:
|
||||
<li><code>${link(item, item.name)}</code></li>
|
||||
% endfor
|
||||
</ul>
|
||||
</%def>
|
||||
|
||||
<%def name="show_module(module)">
|
||||
<%
|
||||
variables = module.variables(sort=sort_identifiers)
|
||||
classes = module.classes(sort=sort_identifiers)
|
||||
functions = module.functions(sort=sort_identifiers)
|
||||
submodules = module.submodules()
|
||||
%>
|
||||
|
||||
<%def name="show_func(f)">
|
||||
<dt id="${f.refname}"><code class="name flex">
|
||||
<%
|
||||
params = ', '.join(f.params(annotate=show_type_annotations, link=link))
|
||||
returns = show_type_annotations and f.return_annotation(link=link) or ''
|
||||
if returns:
|
||||
returns = ' ->\N{NBSP}' + returns
|
||||
%>
|
||||
<span>${f.funcdef()} ${ident(f.name)}</span>(<span>${params})${returns}</span>
|
||||
</code></dt>
|
||||
<dd>${show_desc(f)}</dd>
|
||||
</%def>
|
||||
|
||||
<header>
|
||||
% if http_server:
|
||||
<nav class="http-server-breadcrumbs">
|
||||
<a href="/">All packages</a>
|
||||
<% parts = module.name.split('.')[:-1] %>
|
||||
% for i, m in enumerate(parts):
|
||||
<% parent = '.'.join(parts[:i+1]) %>
|
||||
:: <a href="/${parent.replace('.', '/')}/">${parent}</a>
|
||||
% endfor
|
||||
</nav>
|
||||
% endif
|
||||
<h1 class="title">${'Namespace' if module.is_namespace else 'Module'} <code>${module.name}</code></h1>
|
||||
</header>
|
||||
|
||||
<section id="section-intro">
|
||||
${module.docstring | to_html}
|
||||
${show_source(module)}
|
||||
</section>
|
||||
|
||||
<section>
|
||||
% if submodules:
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
% for m in submodules:
|
||||
<dt><code class="name">${link(m)}</code></dt>
|
||||
<dd>${show_desc(m, short=True)}</dd>
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
</section>
|
||||
|
||||
<section>
|
||||
% if variables:
|
||||
<h2 class="section-title" id="header-variables">Global variables</h2>
|
||||
<dl>
|
||||
% for v in variables:
|
||||
<dt id="${v.refname}"><code class="name">var ${ident(v.name)}</code></dt>
|
||||
<dd>${show_desc(v)}</dd>
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
</section>
|
||||
|
||||
<section>
|
||||
% if functions:
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
% for f in functions:
|
||||
${show_func(f)}
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
</section>
|
||||
|
||||
<section>
|
||||
% if classes:
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
% for c in classes:
|
||||
<%
|
||||
class_vars = c.class_variables(show_inherited_members, sort=sort_identifiers)
|
||||
smethods = c.functions(show_inherited_members, sort=sort_identifiers)
|
||||
inst_vars = c.instance_variables(show_inherited_members, sort=sort_identifiers)
|
||||
methods = c.methods(show_inherited_members, sort=sort_identifiers)
|
||||
mro = c.mro()
|
||||
subclasses = c.subclasses()
|
||||
params = ', '.join(c.params(annotate=show_type_annotations, link=link))
|
||||
%>
|
||||
<dt id="${c.refname}"><code class="flex name class">
|
||||
<span>class ${ident(c.name)}</span>
|
||||
% if params:
|
||||
<span>(</span><span>${params})</span>
|
||||
% endif
|
||||
</code></dt>
|
||||
|
||||
<dd>${show_desc(c)}
|
||||
|
||||
% if mro:
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
% for cls in mro:
|
||||
<li>${link(cls)}</li>
|
||||
% endfor
|
||||
</ul>
|
||||
%endif
|
||||
|
||||
% if subclasses:
|
||||
<h3>Subclasses</h3>
|
||||
<ul class="hlist">
|
||||
% for sub in subclasses:
|
||||
<li>${link(sub)}</li>
|
||||
% endfor
|
||||
</ul>
|
||||
% endif
|
||||
% if class_vars:
|
||||
<h3>Class variables</h3>
|
||||
<dl>
|
||||
% for v in class_vars:
|
||||
<dt id="${v.refname}"><code class="name">var ${ident(v.name)}</code></dt>
|
||||
<dd>${show_desc(v)}</dd>
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
% if smethods:
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
% for f in smethods:
|
||||
${show_func(f)}
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
% if inst_vars:
|
||||
<h3>Instance variables</h3>
|
||||
<dl>
|
||||
% for v in inst_vars:
|
||||
<dt id="${v.refname}"><code class="name">var ${ident(v.name)}</code></dt>
|
||||
<dd>${show_desc(v)}</dd>
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
% if methods:
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
% for f in methods:
|
||||
${show_func(f)}
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
|
||||
% if not show_inherited_members:
|
||||
<%
|
||||
members = c.inherited_members()
|
||||
%>
|
||||
% if members:
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
% for cls, mems in members:
|
||||
<li><code><b>${link(cls)}</b></code>:
|
||||
<ul class="hlist">
|
||||
% for m in mems:
|
||||
<li><code>${link(m, name=m.name)}</code></li>
|
||||
% endfor
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
% endif
|
||||
% endif
|
||||
|
||||
</dd>
|
||||
% endfor
|
||||
</dl>
|
||||
% endif
|
||||
</section>
|
||||
</%def>
|
||||
|
||||
<%def name="module_index(module)">
|
||||
<%
|
||||
variables = module.variables(sort=sort_identifiers)
|
||||
classes = module.classes(sort=sort_identifiers)
|
||||
functions = module.functions(sort=sort_identifiers)
|
||||
submodules = module.submodules()
|
||||
supermodule = module.supermodule
|
||||
%>
|
||||
<nav id="sidebar">
|
||||
|
||||
<%include file="logo.mako"/>
|
||||
|
||||
<h1>Index</h1>
|
||||
${extract_toc(module.docstring) if extract_module_toc_into_sidebar else ''}
|
||||
<ul id="index">
|
||||
% if supermodule:
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code>${link(supermodule)}</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
% endif
|
||||
|
||||
% if submodules:
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
% for m in submodules:
|
||||
<li><code>${link(m)}</code></li>
|
||||
% endfor
|
||||
</ul>
|
||||
</li>
|
||||
% endif
|
||||
|
||||
% if variables:
|
||||
<li><h3><a href="#header-variables">Global variables</a></h3>
|
||||
${show_column_list(variables)}
|
||||
</li>
|
||||
% endif
|
||||
|
||||
% if functions:
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
${show_column_list(functions)}
|
||||
</li>
|
||||
% endif
|
||||
|
||||
% if classes:
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
% for c in classes:
|
||||
<li>
|
||||
<h4><code>${link(c)}</code></h4>
|
||||
<%
|
||||
members = c.functions(sort=sort_identifiers) + c.methods(sort=sort_identifiers)
|
||||
if list_class_variables_in_index:
|
||||
members += (c.instance_variables(sort=sort_identifiers) +
|
||||
c.class_variables(sort=sort_identifiers))
|
||||
if not show_inherited_members:
|
||||
members = [i for i in members if not i.inherits]
|
||||
if sort_identifiers:
|
||||
members = sorted(members)
|
||||
%>
|
||||
% if members:
|
||||
${show_column_list(members)}
|
||||
% endif
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
</li>
|
||||
% endif
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</%def>
|
||||
|
||||
<!doctype html>
|
||||
<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__}" />
|
||||
|
||||
<%
|
||||
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." />
|
||||
% else:
|
||||
<title>${module.name} API documentation</title>
|
||||
<meta name="description" content="${module.docstring | glimpse, trim, h}" />
|
||||
% endif
|
||||
|
||||
<link href='https://mpxd.net/scripts/normalize.css/normalize.css' rel='stylesheet'>
|
||||
<link href='https://mpxd.net/scripts/sanitize.css/sanitize.css' rel='stylesheet'>
|
||||
% if syntax_highlighting:
|
||||
<link href="https://mpxd.net/scripts/highlightjs/styles/${hljs_style}.min.css" rel="stylesheet">
|
||||
%endif
|
||||
|
||||
<%namespace name="css" file="css.mako" />
|
||||
<style>${css.mobile()}</style>
|
||||
<style media="screen and (min-width: 700px)">${css.desktop()}</style>
|
||||
<style media="print">${css.print()}</style>
|
||||
|
||||
% if google_analytics:
|
||||
<script>
|
||||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||
ga('create', '${google_analytics}', 'auto'); ga('send', 'pageview');
|
||||
</script><script async src='https://www.google-analytics.com/analytics.js'></script>
|
||||
% endif
|
||||
|
||||
% if latex_math:
|
||||
<script async src='https://mpxd.net/scripts/MathJax/MathJax.js?config=TeX-AMS_CHTML'></script>
|
||||
% endif
|
||||
|
||||
<%include file="head.mako"/>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
% if module_list:
|
||||
<article id="content">
|
||||
${show_module_list(modules)}
|
||||
</article>
|
||||
% else:
|
||||
<article id="content">
|
||||
${show_module(module)}
|
||||
</article>
|
||||
${module_index(module)}
|
||||
% endif
|
||||
</main>
|
||||
|
||||
<footer id="footer">
|
||||
<%include file="credits.mako"/>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> ${pdoc.__version__}</a>.</p>
|
||||
</footer>
|
||||
|
||||
% if syntax_highlighting:
|
||||
<script src="https://mpxd.net/scripts/highlightjs/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad()</script>
|
||||
% endif
|
||||
|
||||
% if http_server and module: ## Auto-reload on file change in dev mode
|
||||
<script>
|
||||
setInterval(() =>
|
||||
fetch(window.location.href, {
|
||||
method: "HEAD",
|
||||
cache: "no-store",
|
||||
headers: {"If-None-Match": "${os.stat(module.obj.__file__).st_mtime}"},
|
||||
}).then(response => response.ok && window.location.reload()), 700);
|
||||
</script>
|
||||
% endif
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue