chuangbo:marked

v0.3.5_1Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Meteor Marked

A wrapper of marked - A markdown parser and compiler. Built for speed.

Usage

It provide a template helper markdown as same as the official markdown, a window.marked as same as official marked (except when used with { weak: true }), and a Package['chuangbo:marked'].marked (always):

This package lets you use Markdown in your templates. It's easy: just put your markdown inside {{#markdown}} ... {{/markdown}} tags. You can still use all of the usual Meteor template features inside a Markdown block, such #each, and you still get reactivity.

Per the docs, the default options:

1marked.setOptions({
2  renderer: new marked.Renderer(),
3  gfm: true,
4  tables: true,
5  breaks: false,
6  pedantic: false,
7  sanitize: true,
8  smartLists: true,
9  smartypants: false
10});

you can also set an option highlight with a function to handle syntax highlighting for code blocks. Some Meteor syntax highlighting smart packages do this integration for you automatically.

e.g.

1marked.setOptions({
2  highlight: function (code) { return hljs.highlightAuto(code).value; }
3});