Package Exports
- predentation
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (predentation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
predentation
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>Installation
Install globally or locally with NPM, or clone this repository with Git.
Usage
Shell
Process a single file
predentation index.html > output/index.htmlUse your shell to glob and output files with the same name to a directory
predentation *.html -o outputSupports globbing internally so pass globs as a string to be platform agnostic
predentation '**/*.html' -o outputPipe in and pipe out
cat index.html | predentation | minify > output.htmlOptions
These options are available to the CLI only:
-o --output: Output directory (use redirection > for a single file)
Build Tools
Please do not create a plugin for this unless it is absolutely necessary!
Gulp
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'));
});Others
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.