diff --git a/.gitignore b/.gitignore index 157036c9a2..d7ba1a067a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__ env3.7 env3.6 +env dist .mypy_cache .idea diff --git a/docs/contributing.md b/docs/contributing.md index 51d686180a..ae5892f42e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -22,59 +22,65 @@ That will create a directory `./env/` with the Python binaries and then you will Activate the new environment with: -
+=== "Linux, macOS" -```console -$ source ./env/bin/activate -``` +
-
+ ```console + $ source ./env/bin/activate + ``` -Or in Windows' PowerShell: +
-
+=== "Windows PowerShell" -```console -$ .\env\Scripts\Activate.ps1 -``` +
-
+ ```console + $ .\env\Scripts\Activate.ps1 + ``` -Or if you use Bash for Windows (e.g. Git Bash): +
-
+=== "Windows Bash" -```console -$ source ./env/Scripts/activate -``` + Or if you use Bash for Windows (e.g. Git Bash): -
+
+ + ```console + $ source ./env/Scripts/activate + ``` + +
To check it worked, use: -
+=== "Linux, macOS, Windows Bash" -```console -$ which pip +
-some/directory/typer/env/bin/pip -``` + ```console + $ which pip -
+ some/directory/typer/env/bin/pip + ``` -If it shows the `pip` binary at `env/bin/pip` then it worked. 🎉 +
-Or in Windows PowerShell: +=== "Windows PowerShell" -
+
-```console -$ Get-Command pip + ```console + $ Get-Command pip -some/directory/typer/env/bin/pip -``` + some/directory/typer/env/bin/pip + ``` -
+
+ +If it shows the `pip` binary at `env/bin/pip` then it worked. 🎉 !!! tip Every time you install a new package with `pip` under that environment, activate the environment again. @@ -101,27 +107,31 @@ Now re-activate the environment to make sure you are using the `flit` you just i And now use `flit` to install the development dependencies: -
+=== "Linux, macOS" -```console -$ flit install --deps develop --symlink +
----> 100% -``` + ```console + $ flit install --deps develop --symlink -
+ ---> 100% + ``` -If you are on Windows, use `--pth-file` instead of `--symlink`: +
-
+=== "Windows" -```console -$ flit install --deps develop --pth-file + If you are on Windows, use `--pth-file` instead of `--symlink`: ----> 100% -``` +
-
+ ```console + $ flit install --deps develop --pth-file + + ---> 100% + ``` + +
It will install all the dependencies and your local Typer in your local environment. @@ -129,7 +139,7 @@ It will install all the dependencies and your local Typer in your local environm If you create a Python file that imports and uses Typer, and run it with the Python from your local environment, it will use your local Typer source code. -And if you update that local Typer source code, as it is installed with `--symlink`, when you run that Python file again, it will use the fresh version of Typer you just edited. +And if you update that local Typer source code, as it is installed with `--symlink` (or `--pth-file` on Windows), when you run that Python file again, it will use the fresh version of Typer you just edited. That way, you don't have to "install" your local version to be able to test every change. diff --git a/docs/js/custom.js b/docs/js/custom.js index cd21d165e7..45243eb7ef 100644 --- a/docs/js/custom.js +++ b/docs/js/custom.js @@ -12,7 +12,7 @@ let termynals = []; function createTermynals() { document - .querySelectorAll(`.${termynalActivateClass} .codehilite`) + .querySelectorAll(`.${termynalActivateClass} .highlight`) .forEach(node => { const text = node.textContent; const lines = text.split("\n"); diff --git a/mkdocs.yml b/mkdocs.yml index 3bd553f30a..754f7e5964 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,6 +7,8 @@ theme: palette: primary: 'black' accent: 'teal' + icon: + repo: fontawesome/brands/github-alt logo: 'img/icon-white.svg' favicon: 'img/favicon.png' @@ -94,20 +96,21 @@ markdown_extensions: - name: mermaid class: mermaid format: !!python/name:pymdownx.superfences.fence_div_format + - pymdownx.tabbed extra: social: - - type: 'github' + - icon: fontawesome/brands/github-alt link: 'https://github.com/tiangolo/typer' - - type: 'twitter' + - icon: fontawesome/brands/twitter link: 'https://twitter.com/tiangolo' - - type: 'linkedin' + - icon: fontawesome/brands/linkedin link: 'https://www.linkedin.com/in/tiangolo' - - type: 'rss' + - icon: fontawesome/brands/dev link: 'https://dev.to/tiangolo' - - type: 'medium' + - icon: fontawesome/brands/medium link: 'https://medium.com/@tiangolo' - - type: 'globe' + - icon: fontawesome/solid/globe link: 'https://tiangolo.com' extra_css: