NiklasRosenstein / pydoc-markdown

Create Python API documentation in Markdown format.
http://niklasrosenstein.github.io/pydoc-markdown/
Other
449 stars 104 forks source link

Add Support for .pyi files #316

Open jackswiney opened 4 months ago

jackswiney commented 4 months ago

Is your feature request related to a problem? Please describe.

I have a PyBind11 package that essentially includes *.so c++ source, and *.pyi files for intellisense. It looks like the *.py file extension is hard-coded between this and docspec-python, so the only way to get around this was to change the source to look for the *.pyi extension, or to manually rename my *.pyi files with the *.py extension.

Describe the solution you'd like

I'd prefer a CLI flag to change the file extension, or accept multiple file extensions.

Describe alternatives you've considered

  1. Temporarily change the files to the *.py extension, running this tool, then reverting the extensions to *.pyi.
  2. Updating the source directly to look for *.pyi OR *.py.
  3. Inheriting from the classes in this API and the docspec-python API, then writing custom functions to handle *.pyi.
PJ-Schulz commented 4 months ago

Hello, I have a use case where I have a large file in my library and adding the docstings to it will increase it more which causes to scroll a lot. Therfore I thought to export the docstrings to .pyi files. So I have a file called client.py and client.pyi. Maybe on this case the .pyi file should be prefered before the .py file to search for docstings.