Skip to content

Commit 66132b8

Browse files
committed
docs
1 parent ea03bbc commit 66132b8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/guide/devtools.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,39 @@ For instance, the following will run the `textual colors` command:
5959
textual run -c textual colors
6060
```
6161

62+
### Serve
63+
64+
The devtools can also serve your application in a browser.
65+
Effectively turning your terminal app in to a web application!
66+
67+
The `serve` sub-command is similar to `run`. Here's how you can serve an app launched from a Python file:
68+
69+
```
70+
textual serve my_app.py
71+
```
72+
73+
You can also serve a Textual app launched via a command. Here's an example:
74+
75+
```
76+
textual serve "textual keys"
77+
```
78+
79+
The syntax for launching an app in a module is slightly different from `run`.
80+
You need to specify the full command, including `python`.
81+
Here's how you would run the Textual demo:
82+
83+
```
84+
textual serve "python -m textual"
85+
```
86+
87+
Textual's builtin web-server is quite powerful.
88+
You can serve multiple instances of your application at once!
89+
90+
!!! tip
91+
92+
Textual serve is also useful when developing your app.
93+
If you make changes to your code, simply refresh the browser to update.
94+
6295
## Live editing
6396

6497
If you combine the `run` command with the `--dev` switch your app will run in *development mode*.

0 commit comments

Comments
 (0)