From 63c5f1bd6d2898de57ead7a7084639b1b5ab4752 Mon Sep 17 00:00:00 2001 From: Bevan Arps Date: Sat, 10 Jun 2023 21:28:35 +1200 Subject: [PATCH] Update docs --- README.md | 103 +++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index c3444a9..6fa1e37 100644 --- a/README.md +++ b/README.md @@ -129,57 +129,58 @@ htmltest uses a YAML configuration file. Put `.htmltest.yml` in the same directo ### Basic Options -| Option | Description | Default | -| :----- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| :------ | -| `DirectoryPath` | Directory to scan for HTML files. | | -| `DirectoryIndex` | The file to look for when linking to a directory. | `index.html` | -| `FilePath` | Single file to test within `DirectoryPath`, omit to test all. | | -| `FileExtension` | Extension of your HTML documents, includes the dot. If `FilePath` is set we use the extension from that. | `.html` | -| `BaseURL` | Publication URL of the site, including subfolder if applicable. | | -| `CheckDoctype` | Enables checking the document type declaration. | `true` | -| `CheckAnchors` | Enables checking ``. | `false` | -| `EnforceHTTPS` | Fails when encountering an `http://` link. Useful to prevent mixed content errors when serving over HTTPS. | `false` | -| `IgnoreURLs` | Array of regexs of URLs to ignore. | empty | -| `IgnoreInternalURLs` | Array of strings of internal URLs to ignore. Exact matches only. ⚠ Likely to be deprecated, use `IgnoreURLs` instead. | empty | -| `IgnoreHTTPS` | Array of regexs of URLs to ignore for `EnforceHTTPS`. These URLs are still tested, unless also present in `IgnoreURLs`. | empty | -| `IgnoreDirs` | Array of regexs of directories to ignore when scanning for HTML files. | empty | -| `IgnoreInternalEmptyHash` | When true prevents raising an error for links with `href="#"`. | `false` | -| `IgnoreEmptyHref` | When true prevents raising an error for links with `href=""`. | `false` | -| `IgnoreCanonicalBrokenLinks` | When true produces a warning, rather than an error, for broken canonical links. When testing a site which isn't live yet or before publishing a new page canonical links will fail. | `true` | -| `IgnoreExternalBrokenLinks` | When true produces a warning, rather than an error, for broken external links. Useful when testing a site having hundreds of external links. | `false` | -| `IgnoreAltMissing` | Turns off image alt attribute checking. | `false` | -| `IgnoreAltEmpty` | Allows `alt=""` for decorative images. | `false` | -| `IgnoreDirectoryMissingTrailingSlash` | Turns off errors for links to directories without a trailing slash. | `false` | -| `IgnoreSSLVerify` | Turns off x509 errors for self-signed certificates. | `false` | -| `IgnoreTagAttribute` | Specify the ignore attribute. All tags with this attribute or with this class will be excluded from every check. | `"data-proofer-ignore"` | -| `HTTPHeaders` | Dictionary of headers to include in external requests | `{"Range": "bytes=0-0", "Accept": "*/*"}` | -| `TestFilesConcurrently` | :warning: :construction: *EXPERIMENTAL* Turns on [concurrent](https://github.com/wjdp/htmltest/wiki/Concurrency) checking of files. | `false` | -| `DocumentConcurrencyLimit` | Maximum number of documents to process at once. | `128` | -| `HTTPConcurrencyLimit` | Maximum number of open HTTP connections. If you raise this number ensure the `ExternalTimeout` is suitably raised. | `16` | -| `LogLevel` | Logging level, 0-3: debug, info, warning, error. | `2` | -| `LogSort` | How to sort/present issues. Can be `seq` for sequential output or `document` to group by document. | `document` | -| `ExternalTimeout` | Number of seconds to wait on an HTTP connection before failing. | `15` | -| `RedirectLimit` | Allowed number of redirects. Use built-in behavior with negative values. | `-1` | -| `StripQueryString` | Enables stripping of query strings from external checks. | `true` | -| `StripQueryExcludes` | List of URLs to disable query stripping on. | `["fonts.googleapis.com"]` | -| `OutputDir` | Directory to store cache and log files in. Relative to executing directory. | `tmp/.htmltest` | -| `OutputCacheFile` | File within `OutputDir` to store reference cache. | `refcache.json` | -| `OutputLogFile` | File within `OutputDir` to store last tests errors. | `htmltest.log` | -| `CacheExpires` | Cache validity period, accepts [go.time duration strings](https://golang.org/pkg/time/#ParseDuration) (…"m", "h"). | `336h` (two weeks) | +| Option | Description | Default | +| :------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------- | +| `DirectoryPath` | Directory to scan for HTML files. | | +| `DirectoryIndex` | The file to look for when linking to a directory. | `index.html` | +| `FilePath` | Single file to test within `DirectoryPath`, omit to test all. | | +| `FileExtension` | Extension of your HTML documents, includes the dot. If `FilePath` is set we use the extension from that. | `.html` | +| `BaseURL` | Publication URL of the site, including subfolder if applicable. | | +| `CheckDoctype` | Enables checking the document type declaration. | `true` | +| `CheckAnchors` | Enables checking ``. | `false` | +| `EnforceHTTPS` | Fails when encountering an `http://` link. Useful to prevent mixed content errors when serving over HTTPS. | `false` | +| `IgnoreURLs` | Array of regexs of URLs to ignore. | empty | +| `IgnoreInternalURLs` | Array of strings of internal URLs to ignore. Exact matches only. ⚠ Likely to be deprecated, use `IgnoreURLs` instead. | empty | +| `IgnoreHTTPS` | Array of regexs of URLs to ignore for `EnforceHTTPS`. These URLs are still tested, unless also present in `IgnoreURLs`. | empty | +| `IgnoreDirs` | Array of regexs of directories to ignore when scanning for HTML files. | empty | +| `IgnoreInternalEmptyHash` | When true prevents raising an error for links with `href="#"`. | `false` | +| `IgnoreEmptyHref` | When true prevents raising an error for links with `href=""`. | `false` | +| `IgnoreCanonicalBrokenLinks` | When true produces a warning, rather than an error, for broken canonical links. When testing a site which isn't live yet or before publishing a new page canonical links will fail. | `true` | +| `IgnoreExternalBrokenLinks` | When true produces a warning, rather than an error, for broken external links. Useful when testing a site having hundreds of external links. | `false` | +| `IgnoreAltMissing` | Turns off image alt attribute checking. | `false` | +| `IgnoreAltEmpty` | Allows `alt=""` for decorative images. | `false` | +| `IgnoreDirectoryMissingTrailingSlash` | Turns off errors for links to directories without a trailing slash. | `false` | +| `IgnoreSSLVerify` | Turns off x509 errors for self-signed certificates. | `false` | +| `IgnoreTagAttribute` | Specify the ignore attribute. All tags with this attribute or with this class will be excluded from every check. | `"data-proofer-ignore"` | +| `HTTPHeaders` | Dictionary of headers to include in external requests | `{"Range": "bytes=0-0", "Accept": "*/*"}` | +| `TestFilesConcurrently` | :warning: :construction: *EXPERIMENTAL* Turns on [concurrent](https://github.com/wjdp/htmltest/wiki/Concurrency) checking of files. | `false` | +| `DocumentConcurrencyLimit` | Maximum number of documents to process at once. | `128` | +| `HTTPConcurrencyLimit` | Maximum number of open HTTP connections. If you raise this number ensure the `ExternalTimeout` is suitably raised. | `16` | +| `HTTPHostConcurrencyLimit` | Maximum number of open HTTP connections to a unique host (domain). | `2` | +| `LogLevel` | Logging level, 0-3: debug, info, warning, error. | `2` | +| `LogSort` | How to sort/present issues. Can be `seq` for sequential output or `document` to group by document. | `document` | +| `ExternalTimeout` | Number of seconds to wait on an HTTP connection before failing. | `15` | +| `RedirectLimit` | Allowed number of redirects. Use built-in behavior with negative values. | `-1` | +| `StripQueryString` | Enables stripping of query strings from external checks. | `true` | +| `StripQueryExcludes` | List of URLs to disable query stripping on. | `["fonts.googleapis.com"]` | +| `OutputDir` | Directory to store cache and log files in. Relative to executing directory. | `tmp/.htmltest` | +| `OutputCacheFile` | File within `OutputDir` to store reference cache. | `refcache.json` | +| `OutputLogFile` | File within `OutputDir` to store last tests errors. | `htmltest.log` | +| `CacheExpires` | Cache validity period, accepts [go.time duration strings](https://golang.org/pkg/time/#ParseDuration) (…"m", "h"). | `336h` (two weeks) | ### Example