Skip to content

Custom parser for type hints #10

@araffin

Description

@araffin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedHelp from contributors is welcomed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions