@@ -99,13 +99,13 @@ def _fetch_object_dispname(self, el: "dc.Alias | dc.Object"):
99
99
return el .canonical_path
100
100
101
101
raise ValueError (f"Unsupported display_name: `{ self .display_name } `" )
102
-
102
+
103
103
def _fetch_method_parameters (self , el : dc .Function ):
104
104
# adapted from mkdocstrings-python jinja tempalate
105
105
if el .parent and el .parent .is_class and len (el .parameters ) > 0 :
106
106
if el .parameters [0 ].name in {"self" , "cls" }:
107
107
return dc .Parameters (* list (el .parameters )[1 :])
108
-
108
+
109
109
return el .parameters
110
110
111
111
def _render_table (self , rows , headers ):
@@ -135,7 +135,7 @@ def render_annotation(self, el: expr.Name) -> str:
135
135
# unescaped pipes screw up table formatting
136
136
if self .render_interlinks :
137
137
return f"[{ sanitize (el .source )} ](`{ el .full } `)"
138
-
138
+
139
139
return sanitize (el .source )
140
140
141
141
@dispatch
@@ -502,6 +502,20 @@ def render(self, el: ds.DocstringAttribute):
502
502
]
503
503
return row
504
504
505
+ # admonition ----
506
+ # note this can be a see-also, warnings, or notes section
507
+ # from the googledoc standard
508
+ @dispatch
509
+ def render (self , el : ds .DocstringSectionAdmonition ):
510
+ kind = el .title .lower ()
511
+ if kind in ["notes" , "warnings" ]:
512
+ return el .value .description
513
+ elif kind == "see also" :
514
+ # TODO: attempt to parse See Also sections
515
+ return convert_rst_link_to_md (el .value .description )
516
+
517
+ raise NotImplementedError (f"Unsupported DocstringSectionAdmonition kind: { kind } " )
518
+
505
519
# warnings ----
506
520
507
521
@dispatch
0 commit comments