Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brechtcs/pbox
Parser for concatenated Jekyll posts
https://github.com/brechtcs/pbox
Last synced: about 11 hours ago
JSON representation
Parser for concatenated Jekyll posts
- Host: GitHub
- URL: https://github.com/brechtcs/pbox
- Owner: brechtcs
- License: apache-2.0
- Created: 2017-12-31T09:28:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T22:29:38.000Z (almost 7 years ago)
- Last Synced: 2024-09-18T11:18:31.042Z (about 2 months ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# pbox
Parser for concatenated Jekyll posts
## Install
`npm install pbox`
## Usage
```js
var fs = require('fs')
var pbox = require('pbox')var posts = fs.readFileSync('concat.md', 'utf-8')
var parsed = pbox.parse(posts)
```Given the following input:
```md
---
title: First post
---Some text.
---
title: Second post
---First section.
---
Second section.
```This will parse into an array with this structure:
```js
parsed = [
{
title: 'First post',
content: ['\nSome text.\n']
},
{
title: 'Second post',
content: [
'\nFirst section.\n',
'\nSecond section.\n'
]
}
]
```## License
Apache-2.0