Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alveflo/html5ify

HTML5 linter and data-* prefix injector
https://github.com/alveflo/html5ify

gulp gulp-plugin html5

Last synced: 14 days ago
JSON representation

HTML5 linter and data-* prefix injector

Awesome Lists containing this project

README

        




html5ify








HTML5 linter and migration helper which adds `data`-prefix to all custom attributes in html documents and verifies that no obsolete/unsupported attributes is used. Attribute list is based on [W3 attribute reference](http://www.w3schools.com/tags/ref_attributes.asp)

## Installation
```
$ (sudo) npm install html5ify --global
```

## CLI
html5ify ships with a cli application which can be used to compile/lint documents, modify documents and store them into an output folder and also be used
as a reference to list available attributes for given tags.
### Options
```
Usage: html5ify [options]

Options:

-h, --help output usage information
-V, --version output the version number
-l, --list Get all valid attributes for given
-d, --dir Specifies directory to process
-f, --file Specifies file to process
-r, --recurse Reads directory recursively
-o, --out Specifies output directory
-g, --globals Get all valid global attributes
-u, --unsupported Get all unsupported attributes in HTML5
```
## Gulp
### Options
`throw` set this to `true` if you want gulp to throw an exception if unsupported/obsolete HTML attributes was found in any document.
### Example
#### gulpfile.js
```javascript
var html5ify = require("html5ify").gulp;
var gulp = require("gulp");

gulp.task("html5ify", function() {
return gulp.src("*.html")
.pipe(html5ify({
throw: true
}))
.pipe(gulp.dest("./dist"));
});
```
#### Input
```html


Some title






```
#### Output
```html


Some title






```
## License
The MIT License (MIT)

Copyright (c) 2016 Victor Alveflo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.