adjust to template changes in pdoc 10 (#5132)

This commit is contained in:
Maximilian Hils 2022-02-14 16:07:20 +01:00 committed by GitHub
parent f85c64401b
commit 2d2a9f3c52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View file

@ -1,3 +1,9 @@
{% block style %}{% endblock %}
{% block body %}{% endblock %}
{% filter minify_css %}
{% block style %}
<style>/*! theme.css */{% include "theme.css" %}</style>
<style>/*! content.css */{% include "content.css" %}</style>
<style>.pdoc h1 { margin-bottom: 1em; }</style>
{% endblock %}
{% endfilter %}
{% block content %}{% endblock %}
<div class="pdoc" style="margin-top: 4rem">{% block attribution %}{% endblock %}</div>

View file

@ -1,7 +1,4 @@
{% extends "default/module.html.jinja2" %}
{% block nav %}{% endblock %}
{% block style_layout %}{% endblock %}
{% block style_pygments %}{% endblock %}
{#
To document all event hooks, we do a bit of hackery:
1. scripts/api-events.py auto-generates generated/events.py.
@ -12,8 +9,14 @@ To document all event hooks, we do a bit of hackery:
{% if module.name == "events" %}
{% macro module_name() %}
{% endmacro %}
{% macro class(cls) %}
<div class="attr class">
{{ headerlink(cls) }}
<span class="name">{{ cls.qualname.replace("Events", " Events") }}</span>
</div>
{% endmacro %}
{% macro view_source(doc) %}
{% if doc.type != "module" %}
{% if doc.type == "function" %}
{{ default_view_source(doc) }}
{% endif %}
{% endmacro %}