Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josemarluedke/remark-hbs
Remark plugin that allows writing markdown with Ember handlebars templates
https://github.com/josemarluedke/remark-hbs
ember handlebars markdown remark-plugin
Last synced: 2 months ago
JSON representation
Remark plugin that allows writing markdown with Ember handlebars templates
- Host: GitHub
- URL: https://github.com/josemarluedke/remark-hbs
- Owner: josemarluedke
- License: mit
- Created: 2020-03-24T01:45:54.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:42:44.000Z (almost 2 years ago)
- Last Synced: 2024-10-01T15:04:15.733Z (3 months ago)
- Topics: ember, handlebars, markdown, remark-plugin
- Language: JavaScript
- Homepage:
- Size: 555 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# remark-hbs ![](https://github.com/josemarluedke/remark-hbs/workflows/CI/badge.svg)
[Remark](https://github.com/remarkjs/remark) plugin that allows writing markdown with [Ember](https://emberjs.com/) handlebars templates.
## Install
```
yarn add remark-hbs
```## Usage
Say we have the following markdown file, `example.md`:
```md
# Lorem ipsumThis is my component
```
And our script, `example.js`, looks as follows:
```js
const fs = require('fs')
const unified = require('unified')
const markdown = require('remark-parse')
const hbs = require('remark-hbs')
const html = require('remark-html')const template = unified()
.use(markdown)
.use(hbs)
.use(html)
.processSync(fs.readFileSync('example.md'))
.toString()console.log(template)
```Now, running `node example.js` yields:
```hbs
Lorem ipsum
This is my component
```
## Limitations
- Closing an element tag in a new line is not supported as it is
parsed as blockquote in markdown. For example at line 3:
```hbs```
## License
This project is licensed under the [MIT License](LICENSE.md)