-
-
Notifications
You must be signed in to change notification settings - Fork 196
/
Copy pathmodule.html.jinja2
32 lines (29 loc) · 1.08 KB
/
module.html.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{#
We want to extend the default template instead of defining everything ourselves.
#}
{% extends "default/module.html.jinja2" %}
{#
We can redefine individual blocks.
For example, if the `--favicon` option does not do what you want, you can specify a replacement like this.
#}
{% block favicon %}
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,{% filter urlencode %}{% include "resources/pdoc-logo.svg" %}{% endfilter %}"/>
{% endblock %}
{#
We can access system environment variables in the template, for example to pass version information.
#}
{% block nav_footer %}
<footer>My Package v{{ env["VERSION"] | default("1.0") }}</footer>
{% endblock %}
{#
We can also adjust which members are documented by overriding the is_public macro.
In this example, the private function `Dog.__lt__` is exposed publicly.
However, doing this is not recommended, see https://pdoc.dev/docs/pdoc.html#control-what-is-documented.
#}
{% macro is_public(doc) %}
{% if doc.qualname == "Dog.__lt__" %}
true
{% else %}
{{ default_is_public(doc) }}
{% endif %}
{% endmacro %}