2025-03-14 21:59:59 -06:00
|
|
|
# tidy
|
|
|
|
|
|
|
|
|
|
> Clean up and pretty print HTML, XHTML and XML files.
|
|
|
|
|
> Note: `tidy` cannot preserve original indentation.
|
2025-05-08 12:26:01 -06:00
|
|
|
> More information: <https://api.html-tidy.org/tidy/tidylib_api_next/group__options__cli.html#gad7a9fcaf7b2a712a82e625e84c042b28>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Pretty print an HTML file:
|
|
|
|
|
|
|
|
|
|
`tidy {{path/to/file.html}}`
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
- Enable indentation, wrapping lines in 100, saving to `output.html`:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`tidy {{[-i|--indent]}} y {{[-w|--wrap]}} 100 {{[-o|-output]}} {{path/to/output.html}} {{path/to/file.html}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Modify an HTML file in-place using a configuration file:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`tidy -config {{path/to/configuration}} {{[-m|-modify]}} {{path/to/file.html}}`
|