File: module.html.jinja2

package info (click to toggle)
python-pdoc 15.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,192 kB
  • sloc: python: 8,013; javascript: 1,156; makefile: 18; sh: 3
file content (32 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download
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 %}