unified

Project: josemarluedke/remark-hbs

Package: remark-hbs@0.4.1

  1. Dependents: 0
  2. Remark plugin that allows writing markdown with Ember handlebars templates
  1. remark 214
  2. unified 181
  3. markdown 154
  4. plugin 140
  5. remark-plugin 82
  6. ember 2

remark-hbs

Remark plugin that allows writing markdown with Ember handlebars templates.

Install

yarn add remark-hbs

Usage

Say we have the following markdown file, example.md:

# Lorem ipsum

<MyComponent @myArg={{this.isTesting}}>
  This is my component
</MyComponent>

And our script, example.js, looks as follows:

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:

<h1>Lorem ipsum</h1>
<MyComponent @myArg={{this.isTesting}}>
  This is my component

</MyComponent>

Limitations

<Something
  class="something"
>
</Something>

License

This project is licensed under the MIT License