npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-remarkable

v3.6.1

Published

Remarkable markdown parser with highlight.js support

Downloads

86

Readme

ember-remarkable Build Status Ember Observer Score

Add Remarkable markdown parsing helpers and components to your Ember app.

Installation

ember install ember-remarkable

Usage

{{md-text
  text        = "# Markdown text!"
  typographer = true
  linkify     = false
}}

Options

option | type | default | security | description ------------- | ------- | ------- | ---------------------------------------------------- | ----------- text | string | | | Markdown content to render typographer | boolean | false | | Whether to enable Remarkable's typographer option linkify | boolean | false | | Whether to enable Remarkable's linkify option html | boolean | false | :warning: insecure | Whether to enable Remarkable's html option extensions | boolean | true | | Whether to enable Remarkable's syntax extensions dynamic | boolean | false | :warning: insecure | Whether to enable dynamic template rendering (see below)

Inline multi-line input

When you provide the text inline, you can split it into multiple lines like this:

<div>
  {{md-text
    text = "
# Hello world

Note that you have to unindent
the multiline `text` content.
    "
  }}
</div>

Dynamic Template Rendering

By enabling the dynamic option you can embed Ember components into your markdown:

{{md-text
  text = "{{link-to 'Foo' 'foo'}}"
}}

This feature is useful for implementing CMS-like functionality with Ember: it lets your Markdown content to be dynamic and Ember-driven rather than just static HTML.

But this approach is not encouraged by the Ember core team and might be deprecated in the future (though there are no plans to deprecate it as of May 2016).

:warning: Security implications

By using the html and dynamic template options you can make your app vulnerable to XSS.

Use those options only if your Markdown content is provided by trusted team members and regular users have no way to update it.

Syntax Highlighting

This addon uses highlight.js for syntax highlighting, in order to include it you just need to use Github style code-fencing. Currently, only the component supports syntax highlighting.

Excluding Highlightjs

The use of highlight.js can be disabled by adding the following option to your config/environment.js:

remarkable: {
  excludeHighlightJs: true
}

Setting to true will ensure that highlight.js won't be included in your build.

Custom Highlighting

The highlight function, as used by remarkable, can be overriden. To do this, create your own md-text component:

import MDTextComponent from 'ember-remarkable/components/md-text';

export default MDTextComponent.extend({ 
  highlight: function(str, lang) {
     return '';
  }
}); 

Plugins

You can pass plugins to each component instance by providing an array of plugin functions in a plugin option.

Development

Installation

  • git clone this repository
  • npm install
  • bower install

Running

  • ember server
  • Visit your app at http://localhost:4200.

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

Thanks to the following

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander(@4lpine).