HTML Tidy  5.4.0
The HTACG Tidy HTML Project
Go to the documentation of this file.
1 # HTML Tidy Code Style {#codestyle}
3 The source code of **libTidy** and console app **tidy** mostly follow the preferences of the original maintainers. Perhaps some of these decisions were arbitrary and based on their sense of aesthetics at the time, but it is good to have all the code looking the same even if it is not exactly what everyone would prefer.
5 Developers adding code to HTML Tidy are urged to try to follow the existing code style. Code that does not follow these conventions may be accepted, but may be modified as time goes by to best fit the “Tidy Style.”
7 There has been a suggestion of using available utilities to make the style consistent, like [Uncrustify]( - see [issue #245](, and maybe others.
9 Others have suggested the [AStyle]( formatting program with say `-taOHUKk3 -M8` arguments, to conform, but there are a few bugs in AStyle.
11 But again, these and other tools may not produce code that everybody agrees with, and are presently not formally used in Tidy!
13 #### Known Conventions
15 From reading of the Tidy source, some things are self evident, in no particular order...
17  - Use of 4-space indenting, and no tabs.
18  - No C++ single line comments using `//`.
19  - The openning `{` is indented on the next newline.
20  - While the maximum code line length varies, generally long `if`, `while`, ... statements are wrapped to newlines.
22 Look forward to this document being filled out in detail...
24 Date: 20150904