Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ben-eb/metalsmith-widow
Add non breaking spaces to the ends of block level elements, with Metalsmith.
https://github.com/ben-eb/metalsmith-widow
Last synced: 7 days ago
JSON representation
Add non breaking spaces to the ends of block level elements, with Metalsmith.
- Host: GitHub
- URL: https://github.com/ben-eb/metalsmith-widow
- Owner: ben-eb
- License: mit
- Created: 2015-01-22T09:41:32.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-27T15:27:30.000Z (about 9 years ago)
- Last Synced: 2024-10-18T08:30:41.825Z (28 days ago)
- Language: HTML
- Size: 148 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# [metalsmith][metalsmith]-widow [![Build Status](https://travis-ci.org/ben-eb/metalsmith-widow.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/metalsmith-widow.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/metalsmith-widow.svg)][deps]
> Add non breaking spaces to the ends of block level elements, with Metalsmith.
*If you have any issues with the output of this plugin, please use the
[widow tracker](https://github.com/ben-eb/widow/issues).*Install via [npm](https://npmjs.org/package/metalsmith-widow):
```
npm install metalsmith-widow --save
```## Example
```js
var widow = require('metalsmith-widow'),
markdown = require('metalsmith-markdown'),
Metalsmith = require('metalsmith');Metalsmith('fixtures')
.use(markdown())
.use(widow())
.build(function (err) {
if (err) {
throw err;
}
});
```With custom options:
```js
Metalsmith('fixtures')
.use(markdown())
.use(widow({
selectors: 'h1.h2.h3.h4.h5.h6'.split('.')
}))
.build(function (err) {
if (err) {
throw err;
}
});
```## Options
See the [widow documentation](https://github.com/ben-eb/widow#options).
## Contributing
Pull requests are welcome. If you add functionality, then please add unit
tests to cover it.## License
MIT © Ben Briggs
[ci]: https://travis-ci.org/ben-eb/metalsmith-widow
[deps]: https://gemnasium.com/ben-eb/metalsmith-widow
[metalsmith]: https://github.com/segmentio/metalsmith
[npm]: http://badge.fury.io/js/metalsmith-widow