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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
.TH "HTMLProofe" "1" "2019-03-24" "" "User commands"
.SH NAME
htmlproofer \- validate rendered HTML files
.SH SYNOPSIS
.B htmlproofer
.I directory
.RB [ options ]
.SH DESCRIPTION
.B htmlproofer
is a set of tests to validate HTML output. These tests check if image
references are legitimate, if they have alt tags, if internal links are
working, and so on.
.B HTMLProofer
can run on a file, a directory, an array of directories, or an array of
links. Below is a mostly comprehensive list of checks that it can perform.
.PP
Images (\fB<img>\fR elements)
.IP \[bu]
Whether all images have alt tags
.IP \[bu]
Whether internal image references are not broken
.IP \[bu]
Whether external images are showing
.IP \[bu]
Whether images are HTTPS
.PP
Links (\fB<a>\fR, \fB<link>\fR elements)
.IP \[bu]
Whether internal links are working
.IP \[bu]
Whether internal hash references (#linkToMe) are working
.IP \[bu]
Whether external links are working
.IP \[bu]
Whether links are HTTPS
.IP \[bu]
Whether CORS/SRI is enabled
.PP
Scripts (\fB<script>\fR elements)
.IP \[bu]
Whether internal script references are working
.IP \[bu]
Whether external scripts are loading
.IP \[bu]
Whether CORS/SRI is enabled
.PP
Favicon
.IP \[bu]
Whether favicons are valid.
.PP
OpenGraph
.IP \[bu]
Whether the images and URLs in the OpenGraph metadata are valid.
.PP
HTML
.IP \[bu]
Whether your HTML markup is valid.
This is done via Nokogiri to ensure well-formed markup.
.SH OPTIONS
.PP
Listed below are the command line options for \fBhtmlproofer\fR:
.TP
.B \-\-allow-missing-href
Don't flag tags missing an \fBhref\fR attribute. This is the default for
HTML5.
.TP
.B \-\-allow-hash-href
Ignores \fBhref="#"\fR.
.TP
.B \-\-as-links
Assumes that \fIPATH\fR is a comma-separated array of links to check.
.TP
.B \-\-alt-ignore \fIimage1,[image2,...]\fR
A comma-separated list of Strings or RegExps containing images whose
missing \fBalt\fR attributes are safe to ignore.
.TP
.B \-\-assume-extension
Automatically add extension (e.g. \fB.html\fR) to file paths, to allow
extensionless URLs (as supported by Jekyll 3 and GitHub Pages).
.TP
.B \-\-checks-to-ignore \fIcheck1,[check2,...]\fR
An array of Strings indicating which checks not to perform.
.TP
.B \-\-check-external-hash
Checks whether external hashes exist (even if the webpage exists). This slows
the checker down.
.TP
.B \-\-check-favicon
Enables the favicon checker.
.TP
.B \-\-check-html
Enables HTML validation errors from Nokogiri.
.TP
.B \-\-check-img-http
Check, that images use \fBHTTPS\fR.
.TP
.B \-\-check-opengraph
Enables the Open Graph checker.
.TP
.B \-\-check-sri
Check that \fB<link>\fR and \fB<script>\fR external resources do use SRI.
.TP
.B \-\-directory-index-file \fIfilename\fR
Sets the file to look for when a link refers to a directory. Defaults
to \fIindex.html\fR.
.TP
.B \-\-disable-external
Don't run the external link checker, which can take a lot of time.
.TP
.B \-\-empty-alt-ignore
If \fItrue\fR, ignores images with empty \fBalt\fR attribues.
.TP
.B \-\-error-sort \fIsort\fR
Defines the sort order for error output. Can be \fI:path\fR, \fI:desc\fR,
or \fI:status\fR. Defaults to \fI:path\fR.
.TP
.B \-\-enforce-https
Fails if a link is not marked as HTTPS.
.TP
.B \-\-extension \fIext\fR
The extension of HTML files including the dot. Defaults to \fI.html\fR.
.TP
.B \-\-external_only
Only check for problems with external references.
.TP
.B \-\-file-ignore \fIfile1,[file2,...]\fR
A comma-separated list of Strings or RegExps containing file paths that
are safe to ignore.
.TP
.B \-\-help
Print this usage information on the command line.
.TP
.B \-\-http-status-ignore \fI123,[xxx, ...]\fR
A comma-separated list of numbers representing status codes to ignore.
.TP
.B \-\-internal-domains \fIdomain1,[domain2,...]\fR
A comma-separated list of Strings containing domains that will be treated
as internal urls.
.TP
.B \-\-report-invalid-tags
Ignore errors from \fB--check-html\fR associated with unknown markup.
.TP
.B \-\-report-missing-names
Ignore errors from \fB--check-html\fR associated with missing entities.
.TP
.B \-\-report-script-embeds
Ignore errors from \fB--check-html\fR associated with \fB<script>\fRs.
.TP
.B \-\-log-level \fIlevel\fR
Sets the logging level, as determined by Yell. One
of \fI:debug\fR, \fI:info\fR, \fI:warn\fR, \fI:error\fR, or \fI:fatal\fR.
Defaults to \fI:info\fR.
.TP
.B \-\-only-4xx
Only reports errors for links that fall within the 4xx status code range
.TP
.B \-\-storage-dir \fIdirectory\fR
Directory where to store the cache log. Defaults to \fItmp/.htmlproofer\fR.
.TP
.B \-\-timeframe \fItime\fR
A string representing the caching timeframe.
.TP
.B \-\-typhoeus-config \fIstring\fR
JSON-formatted string of Typhoeus config. It will override
the \fBhtml-proofer\fR defaults.
.TP
.B \-\-url-ignore \fIlink1,[link2,...]\fR
A comma-separated list of Strings or RegExps containing URLs that are safe to
ignore. It affects all HTML attributes. Non-HTTP(S) URIs are always ignored.
.TP
.B \-\-url-swap \fIre:string,[re:string,...]\fR
A comma-separated list containing key-value pairs of \fIRegExp => String\fR.
It transforms URLs that match \fIRegExp\fR into \fIString\fR via \fBgsub\fR.
The escape sequences \fI\\:\fR should be used to produce literal \fI:\fRs.'
.SS Special usage cases
.PP
For options which require an array of input, values can be surrounded by quotes.
Don't use any spaces. For example, to exclude an array of HTTP status code:
.PP
.RS 4
.B htmlproofer --http-status-ignore "999,401,404" ./out
.RE
.PP
For options like \fB--url-ignore\fR, which require an array of regular
expressions, the following syntax works:
.PP
.RS 4
.B htmlproofer --url-ignore "/www.github.com/,/foo.com/" ./out
.RE
.PP
The \fB--url-swap\fR switch is a bit special, since one will pass in a pair
of \fIRegEx:String\fR values. The escape sequences \fI\\:\fR should be used
to produce literal \fI:\fR. \fBhtmlproofer\fR will figure out what you mean.
.PP
.RS
.B htmlproofer --url-swap "wow:cow,mow:doh" --extension .html.erb --url-ignore www.github.com ./out
.RE
.SH AUTHORS
The program author is \fBGaren Torikian\fR.
.PP
This manual page page was written
by \fBDaniel Leidert\fR <\&daniel.leidert@wgdd.de\&>
for the Debian distribution (but may be used by others).
|