Skip to content

[QUESTION] Typer CLI in sphinx #200

Description

@OskarLiew

First check

  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Typer documentation, with the integrated search.
  • I already searched in Google "How to X in Typer" and didn't find any information.
  • I already searched in Google "How to X in Click" and didn't find any information.

Description

I have written a typer CLI and I have created automated documentation for it using sphinx and autodoc. But I have encountered an issue where the documentation reads:

cli.assign(name: str = <typer.models.ArgumentInfo object>, version: str = <typer.models.ArgumentInfo object>)

where I would like it to say:

cli.assign(name: str, version: str).

Is it possible to expose the standard value to autodoc? I found a potential fix in https://stackoverflow.com/questions/12082570/override-function-declaration-in-autodoc-for-sphinx/12087750#12087750
where you can use the first row of the docstring to change the documented signature. This unfortunately changes the assign --help output. Is it possible to hide a single row from --help?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions