0

How can I generate documentation without writing a single line of docstring? I simply want to have an API reference page.

Because as I think, if there are type annotations in functions, then we don't need docstrings to describe them.

For example, one of my source code functions:

def sort_files_by_time(self, files: List[str], reverse: bool = False):
    files.sort(key=os.path.getmtime, reverse=reverse)
    return files

I expect it to generate API docs in HTML format. Like what I see in vscode function hint.

mzjn
  • 48,958
  • 13
  • 128
  • 248
yingshao xo
  • 244
  • 7
  • 11
  • What's missing when you generate the HTML now? Shouldn't using the `autodoc` plugin with `sphinx` be sufficient? – suvayu Mar 31 '23 at 08:28
  • 2
    Sphinx has an `undoc-members` option: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-option-automodule-undoc-members – mzjn Mar 31 '23 at 08:29

0 Answers0