2024-01-08 13:27:38 -03:00
|
|
|
# tidy
|
|
|
|
|
|
|
|
> Clean up and pretty print HTML, XHTML and XML files.
|
2024-02-05 12:34:49 +05:30
|
|
|
> Note: `tidy` cannot preserve original indentation.
|
2025-04-23 10:24:12 +03:00
|
|
|
> More information: <https://api.html-tidy.org/tidy/tidylib_api_next/group__options__cli.html#gad7a9fcaf7b2a712a82e625e84c042b28>.
|
2024-01-08 13:27:38 -03:00
|
|
|
|
|
|
|
- Pretty print an HTML file:
|
|
|
|
|
|
|
|
`tidy {{path/to/file.html}}`
|
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
- Enable indentation, wrapping lines in 100, saving to `output.html`:
|
2024-01-08 13:27:38 -03:00
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`tidy {{[-i|--indent]}} y {{[-w|--wrap]}} 100 {{[-o|-output]}} {{path/to/output.html}} {{path/to/file.html}}`
|
2024-01-08 13:27:38 -03:00
|
|
|
|
|
|
|
- Modify an HTML file in-place using a configuration file:
|
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`tidy -config {{path/to/configuration}} {{[-m|-modify]}} {{path/to/file.html}}`
|