Skip to content

Commit

Permalink
Merge pull request #22 from sony/fix_docs
Browse files Browse the repository at this point in the history
Update __init__.py
  • Loading branch information
irenaby committed May 7, 2024
2 parents a4a7cbd + 117a952 commit 88ec967
Show file tree
Hide file tree
Showing 8 changed files with 567 additions and 321 deletions.
194 changes: 0 additions & 194 deletions docs/sony_custom_layers/keras.html

Large diffs are not rendered by default.

237 changes: 115 additions & 122 deletions docs/sony_custom_layers/pytorch.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions generate_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ fi

echo Generating docs
cd $ROOT
pdoc --docformat google -o $DOCS_DIR ./sony_custom_layers/{keras,pytorch} --no-include-undocumented --no-search
pdoc --docformat google -o $DOCS_DIR ./sony_custom_layers/{keras,pytorch} --no-include-undocumented --no-search -t ./pdoc/template

if [ "$ENV_DIR" ];then
echo Removing $ENV_DIR
rm -rf $ENV_DIR
fi
fi
38 changes: 38 additions & 0 deletions pdoc/template/error.html.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{# this template is used by pdoc's integrated web server to display runtime errors. #}
{% extends "frame.html.jinja2" %}
{% block title %}{{ error }}{% endblock %}
{% block style %}
<style>{% include "resources/bootstrap-reboot.min.css" %}</style>
<style>
body {
padding: 2rem;
max-width: 54rem;
}
footer {
text-align: right;
}
h1 {
margin-bottom: 2rem;
}
footer svg {
max-width: 70px;
max-height: 35px;
transition: all 200ms;
filter: grayscale(100%);
}
footer svg:hover {
filter: grayscale(0%);
}
</style>
{% endblock %}
{% block body %}
<h1>{{ error }}</h1>
<pre>{{ details }}</pre>
<hr>
<footer><a title="built with pdoc {{ __version__ }}"
href="https://pdoc.dev">{% include 'resources/pdoc-logo.svg' %}</a></footer>
{% endblock %}
45 changes: 45 additions & 0 deletions pdoc/template/frame.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="pdoc {{ __version__ }}"/>
<title>{% block title %}{% endblock %}</title>
{% block favicon %}
{% if favicon %}
<link rel="icon" href="{{ favicon }}"/>
{% endif %}
{% endblock %}
{% block head %}{% endblock %}
{% filter minify_css | indent %}
{% block style %}
<style>{% include "resources/bootstrap-reboot.min.css" %}</style>
<style>/*! syntax-highlighting.css */{% include "syntax-highlighting.css" %}</style>
{#
The style_pdoc, style_theme, style_layout, and style_content Jinja2 blocks are deprecated and will be
removed in a future release. Custom templates should either provide alternatives for the specific CSS files,
or append their own styles by providing `custom.css` (see examples/custom-template/).
#}
{% block style_pdoc %}
{% block style_theme %}<style>/*! theme.css */{% include "theme.css" %}</style>{% endblock %}
{% block style_layout %}<style>/*! layout.css */{% include "layout.css" %}</style>{% endblock %}
{% block style_content %}<style>/*! content.css */{% include "content.css" %}</style>{% endblock %}
{# Use this file in your custom template directory to add additional CSS styling: #}
<style>/*! custom.css */{% include "custom.css" %}</style>
{% endblock %}
{% endblock %}
{% endfilter %}
{% if math %}{% include "math.html.jinja2" %}{% endif %}
{% if mermaid %}{% include "mermaid.html.jinja2" %}{% endif %}
</head>
<body>
{% block body %}
<nav class="pdoc">
<label id="navtoggle" for="togglestate" class="pdoc-button">{% include 'resources/navtoggle.svg' %}</label>
<input id="togglestate" type="checkbox" aria-hidden="true" tabindex="-1">
<div>{% block nav %}{% endblock %}</div>
</nav>
{% block content %}{% endblock %}
{% endblock body %}
</body>
</html>
74 changes: 74 additions & 0 deletions pdoc/template/index.html.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{# this template is used to render the top-level index.html. #}
{% if root_module_name %}
{#
If there is one common parent module for all documented modules, redirect there immediately.
This makes a package's `__init__.py` the main entrypoint by default.
A custom template could override this by setting root_module_name to false before `{% extend ... %}`.
#}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./{{ root_module_name.replace(".","/") }}.html"/>
</head>
</html>
{% else %}
{% extends "frame.html.jinja2" %}
{% block title %}Module List &ndash; pdoc {{ __version__ }}{% endblock %}
{% block style %}
{{ super() | safe }}
<style>
header.pdoc {
display: flex;
align-items: center;
flex-wrap: wrap;
}
header.pdoc img {
max-width: 200px;
max-height: 75px;
padding-right: 2rem;
}
header.pdoc input[type=search] {
outline-offset: 0;
font-size: 1.5rem;
min-width: 60%;
flex-grow: 1;
padding-left: .5rem;
margin: 1.75rem 0;
}
</style>
{% endblock %}
{% block nav %}
<h2>Available Modules</h2>
<ul>
{% for submodule in all_modules if "._" not in submodule and not submodule.startswith("_") %}
<li><a href="{{ submodule.replace(".","/") }}.html">{{ submodule }}</a></li>
{% endfor %}
</ul>
{% endblock %}
{% block content %}
<header class="pdoc">
{% block logo %}
{% if logo %}
{% if logo_link %}<a href="{{ logo_link }}">{% endif %}
<img src="{{ logo }}" alt="project logo"/>
{% if logo_link %}</a>{% endif %}
{% else %}
<a href="https://pdoc.dev">
<img src="data:image/svg+xml,{% filter urlencode %}{% include "resources/pdoc-logo.svg" %}{% endfilter %}"
alt="pdoc"/>
</a>
{% endif %}
{% endblock %}
{% if search %}
<input type="search" placeholder="Search API Documentation..." aria-label="search box">
{% endif %}
</header>
<main class="pdoc"></main>
{% if search %}
{% include "search.html.jinja2" %}
{% endif %}
{% endblock %}
{% endif %}
Loading

0 comments on commit 88ec967

Please sign in to comment.