Skip to content

Commit 8b57d84

Browse files
committed
fix(management): improve help text formatting for all commands
- Add \b markers to prevent Click text wrapping in command help sections - Fix formatting for build, watch, setup, troubleshoot, config, download_cli, list_templates, and runserver commands - Ensure proper line breaks and indentation in all help output - Make all command examples and sections more readable and visually distinct - Provide consistent professional help formatting across all commands
1 parent 1ae50a9 commit 8b57d84

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/django_tailwind_cli/management/commands/tailwind.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,14 @@ def build(
187187
This command processes your Tailwind CSS input file and generates an optimized
188188
production CSS file with only the styles actually used in your templates.
189189
190+
\b
190191
The build process:
191192
1. Scans all Django templates for Tailwind class usage
192193
2. Generates CSS with only the used utility classes
193194
3. Minifies the output for optimal file size
194195
4. Saves to your configured output path (STATICFILES_DIRS)
195196
197+
\b
196198
Examples:
197199
# Build production CSS (skips if already up-to-date)
198200
python manage.py tailwind build
@@ -203,6 +205,7 @@ def build(
203205
# Show detailed build information
204206
python manage.py tailwind build --verbose
205207
208+
\b
206209
Output location:
207210
The CSS file is saved to: STATICFILES_DIRS[0]/css/tailwind.css
208211
(configurable via TAILWIND_CLI_DIST_CSS setting)
@@ -265,24 +268,28 @@ def watch(
265268
):
266269
"""Start Tailwind CSS in watch mode for development.
267270
271+
\b
268272
Watch mode automatically rebuilds your CSS whenever you change:
269273
- Django template files (*.html)
270274
- Python files that might contain Tailwind classes
271275
- Your Tailwind input CSS file
272276
- JavaScript files (if configured)
273277
278+
\b
274279
The watcher provides instant feedback during development, showing:
275280
- File change detection
276281
- Build progress and timing
277282
- Any build errors or warnings
278283
284+
\b
279285
Examples:
280286
# Start watch mode
281287
python manage.py tailwind watch
282288
283289
# Watch with detailed diagnostics
284290
python manage.py tailwind watch --verbose
285291
292+
\b
286293
Tips:
287294
- Keep this running in a separate terminal during development
288295
- Use alongside 'python manage.py runserver' for full development setup
@@ -330,30 +337,35 @@ def list_templates(
330337
that Tailwind CSS will process for class names. Understanding which templates
331338
are scanned helps optimize your Tailwind configuration.
332339
340+
\b
333341
Scanned locations:
334342
1. App template directories (APP_NAME/templates/)
335343
2. Global template directories (TEMPLATES[0]['DIRS'])
336344
3. All subdirectories within these locations
337345
346+
\b
338347
File types scanned:
339348
- *.html - HTML templates
340349
- *.py - Python files (may contain Tailwind classes in strings)
341350
- *.js - JavaScript files
342351
- *.vue, *.jsx - If using frontend frameworks
343352
353+
\b
344354
Examples:
345355
# List all template files
346356
python manage.py tailwind list_templates
347357
348358
# Show detailed scan information
349359
python manage.py tailwind list_templates --verbose
350360
361+
\b
351362
Verbose mode shows:
352363
- Directories being scanned
353364
- Number of templates per directory
354365
- Any permission or access errors
355366
- Total scan time and statistics
356367
368+
\b
357369
Use this to:
358370
- Verify Tailwind is scanning the right files
359371
- Debug missing styles (file might not be scanned)
@@ -460,16 +472,19 @@ def download_cli():
460472
This command downloads the standalone Tailwind CSS CLI binary for your
461473
platform. The CLI is required to build and watch your CSS files.
462474
475+
\b
463476
The download process:
464477
1. Detects your operating system and architecture
465478
2. Downloads the appropriate binary from GitHub releases
466479
3. Saves it to your project directory
467480
4. Makes it executable (on Unix-like systems)
468481
482+
\b
469483
Binary location:
470484
Default: .django_tailwind_cli/ in your project root
471485
Custom: Set TAILWIND_CLI_PATH in settings
472486
487+
\b
473488
Examples:
474489
# Download the CLI binary
475490
python manage.py tailwind download_cli
@@ -479,6 +494,7 @@ def download_cli():
479494
# - Linux: .django_tailwind_cli/tailwindcss-linux-[arch]-[version]
480495
# - Windows: .django_tailwind_cli/tailwindcss-windows-[arch]-[version].exe
481496
497+
\b
482498
Notes:
483499
- This is usually done automatically on first build/watch
484500
- Re-run to update to a newer version
@@ -496,17 +512,20 @@ def show_config():
496512
This command displays the current configuration settings and their values,
497513
helping you understand how django-tailwind-cli is configured in your project.
498514
515+
\b
499516
Information displayed:
500517
- All configuration paths (CLI, CSS input/output)
501518
- Version information
502519
- Django settings values
503520
- File existence status
504521
- Platform information
505522
523+
\b
506524
Examples:
507525
# Show current configuration
508526
python manage.py tailwind config
509527
528+
\b
510529
Use this to:
511530
- Debug configuration issues
512531
- Verify settings are applied correctly
@@ -591,6 +610,7 @@ def setup_guide():
591610
This command provides step-by-step guidance for setting up Tailwind CSS
592611
in your Django project, from installation to first build.
593612
613+
\b
594614
The guide covers:
595615
1. Installation verification
596616
2. Django settings configuration
@@ -599,10 +619,12 @@ def setup_guide():
599619
5. Template integration
600620
6. Development workflow
601621
622+
\b
602623
Examples:
603624
# Run the interactive setup guide
604625
python manage.py tailwind setup
605626
627+
\b
606628
This is perfect for:
607629
- First-time setup
608630
- Troubleshooting configuration issues
@@ -752,17 +774,20 @@ def troubleshoot():
752774
This command provides solutions for the most common issues encountered
753775
when using django-tailwind-cli, with step-by-step debugging guidance.
754776
777+
\b
755778
Common issues covered:
756779
- CSS not updating in browser
757780
- Build failures and errors
758781
- Missing or incorrect configuration
759782
- Permission and download issues
760783
- Template integration problems
761784
785+
\b
762786
Examples:
763787
# Run the troubleshooting guide
764788
python manage.py tailwind troubleshoot
765789
790+
\b
766791
Use this when:
767792
- Styles aren't appearing in your browser
768793
- Build or watch commands fail
@@ -973,12 +998,14 @@ def runserver(
973998
- Runs Django's development server
974999
- Manages both processes with proper signal handling
9751000
1001+
\b
9761002
Features:
9771003
- Automatic process management (both stop cleanly with Ctrl+C)
9781004
- Live CSS updates as you edit templates and styles
9791005
- Support for django-extensions runserver_plus (if installed)
9801006
- All standard runserver options are supported
9811007
1008+
\b
9821009
Examples:
9831010
# Run on default port (8000)
9841011
python manage.py tailwind runserver
@@ -995,6 +1022,7 @@ def runserver(
9951022
# Force default runserver (ignore django-extensions)
9961023
python manage.py tailwind runserver --force-default-runserver
9971024
1025+
\b
9981026
Tips:
9991027
- This replaces the need to run 'tailwind watch' and 'runserver' separately
10001028
- Both processes are managed together - Ctrl+C stops both cleanly

0 commit comments

Comments
 (0)