makestatic-verify-id
Version:
Verify id attributes are unique
90 lines (62 loc) • 2.41 kB
Markdown
# Verify Id
> Verify id attributes are unique
For each HTML file check that `id` attributes are unique to the document.
---
- [Install](#install)
- [API](#api)
- [VerifyId](#verifyid)
- [See Also](#see-also)
- [.after](#after)
- [Options](#options)
- [Throws](#throws)
- [License](#license)
---
## Install
```
yarn add makestatic-verify-id
```
## API
### VerifyId
Verify `id` attributes in HTML documents are unique.
#### See Also
* [/docs/api/graph-resources/](https://makestatic.ws/docs/api/graph-resources/)
#### .after
```javascript
VerifyId.prototype.after(context, options)
```
Verifies that `id` attributes are unique in each HTML document.
When `strict` is disabled an error is not thrown but a warning message is
logged.
* `context` Object the processing context.
* `options` Object the plugin options.
##### Options
* `strict` Boolean=true warn rather than error when `false`.
##### Throws
* `Error` if no resource graph is available.
* `Error` when a duplicate id attribute is detected in `strict` mode.
## License
MIT
---
Created by [mkdoc](https://github.com/mkdoc/mkdoc) on March 12, 2017
[docs]: https://makestatic.ws/docs/ "Documentation"
[standalone manual]: https://github.com/makestatic/website/blob/master/MANUAL.md "Standalone Manual"
[yarn]: https://yarnpkg.com "Yarn"
[webpack]: https://webpack.js.org "Webpack"
[babel]: https://babeljs.io "Babel"
[postcss]: http://postcss.org "Postcss"
[sugarss]: https://github.com/postcss/sugarss "Sugarss"
[reshape]: https://github.com/reshape/reshape "Reshape Source Code"
[reshapeml]: https://reshape.ml "Reshape"
[clean-css]: https://github.com/jakubpawlowicz/clean-css "Clean CSS"
[html-minifier]: https://github.com/kangax/html-minifier "Html Minifier"
[uglify-js]: https://github.com/mishoo/UglifyJS2 "Uglify JS"
[imagemin]: https://github.com/imagemin/imagemin "Imagemin"
[mkdoc]: https://github.com/mkdoc/mkdoc "Mkdoc"
[browsersync]: https://www.browsersync.io "Browsersync"
[yeoman]: http://yeoman.io "Yeoman"
[spike]: https://www.spike.cf "Spike"
[validator]: https://github.com/validator/validator "HTML Validator"
[github pages]: https://pages.github.com "Github Pages"
[amazon s3]: https://aws.amazon.com/s3/ "Amazon S3"
[google sitemaps]: https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190 "Google Sitemaps"
[sitemaps]: https://www.sitemaps.org/ "Sitemaps"