Skip to content

Commit abeb198

Browse files
committed
Updates docs
1 parent 2a663fc commit abeb198

File tree

4 files changed

+61
-5
lines changed

4 files changed

+61
-5
lines changed

CLAUDE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ python manage.py tailwind install
6363
# Start Tailwind development server (watches for changes)
6464
python manage.py tailwind start
6565

66+
# Start both Django server and Tailwind watcher simultaneously
67+
python manage.py tailwind dev
68+
6669
# Build production CSS
6770
python manage.py tailwind build
6871
```
@@ -73,8 +76,9 @@ python manage.py tailwind build
7376

7477
- **Management Command** (`src/tailwind/management/commands/tailwind.py`):
7578
- Main entry point for all Tailwind operations
76-
- Handles `init`, `install`, `build`, `start`, `check-updates`, `update` commands
79+
- Handles `init`, `install`, `build`, `start`, `dev`, `check-updates`, `update` commands
7780
- Uses cookiecutter templates for app initialization
81+
- `dev` command runs Django server and Tailwind watcher simultaneously using Honcho
7882

7983
- **NPM Integration** (`src/tailwind/npm.py`):
8084
- Wrapper around npm commands

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This project aims to provide a comfortable way of using the *Tailwind CSS* frame
99
* Hot reloading of CSS, configuration files, and *Django* templates. No more manual page refreshes!
1010
* Out of the box support for CSS imports, SASS-like variables, and nesting;
1111
* Supports the latest *Tailwind CSS* `v4.x`;
12+
* Start both *Tailwind CSS* and *Django* development servers with a single command;
1213

1314
## Requirements
1415
Python 3.10 or newer with Django >= 4.2.20 or newer.

docs/installation.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,21 @@
125125
]
126126
```
127127
128-
12. Finally, you should be able to use *Tailwind CSS* classes in HTML. Start the development server by running the
129-
following command in your terminal:
128+
12. Finally, you should be able to use *Tailwind CSS* classes in HTML. You have two options to start development:
129+
130+
**Option 1 (Recommended):** Start both Django and Tailwind development servers simultaneously:
131+
132+
```bash
133+
python manage.py tailwind dev
134+
```
135+
136+
**Option 2:** Start only the Tailwind watcher (you'll need to run `python manage.py runserver` separately):
130137

131138
```bash
132139
python manage.py tailwind start
133140
```
134141

135-
Check out the [Usage](./usage.md) section for information about the production mode.
142+
Check out the [Usage](./usage.md) section for more details and information about the production mode.
136143

137144
## Optional configurations
138145

docs/usage.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,63 @@
22

33
## Running in Development Mode
44

5-
To start Django Tailwind in development mode, run the following command in a terminal:
5+
### Option 1: Combined Development Server (Recommended)
6+
7+
To start both Django server and Tailwind watcher simultaneously, run:
8+
9+
```bash
10+
python manage.py tailwind dev
11+
```
12+
13+
This will start both processes using Honcho and provide a seamless development experience. Use `CTRL + C` to terminate both processes.
14+
15+
### Option 2: Separate Processes
16+
17+
To start only the Tailwind watcher in development mode, run the following command in a terminal:
618

719
```bash
820
python manage.py tailwind start
921
```
1022

1123
This will start a long-running process that watches files for changes. Use `CTRL + C` to terminate the process.
1224

25+
**Note:** When using the separate process approach, you'll need to run `python manage.py runserver` in another terminal to start the Django development server.
26+
27+
## How Development Mode Works
28+
1329
Several things happen behind the scenes:
1430

1531
1. The stylesheet is updated every time you add or remove a CSS class in a Django template.
1632
2. The `django-browser-reload` watches for changes in HTML and CSS files. When a Django template or CSS file is updated, the browser refreshes automatically, providing a smooth development experience without needing to reload the page manually.
1733

34+
## Customizing the Development Setup
35+
36+
### Procfile.tailwind Configuration
37+
38+
When you run `python manage.py tailwind dev` for the first time, a `Procfile.tailwind` file is automatically created in your project root with the following default content:
39+
40+
```
41+
django: python manage.py runserver
42+
tailwind: python manage.py tailwind start
43+
```
44+
45+
This file defines the processes that Honcho will run simultaneously. Each line follows the format: `process_name: command_to_run`.
46+
47+
### Customization Examples
48+
49+
You can edit `Procfile.tailwind` to customize your development commands:
50+
51+
```
52+
django: python manage.py runserver 0.0.0.0:8080
53+
tailwind: python manage.py tailwind start
54+
```
55+
56+
### Process Management
57+
58+
- **Starting processes:** `python manage.py tailwind dev` starts all processes defined in the Procfile
59+
- **Stopping processes:** Press `Ctrl+C` to stop all processes gracefully
60+
- **Process output:** Each process is color-coded in the terminal for easy identification
61+
1862
## Building for Production
1963

2064
To create a production build of your theme, run:

0 commit comments

Comments
 (0)