https://github.com/polo2ro/hsplit
split html content using the headers tags
https://github.com/polo2ro/hsplit
javascript-library string-manipulation
Last synced: over 1 year ago
JSON representation
split html content using the headers tags
- Host: GitHub
- URL: https://github.com/polo2ro/hsplit
- Owner: polo2ro
- License: mit
- Created: 2016-09-18T19:29:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-20T19:06:41.000Z (almost 10 years ago)
- Last Synced: 2024-03-15T11:11:00.516Z (over 2 years ago)
- Topics: javascript-library, string-manipulation
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hsplit
split html content using the headers tags
This library accept html input and give back a DOM node for the "article" element.
If the article element does not exists, il will be created.
The content of article is splitted into sections using the html headers as separator.
This has been created to index html documents into the lunr search engine, because
each header can have it's own url, the splitted elements can be indexed as separeted elements.
see [hexo-generator-lunr](https://github.com/polo2ro/hexo-generator-lunr).
## Install
```bash
npm install --save hsplit
```
## Usage example
```javascript
const hsplit = require('hsplit');
hsplit.document('
Title
Content
')
.then(article => {
});
```