https://github.com/huafu/ember-marked
An Ember addon to provide {{code-section}} and {{markdown-section}} for syntax highlighting and markdown rendering
https://github.com/huafu/ember-marked
Last synced: about 2 months ago
JSON representation
An Ember addon to provide {{code-section}} and {{markdown-section}} for syntax highlighting and markdown rendering
- Host: GitHub
- URL: https://github.com/huafu/ember-marked
- Owner: huafu
- License: isc
- Created: 2014-11-10T02:13:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-08T08:40:32.000Z (about 9 years ago)
- Last Synced: 2025-05-01T00:02:42.129Z (about 2 months ago)
- Language: JavaScript
- Homepage: http://huafu.github.io/#/ember?name=ember-marked
- Size: 1.15 MB
- Stars: 11
- Watchers: 1
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ember-marked
Ember component to easily render markdown (using `marked`, so GFM and syntax highlighting supported from scratch).
A very basic example application using those components is available [there](http://huafu.github.io/ember-marked/).## Installation
* `npm install --save-dev ember-marked`
## Using
* To render markdown content, simply use the component in your templates: `{{markdown-section content=someMarkdownProperty}}`
* You also have access to a `code-section` component used to render syntax highlighted code: `{{code-section content=someSourceCode language='javascript'}}`
* You can look at the example application under `tests/dummy`, especially the `app/templates/application.hbs` showing a very simple example of using this addon.
* If you'd like to specify [options to pass to marked](https://github.com/chjj/marked#options-1), just set the "options" property when you use the component: `{{markdown-section content=markdownProperty options=myMarkdownOptions}}`## Configuration
* You can configure which `marked` and `highlight.js` to use in your application configuration (`config/environment.js`) by adding a `marked` section like this:
```js
marked: {
// marked settings
//version: '0.3.2', // default version, used when the js is not specified
//js: false, // disable inclusion of the javascript (can be the URL to some other CDN)
// highlight.js settings
highlightjs: { // <== set to false to disable totally the inclusion of highlightjs
//version: '8.3', // default version, used when the js and/or css are not specified
//js: false, // disable inclusion of the javascript (can be the URL to some other CDN)
//css: false, // disable inclusion of the css (can be the URL to some other CDN)
}
}
```## Credits
* Author: **[Huafu Gandon](http://github.com/huafu)**
* This is using [marked](https://github.com/chjj/marked) and optionally [highlightjs](https://github.com/isagalaev/highlight.js) to render syntax highlighting sections