Custom parser for type hints · Issue #10 · DLR-RM/stable-baselines3 (original) (raw)
Type hints are nice to check the code but it makes the documentation hard to read.
We should write a custom parser to display the hints in a cleaner way.
Related: https://michaelgoerz.net/notes/extending-sphinx-napoleon-docstring-sections.html
and https://github.com/agronholm/sphinx-autodoc-typehints
Update after #167: Above added. Remaining TODOs:
- Clean up parentheses in the type hinting (they are formatted as standard text, not in code-style).
Regex used:
(:((param)|(return))\s*[a-zA_z_0-9]*:) (([a-zA-Z_[]\s,.0-9]+))
and replace with $1
.