Describe the bug
When generating a markdown documentation page for a Typer app, commands marked with hidden=True should not be included.
Steps to reproduce:
- Create a typer app script where one command is marked as hidden, e.g., the
delete command in this example:
import typer
app = typer.Typer(help="Awesome CLI user manager.")
@app.command()
def create(username: str):
"""
Create a new user with USERNAME.
"""
pass
@app.command(hidden=True)
def delete(username: str):
"""
Delete a user with USERNAME.
If --force is not used, will ask for confirmation.
"""
pass
if __name__ == "__main__":
app()
Save as app.py
- Generate the markdown docs with command
typer app.py utils docs
Expected: Only the create command details are included in the markdown output
Actual: Both the create and delete command details are included in the markdown output
The commands are correctly excluded when running the app normally with python app.py --help.
Platform
Click to expand
Describe the bug
When generating a markdown documentation page for a Typer app, commands marked with
hidden=Trueshould not be included.Steps to reproduce:
deletecommand in this example:typer app.py utils docsExpected: Only the
createcommand details are included in the markdown outputActual: Both the
createanddeletecommand details are included in the markdown outputThe commands are correctly excluded when running the app normally with
python app.py --help.Platform
Click to expand