Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Material-Mkdocs #90

Merged
merged 3 commits into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
__pycache__
env3.7
env3.6
env
dist
.mypy_cache
.idea
Expand Down
100 changes: 55 additions & 45 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,59 +22,65 @@ That will create a directory `./env/` with the Python binaries and then you will

Activate the new environment with:

<div class="termy">
=== "Linux, macOS"

```console
$ source ./env/bin/activate
```
<div class="termy">

</div>
```console
$ source ./env/bin/activate
```

Or in Windows' PowerShell:
</div>

<div class="termy">
=== "Windows PowerShell"

```console
$ .\env\Scripts\Activate.ps1
```
<div class="termy">

</div>
```console
$ .\env\Scripts\Activate.ps1
```

Or if you use Bash for Windows (e.g. <a href="https://gitforwindows.org/" class="external-link" target="_blank">Git Bash</a>):
</div>

<div class="termy">
=== "Windows Bash"

```console
$ source ./env/Scripts/activate
```
Or if you use Bash for Windows (e.g. <a href="https://gitforwindows.org/" class="external-link" target="_blank">Git Bash</a>):

</div>
<div class="termy">

```console
$ source ./env/Scripts/activate
```

</div>

To check it worked, use:

<div class="termy">
=== "Linux, macOS, Windows Bash"

```console
$ which pip
<div class="termy">

some/directory/typer/env/bin/pip
```
```console
$ which pip

</div>
some/directory/typer/env/bin/pip
```

If it shows the `pip` binary at `env/bin/pip` then it worked. 🎉
</div>

Or in Windows PowerShell:
=== "Windows PowerShell"

<div class="termy">
<div class="termy">

```console
$ Get-Command pip
```console
$ Get-Command pip

some/directory/typer/env/bin/pip
```
some/directory/typer/env/bin/pip
```

</div>
</div>

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.
Expand All @@ -101,35 +107,39 @@ 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:

<div class="termy">
=== "Linux, macOS"

```console
$ flit install --deps develop --symlink
<div class="termy">

---> 100%
```
```console
$ flit install --deps develop --symlink

</div>
---> 100%
```

If you are on Windows, use `--pth-file` instead of `--symlink`:
</div>

<div class="termy">
=== "Windows"

```console
$ flit install --deps develop --pth-file
If you are on Windows, use `--pth-file` instead of `--symlink`:

---> 100%
```
<div class="termy">

</div>
```console
$ flit install --deps develop --pth-file

---> 100%
```

</div>

It will install all the dependencies and your local Typer in your local environment.

#### Using your local Typer

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.

Expand Down
2 changes: 1 addition & 1 deletion docs/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
15 changes: 9 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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:
Expand Down