From ce9e08d8e70179716798ec664599d2db89c36dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 18 Apr 2020 12:38:12 +0200 Subject: [PATCH] :heavy_plus_sign: Upgrade Material-Mkdocs (#90) * :heavy_plus_sign: Upgrade Material-Mkdocs * :bug: Fix Mkdocs config bug * :heavy_plus_sign: Upgrade Mkdocs-material configs --- .gitignore | 1 + docs/contributing.md | 108 +++++++++++++++++++++++-------------------- docs/js/custom.js | 2 +- mkdocs.yml | 15 +++--- 4 files changed, 70 insertions(+), 56 deletions(-) diff --git a/.gitignore b/.gitignore index 157036c..d7ba1a0 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 51d6861..ae5892f 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -22,60 +22,66 @@ 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 + ``` + +
+ +=== "Windows PowerShell" + +
+ + ```console + $ Get-Command pip + + some/directory/typer/env/bin/pip + ``` + +
If it shows the `pip` binary at `env/bin/pip` then it worked. 🎉 -Or in Windows PowerShell: - -
- -```console -$ Get-Command pip - -some/directory/typer/env/bin/pip -``` - -
- !!! 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 cd21d16..45243eb 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 3bd553f..754f7e5 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: