Skip to content

Commit 6d0a065

Browse files
committed
fix: renderer now supports admonitions
1 parent 7b44cd2 commit 6d0a065

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

quartodoc/renderers/md_renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def render(self, el: ds.DocstringSectionAdmonition):
508508
# TODO: attempt to parse See Also sections
509509
return convert_rst_link_to_md(el.value.description)
510510

511-
raise NotImplementedError(f"Unsupported DocstringSectionAdmonition kind: {kind}")
511+
return el.value.description
512512

513513
# warnings ----
514514

quartodoc/tests/__snapshots__/test_renderers.ambr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@
307307
|--------|--------|------------------|------------|
308308
| `a` | int | The a parameter. | _required_ |
309309
| `b` | str | The b parameter. | _required_ |
310+
311+
## Custom Admonition
312+
313+
Some text.
310314
'''
311315
# ---
312316
# name: test_render_docstring_styles[numpy]
@@ -323,6 +327,10 @@
323327
|--------|--------|------------------|------------|
324328
| `a` | | The a parameter. | _required_ |
325329
| `b` | str | The b parameter. | _required_ |
330+
331+
## Custom Admonition
332+
333+
Some text.
326334
'''
327335
# ---
328336
# name: test_render_docstring_styles[sphinx]

quartodoc/tests/example_docstring_styles.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ def f_google(a, b: str):
44
Args:
55
a (int): The a parameter.
66
b: The b parameter.
7+
8+
Custom Admonition:
9+
Some text.
710
"""
811

912

@@ -26,6 +29,9 @@ def f_numpy(a, b: str):
2629
b:
2730
The b parameter.
2831
32+
Custom Admonition
33+
-----------------
34+
Some text.
2935
"""
3036

3137

@@ -41,5 +47,4 @@ def f_numpy_with_linebreaks(a, b: str):
4147
4248
b:
4349
The b parameter.
44-
4550
"""

0 commit comments

Comments
 (0)