New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

angular-markdown-directive

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-markdown-directive

simple AngularJS markdown directive with showdown

Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
505
-25.41%
Maintainers
1
Weekly downloads
 
Created
Source

angular-markdown-directive Build Status

Bower Component for a simple AngularJS Markdown directive using Showdown. Based on this excellent tutorial by @johnlinquist.

Usage

  • bower install angular-markdown-directive
  • Include angular-sanitize.js. It should be located at bower_components/angular-sanitize/.
  • Include showdown.js. It should be located at bower_components/showdown/.
  • Include markdown.js provided by this component into your app.
  • Add btford.markdown as a module dependency to your app.
  • Insert the btf-markdown directive into your template:
<btf-markdown>
  #Markdown directive
  *It works!*
</btf-markdown>

You can also bind the markdown input to a scope variable:

<div btf-markdown="markdown">
</div>
<!-- Uses $scope.markdown -->

Or include a markdown file:

<div btf-markdown ng-include="'README.md'">
</div>
<!-- Uses content from README.md -->

Options

You can configure the markdownConverterProvider:

angular.module('myApp', [
  'ngSanitize',
  'btford.markdown'
]).
config(['markdownConverterProvider', function (markdownConverterProvider) {
  // options to be passed to Showdown
  // see: https://github.com/coreyti/showdown#extensions
  markdownConverterProvider.config({
    extensions: ['twitter']
  });
}])

License

MIT

Keywords

angular

FAQs

Package last updated on 21 Apr 2014

Related posts