Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 ipsum

This 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)