A node.js stream that removes indentation from the pre
tag.
Before:
<html>
<body>
<pre>
function something() {
return 'Hello, World!';
}
</pre>
</body>
</html>
After:
<html>
<body>
<pre>
function something() {
return 'Hello, World!';
}
</pre>
</body>
</html>
Install globally or locally with NPM, or clone this repository with Git.
Process a single file
predentation index.html > output/index.html
Use your shell to glob and output files with the same name to a directory
predentation *.html -o output
Supports globbing internally so pass globs as a string to be platform agnostic
predentation '**/*.html' -o output
Pipe in and pipe out
cat index.html | predentation | minify > output.html
These options are available to the CLI only:
-o --output
: Output directory (use redirection >
for a single file)
Please do not create a plugin for this unless it is absolutely necessary!
Use vinyl-transform
to wrap predentation
, and use like any other plugin.
var gulp = require('gulp');
var transform = require('vinyl-transform');
var predentation = require('predentation');
var pre = transform(function (options) {
return predentation(options);
});
gulp.task('default', function () {
gulp
.src('input.html')
.pipe(pre)
.pipe(gulp.dest('output'));
});
If the only way to include this as part of your build is to make a plugin, then by all means make one and list it here.