Skip to content
Myr

:memo: Add docs for launching applications

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sebastián Ramírez · committed by Sebastián Ramírez · parent b925ed2 · Browse files · 4 files+80 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+80 added−0 removed

  • other:+80 added−0 removed

4 files+80 added−0 removed

added:docs/src/launch/tutorial001.py+10 added
1import typer234def main():5 typer.echo("Opening Typer's docs")6 typer.launch("https://typer.tiangolo.com")789if __name__ == "__main__":10 typer.run(main)
added:docs/src/launch/tutorial002.py+21 added
1from pathlib import Path23import typer45APP_NAME = "my-super-cli-app"678def main():9 app_dir = typer.get_app_dir(APP_NAME)10 app_dir_path = Path(app_dir)11 app_dir_path.mkdir(parents=True, exist_ok=True)12 config_path: Path = Path(app_dir) / "config.json"13 if not config_path.is_file():14 config_path.write_text('{"version": "1.0.0"}')15 config_file_str = str(config_path)16 typer.echo("Opening config directory")17 typer.launch(config_file_str, locate=True)181920if __name__ == "__main__":21 typer.run(main)
added:docs/tutorial/launch.md+48 added
modified:mkdocs.yml+1 added