-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3ba1df4
Showing
9 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This file is for unifying the coding style for different editors and IDEs. | ||
# More information at http://EditorConfig.org | ||
|
||
# No .editorconfig files above the root directory | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 4 | ||
end_of_line = lf | ||
indent_style = space | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{bemjson.js,deps.js}] | ||
indent_size = 4 | ||
|
||
[{bower,package}.json] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# OS | ||
.DS_Store | ||
._* | ||
|
||
# NODEJS | ||
node_modules | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"disallowSpacesInCallExpression": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"disallowNewlineBeforeBlockStatements": true, | ||
"disallowMultipleLineBreaks": true, | ||
"requireSemicolons": true, | ||
"requireFunctionDeclarations": true, | ||
"requireCommaBeforeLineBreak": true, | ||
"disallowTrailingComma": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowSpacesInFunction": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"requireSpacesInFunction": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowSpacesInConditionalExpression": { | ||
"afterTest": true, | ||
"afterConsequent": true | ||
}, | ||
"excludeFiles": [ | ||
".git/**", | ||
"node_modules/**" | ||
], | ||
"fileExtensions": [".js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"eqeqeq": true, | ||
"expr": true, | ||
"maxlen": 120, | ||
"undef": true, | ||
"unused": true, | ||
"node": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/ | ||
test/ | ||
npm-debug.log | ||
.editorconfig | ||
.jscsrc | ||
.jshintignore | ||
.jshintrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# gulp-posthtml | ||
[](http://badge.fury.io/js/gulp-posthtml) | ||
|
||
## Usage | ||
|
||
```js | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var posthtml = require('posthtml'); | ||
var through = require('through2'); | ||
var gutil = require('gulp-util'); | ||
var PluginError = gutil.PluginError; | ||
|
||
// Consts | ||
var PLUGIN_NAME = 'gulp-posthtml'; | ||
|
||
module.exports = function(plugins, options) { | ||
|
||
if (!plugins) { | ||
throw new PluginError(PLUGIN_NAME, 'No plugin?'); | ||
} | ||
|
||
return through.obj(function(chunk, enc, cb) { | ||
if (chunk.isNull()) { | ||
// return empty file | ||
return cb(null, chunk); | ||
} | ||
posthtml([].concat(plugins)) | ||
.process(String(chunk.contents), options) | ||
.then(function(result) { | ||
chunk.contents = new Buffer(result.html); | ||
cb(null, chunk); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "gulp-posthtml", | ||
"version": "1.0.0", | ||
"description": "PostHTML Gulp Plugin", | ||
"main": "index.js", | ||
"dependencies": { | ||
"gulp-util": "^3.0.6", | ||
"posthtml": "^0.2.0", | ||
"through2": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"jscs": "^1.13.1", | ||
"jshint": "^2.8.0" | ||
}, | ||
"scripts": { | ||
"lint": "jshint . && jscs . -v" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/posthtml/gulp-posthtml.git" | ||
}, | ||
"keywords": [ | ||
"html", | ||
"xml", | ||
"postproccessor", | ||
"parser", | ||
"transform", | ||
"manipulation", | ||
"plugin", | ||
"gulp", | ||
"gulp-posthtml", | ||
"gulp-plugin" | ||
], | ||
"author": "Ivan Voischev <voischev.ivan@ya.ru>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/posthtml/gulp-posthtml/issues" | ||
}, | ||
"homepage": "https://github.com/posthtml/gulp-posthtml#readme" | ||
} |