Skip to content
Myr

:memo: Add docs for launching applications/files.

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 GitHub · parents d1970da, bc4709c · Browse files · 6 files+89 added−1 removed
This commit

State

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

Diff stats

6 files+89 added−1 removed

  • other:+89 added−1 removed

6 files+89 added−1 removed

modified:docs/src/app_dir/tutorial001.py+1 added-1 removed
5 unmodified lines
678def main():9 app_dir = typer.get_app_dir(APP_NAME)10 config_path = Path(app_dir) / "config.json"10 config_path: Path = Path(app_dir) / "config.json"11 if not config_path.is_file():12 typer.echo("Config file doesn't exist yet")1314
2 unmodified lines
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)
modified:docs/tutorial/app-dir.md+8 added
added:docs/tutorial/launch.md+48 added
modified:mkdocs.yml+1 added