diff --git a/dargs/dargs.py b/dargs/dargs.py index b590074..caf8dc6 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -952,6 +952,16 @@ def gen_doc_flag(self, path: list[str] | None = None, **kwargs) -> str: choicedoc = indent("| possible choices: " + ", ".join(l_choice), INDENT) realdoc = indent(self.doc + "\n", INDENT) if self.doc else None anchor = make_rst_refid(arg_path) if kwargs.get("make_anchor") else None + abstractdoc = indent( + "\n".join( + [ + f"* {ll}: {cc.doc}" + for ll, cc in zip(l_choice, self.choice_dict.values()) + if cc.doc + ] + ), + INDENT, + ) allparts = [ anchor, headdoc, @@ -960,6 +970,9 @@ def gen_doc_flag(self, path: list[str] | None = None, **kwargs) -> str: choicedoc, "", realdoc, + "", + abstractdoc, + "", targetdoc, ] return "\n".join([x for x in allparts if x is not None])