innobi / pantab

Read/Write pandas DataFrames with Tableau Hyper Extracts
BSD 3-Clause "New" or "Revised" License
114 stars 44 forks source link

[Docs] Move API documentation from api.rst to docstrings #364

Closed Priyansh121096 closed 1 month ago

Priyansh121096 commented 1 month ago

Is your feature request related to a problem? Please describe. Right now, any API changes or changes in behavior worth documenting need to be documented separately in doc/api.rst. We need to make sure manually api.rst is constantly in sync with the code.

Describe the solution you'd like We should move the documentation to function docstrings and use sphinx-autodoc + sphinx-autodoc-typehints to generate api.rst. This will automatically generate API documentation with signatures + typehints + function/param docstrings from the current code and this way we can make sure that the documentation is always in sync. And while it is true that docstrings can go out of sync with the code too, it is much easier to not forget updating those than api.rst IMO.

Describe alternatives you've considered

Additional context I'm willing to submit a PR for this (and it'd be great if I could use the same as one of my hacktoberfest contributions 😄 ).

Priyansh121096 commented 1 month ago

Btw, I think this would also help with #75. I'm not sure if it's possible to enable doctest on non-python files.

WillAyd commented 1 month ago

Great idea! Happy to accept any contribution you would like to make

Priyansh121096 commented 1 month ago

Thanks, I'll get on it.