-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtidy-html5.cli.txt
169 lines (136 loc) · 9.74 KB
/
tidy-html5.cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
┏━━━━━━━━━━━━━━━━┓
┃ TIDY-HTML5 ┃
┗━━━━━━━━━━━━━━━━┛
VERSION ==> #5.1.25
#Beautify HTML
CONFIG ==> #Can be:
# - tidy -config FILE:
# - each line: RULE: VAL
# - can use //COMMENT
# - ENVVAR HTML_TIDY FILE
# - tidy --RULE VAL
#All --OPTION are RULE
#VAL is BOOL if not specified
#Can print current with tidy -show-config
tidy [FILE...] #Def: stdin
#Exit code: 0 (no warnings), 1 (warnings), 2 (errors)
┌─────────┐
│ I/O │
└─────────┘
--output-file FILE #Def: stdout
--write-back #Modify input file directly (def: false)
--keep-time #Do not modify mtime with --write-back (def: false)
--error-file FILE #Def: stderr
--markup #If false (def: true), only show errors and warnings
--force-output #Output even if there were errors (def: false)
--show-info|warnings #Def: true
--show-errors #Max number of errors (def: 6)
--quiet #Def: false
--gnu-emacs #Different output formatting (def: false)
--input|output|char-encoding STR #Sets input|output|both encoding (def: 'utf-8')
--output-bom #Def: auto
--newline #Among 'LF', 'CR' or 'CRLF' (def: auto)
--output-[x]html #Outputs as [X]HTML (def: false)
--output-xml #Outputs as XML
--input-xml #To use when input is XHTML (def: false)
--gdoc #To use when working on HTML exported by Google Doc (def: false)
--word-2000 #To use when working on HTML exported by Word 2000 (def: false)
┌────────────┐
│ ERRORS │
└────────────┘
--coerce-endtags #<tag><tag2><tag2></tag> ->
#<tag><tag2></tag2></tag> (def: true)
--drop-proprietary-attributes #Remove non-standard attributes (def: false)
--drop-empty-elements #Remove <tag></tag> (def: true)
--drop-empty-paras #Remove <p></p> (def: true)
--merge-divs|spans #Merge <tag><tag></tag></tag> for <div|span>:
# - true: unless child has class|style|id attribute
# - auto (def): unless child has id attribute. Other attributes are moved to parent
# - false
--merge-emphasis #Merge <tag><tag></tag></tag> for <b|i> (def: true)
--fix-uri #Escape URLs (def: true)
--fix-backslash #Replace \ by / in URLs (def: true)
--fix-bad-comments #Replace <!--- ---> by <!--= =--> (def: true)
--repeated-attributes #Remove repeated attributes, among 'keep-first', 'keep-last' (def)
--join-classes #<tag class="..." class="..."> -> <tag class="... ..."> (def: false)
--join-styles #<tag style="..." style="..."> -> <tag style="...;..."> (def: true)
--litteral-attributes #If false (def), replace any contiguous whitespaces in attribute values by single space
--new-blocklevel-tags #List of custom TAG,... that are block
--new-pre-tags #Same for TAG that are block similar to <pre>
--new-empty-tags #Same for TAG that are inline empty
--new-inline-tags #Same for TAG that are inline non-empty
┌───────────┐
│ STYLE │
└───────────┘
--indent BOOL|auto #Indent (def: false)
--indent-with-tabs #As opposed to spaces (def: false)
--indent-spaces #NUM of spaces|tab to indent (def: 2)
--indent-attributes #Start each attribute on a newline (def: false)
--tab-size #NUM spaces to convert input tabs (def: 8)
--vertical-space #Newlines:
# - false (def): keep
# - auto: remove most
# - true: auto algorithm
--break-before-br #Newline before <br> (def: false)
--wrap NUM #Max columns width (def: 68)
--wrap-attributes #Wrap attributes value (def: false)
--wrap-string-literals #Wrap long STR inside <script> (def: false)
--wrap-sections #Wrap code within <![ ]> (def: true)
--wrap-asp #Wrap code within <% %> (def: true)
--wrap-jste #Wrap code within <# #> (def: true)
--wrap-php #Wrap code within <?php ?> (def: true)
--punctuation-wrap #Line wraps chinese chars (def: false)
--uppercase-tags #Uppercase|lowercase <TAG> (def: false)
--uppercase-attributes #Uppercase|lowercase attributes (def: false)
--lowercase-literals #Lowercase attribute value (if is enum) (def: true)
--sort-attributes #Sort HTML attributes. Can be 'none' (def), 'alpha'
--omit-optional-tags #Omit optional elements and optional end tags (def: false)
--replace-color #Use named colors instead of hex colors when possible (def: false)
--bare #Replace some weird Unicode by more common equivalent (def: false)
--skip-nested #Do not process HTML inside <script|style> (def: true)
┌──────────────┐
│ ESCAPING │
└──────────────┘
--ncr #Do not use HTML entities, except for & < > " (def: false)
--quote-ampersand #HTML encode & (def: true)
--quote-marks #HTML encode " (def: false)
--quote-nbsp #HTML encode non-breaking-space (instead of using Unicode notation) (def: true)
--ascii-chars #Do not HTML encode ASCII chars (def: false)
--numeric-entities #Use HTML entities in numeric instead of name form (def: false)
--preserve-entities #Preserve HTML entities (def: false)
┌─────────────────────────────────┐
│ RECOMMENDED TAGS/ATTRIBUTES │
└─────────────────────────────────┘
--doctype #Can be:
# - 'auto' (def)
# - 'html5'
# - 'strict': HTML4 or XHTML1 strict
# - 'loose': HTML4 or XHTML1 loose
# - 'DOCTYPE'
# - 'omit': none
--anchor-as-name #If true (def), name="ID" is added if id="ID" exists.
#If false, name is removed if id="ID" exists.
--alt-text STR #Default <img> alt
--enclose-text #Wrap node text with <p> if not wrapped by <tag> (def: false)
--decorate-inferred-ul #Add <style> to <ul> to avoid right indentation (def: false)
--css-prefix #Prefix used on classnames on added <style> (def: 'c')
--clean #Replace <font|nobr|center|i|b> by <style> (def: false)
--logical-emphasis #Replace <i|b> by <em|strong> (def: false)
--show-body-only #Strip anything outside <body>. Can be:
# - true
# - auto: true if <body> implicit
# - false (def)
--accessibility-check 0-3 #Add accessibility check, from least 0 (def) to most 3
┌──────────────┐
│ COMMENTS │
└──────────────┘
--hide-comments #Remove comments (def: false)
--indent-cdata #Indent CDATA (def: false)
--escape-cdata #Convert CDATA to text node (def: false)
--tidy-mark #Add a <meta> element to indicate document has been tidied (def: true)
┌─────────┐
│ XML │
└─────────┘
--add-xml-decl #Add <?xml ...> (def: false)
--add-xml-space #Add xml:space="preserve" (def: false)
--assume-xml-procins #Require processing instructions to be ended by ?> (def: same as --input-xml)