Skip to content

Commit 14f18b2

Browse files
committed
fix: Fix mkdocs and readthedocs themes support
The file tree must match that of the fallback theme (material). The previous templates were never picked up. The mkdocs templates folder is simply removed: every template falls back on the material ones. The templates for the readthedocs theme however are updated: they must match the actual theme. This commit also improves rendering a bit with CSS tweaks. Still lots of rendering issues, notably with components from pymdownx (tabs for example), for which these two themes have no specific styling.
1 parent 439f5e6 commit 14f18b2

File tree

20 files changed

+278
-138
lines changed

20 files changed

+278
-138
lines changed

src/mkdocstrings_handlers/python/templates/mkdocs/exceptions.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/mkdocstrings_handlers/python/templates/mkdocs/keyword_args.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/mkdocstrings_handlers/python/templates/mkdocs/parameters.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/mkdocstrings_handlers/python/templates/mkdocs/return.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/mkdocstrings_handlers/python/templates/mkdocs/style.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/mkdocstrings_handlers/python/templates/mkdocs/yield.html

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{ log.debug() }}
2+
<table class="field-list">
3+
<colgroup>
4+
<col class="field-name" />
5+
<col class="field-body" />
6+
</colgroup>
7+
<tbody valign="top">
8+
<tr class="field">
9+
<th class="field-name">{{ section.title or "Attributes:" }}</th>
10+
<td class="field-body">
11+
<ul class="first simple">
12+
{% for attribute in section.value %}
13+
<li>
14+
<b>{{ attribute.name }}</b>
15+
{% if attribute.annotation %}
16+
{% with expression = attribute.annotation %}
17+
(<code>{% include "expression.html" with context %}</code>)
18+
{% endwith %}
19+
{% endif %}
20+
21+
<div class="doc-md-description">
22+
{{ attribute.description|convert_markdown(heading_level, html_id) }}
23+
</div>
24+
</li>
25+
{% endfor %}
26+
</ul>
27+
</td>
28+
</tr>
29+
</tbody>
30+
</table>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{ log.debug() }}
2+
<table class="field-list">
3+
<colgroup>
4+
<col class="field-name" />
5+
<col class="field-body" />
6+
</colgroup>
7+
<tbody valign="top">
8+
<tr class="field">
9+
<th class="field-name">{{ section.title or "Other parameters:" }}</th>
10+
<td class="field-body">
11+
<ul class="first simple">
12+
{% for parameter in section.value %}
13+
<li>
14+
<b>{{ parameter.name }}</b>
15+
{% if parameter.annotation %}
16+
{% with expression = parameter.annotation %}
17+
(<code>{% include "expression.html" with context %}</code>)
18+
{% endwith %}
19+
{% endif %}
20+
21+
<div class="doc-md-description">
22+
{{ parameter.description|convert_markdown(heading_level, html_id) }}
23+
</div>
24+
</li>
25+
{% endfor %}
26+
</ul>
27+
</td>
28+
</tr>
29+
</tbody>
30+
</table>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{ log.debug() }}
2+
<table class="field-list">
3+
<colgroup>
4+
<col class="field-name" />
5+
<col class="field-body" />
6+
</colgroup>
7+
<tbody valign="top">
8+
<tr class="field">
9+
<th class="field-name">{{ section.title or "Parameters:" }}</th>
10+
<td class="field-body">
11+
<ul class="first simple">
12+
{% for parameter in section.value %}
13+
<li>
14+
<b>{{ parameter.name }}</b>
15+
{% if parameter.annotation %}
16+
{% with expression = parameter.annotation %}
17+
(<code>{% include "expression.html" with context %}</code>)
18+
{% endwith %}
19+
{% endif %}
20+
21+
<div class="doc-md-description">
22+
{{ parameter.description|convert_markdown(heading_level, html_id) }}
23+
</div>
24+
</li>
25+
{% endfor %}
26+
</ul>
27+
</td>
28+
</tr>
29+
</tbody>
30+
</table>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{ log.debug() }}
2+
<table class="field-list">
3+
<colgroup>
4+
<col class="field-name" />
5+
<col class="field-body" />
6+
</colgroup>
7+
<tbody valign="top">
8+
<tr class="field">
9+
<th class="field-name">{{ section.title or "Raises:" }}</th>
10+
<td class="field-body">
11+
<ul class="first simple">
12+
{% for raises in section.value %}
13+
<li>
14+
{% if raises.annotation %}
15+
{% with expression = raises.annotation %}
16+
<code>{% include "expression.html" with context %}</code>
17+
{% endwith %}
18+
{% endif %}
19+
20+
<div class="doc-md-description">
21+
{{ raises.description|convert_markdown(heading_level, html_id) }}
22+
</div>
23+
</li>
24+
{% endfor %}
25+
</ul>
26+
</td>
27+
</tr>
28+
</tbody>
29+
</table>

0 commit comments

Comments
 (0)