Skip to content

Commit 5544a54

Browse files
authored
fix RoomConfig attributes display in docs (#52)
1 parent 04bbea6 commit 5544a54

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ instance/
7474
/doc
7575
/docusaurus
7676

77+
*.DS_Store
78+
7779
# PyBuilder
7880
.pybuilder/
7981
target/

templates/doc/module.html.jinja2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ See https://pdoc.dev/docs/pdoc/render_helpers.html#DefaultMacroExtension for an
209209
{% enddefaultmacro %}
210210
{% defaultmacro docstring(var) %}
211211
{% if var.docstring %}
212-
<div class="docstring">{{ var.docstring | to_markdown | to_html | linkify(namespace=var.qualname) }}</div>
212+
{% set processed_docstring = var.docstring
213+
| replace('\n ', '\n ')
214+
| replace('\n ', '\n- ')
215+
%}
216+
<div class="docstring">{{ processed_docstring | to_markdown | to_html | linkify(namespace=var.qualname) }}</div>
213217
{% endif %}
214218
{% enddefaultmacro %}
215219
{% defaultmacro nav_members(members) %}

templates/docusaurus/module.html.jinja2

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
{% block module_info %}
77
{% if module.docstring and ".. include::" not in module.docstring %}
8-
{{ module.docstring | safe }}
8+
{{ module.docstring
9+
| replace('\n ', '\n ')
10+
| replace('\n ', '\n- ')
11+
| safe
12+
}}
913
{% endif %}
1014
{% endblock %}
1115

@@ -89,7 +93,11 @@ class {{ cls.qualname }}{{ class_bases(cls) }}:
8993
```python
9094
{% if doc.kind == "class" %}{{ class(doc) }}{% elif doc.kind == "function" %}{{ function(doc) }}{% else %}{{ variable(doc) }}{% endif %}
9195
```
92-
{{ doc.docstring | safe }}
96+
{{ doc.docstring
97+
| replace('\n ', '\n ')
98+
| replace('\n ', '\n- ')
99+
| safe
100+
}}
93101
{% enddefaultmacro %}
94102

95103
{% defaultmacro is_public(doc) %}

0 commit comments

Comments
 (0)