0.0.4 • Published 10 years ago

ember-taggify v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Ember Taggify

This addon adds few template helpers allowing to taggify text; surrounding searched text by a tag. Those helpers are really simple. I found myself writting them many times and that is why I decided to publish them.

This README outlines the details of collaborating on this Ember addon.

Usage

There are 4 helpers available and they can be seen in action in the "dummy" application.

replace-text

Simplest and used by all other helpers. It applies javascript String.prototype.replace and returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string.

{{replace-text "Ember CLI" "CLI" "CLI is awesome"}} will produce Ember CLI is awesome

taggify-text

This helper will surround searched text by a tag. It uses replace-text and it is being used by the other helpers.

{{taggify-text "Ember CLI" "CLI" "mark"}} will produce Ember <mark>CLI</mark>

markify-text

{{markify-text "Ember CLI" "CLI"}} will produce Ember <mark>CLI</mark>

boldify-text

{{boldify-text "Ember CLI" "CLI"}} will produce Ember <bold>CLI</bold>

All those helpers are used in the "dummy", look at the dummy application for more details.

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

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