Skip to content

Commit 099da05

Browse files
committed
📚 Update the code snippets for Windows
1 parent 87d157b commit 099da05

File tree

3 files changed

+47
-13
lines changed

3 files changed

+47
-13
lines changed

‎docs/environments.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,27 @@ Time to _activate_ the virtual environment!
8080

8181
=== "`bash`/`zsh`"
8282

83-
```
83+
```bash
8484
source .my_env/bin/activate
8585
```
8686

8787
=== "`fish`"
8888

89-
```
89+
```fish
9090
source .my_env/bin/activate.fish
9191
```
9292

93-
=== "Windows"
93+
=== "Windows (cmd)"
9494

95-
TODO
95+
```cmd
96+
.my_env\Scripts\activate.bat
97+
```
98+
99+
=== "Windows (PowerShell)"
100+
101+
```powershell
102+
.my_env\Scripts\Activate.ps1
103+
```
96104

97105
Typically, your prompt will be adapted, adding `(.my_env)` somewhere to indicate you are working "inside the `.my_env` environment".
98106
To verify this, let's see what Python instance we're working with:

‎docs/packages.md‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,25 @@ However, adhering to a standard package structure makes it easier for others to
110110
Everyone knows where to find the source code, tests, and documentation.
111111
Have a look at the structure of the `dev-tutorial` package:
112112

113-
```
114-
tree .
115-
```
113+
=== "Linux/macOS"
114+
115+
```bash
116+
tree .
117+
```
118+
119+
=== "Windows (cmd)"
120+
121+
```cmd
122+
tree /F
123+
```
124+
125+
=== "Windows (PowerShell)"
126+
127+
```powershell
128+
tree /F
129+
```
130+
131+
Expected structure:
116132

117133
```console {.no-copy}
118134
├── docs
@@ -135,9 +151,9 @@ tree .
135151

136152
??? warning "The `tree` command doesn't exist!"
137153

138-
You may not have `tree` installed on your system.
139-
As you can see, it's a neat way to see the contents of a directory, but it's not necessary for the tutorial.
140-
Feel free to install it if you like it though!
154+
On Linux/macOS, you may need to install `tree` (`brew install tree` on macOS, or `apt install tree` on Ubuntu).
155+
On Windows, `tree` is built-in but shows output in a different format.
156+
The `tree` command is a neat way to visualize directory structure, but it's not necessary for the tutorial.
141157

142158
Let's go over the various directories and files:
143159

‎docs/publishing.md‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,19 @@ Successfully built dev-tutorial-<YOUR_USERNAME>-0.0.1.tar.gz and dev_tutorial_<Y
8282

8383
This creates a `dist/` directory containing both distribution formats:
8484

85-
```bash
86-
ls dist/
87-
```
85+
=== "Linux/macOS"
86+
87+
```bash
88+
ls dist/
89+
```
90+
91+
=== "Windows"
92+
93+
```powershell
94+
dir dist\
95+
```
96+
97+
Expected output:
8898

8999
```console {.no-copy}
90100
dev-tutorial-<YOUR_USERNAME>-0.0.1.tar.gz

0 commit comments

Comments
 (0)