simple AngularJS markdown directive with showdown
npm install angular-markdown-directiveBower Component for a simple AngularJS Markdown directive using Showdown. Based on this excellent tutorial by @johnlinquist.
bower install angular-markdown-directiveangular-sanitize.js. It should be located at bower_components/angular-sanitize/.showdown.js. It should be located at bower_components/showdown/.markdown.js provided by this component into your app.btford.markdown as a module dependency to your app.btf-markdown directive into your template:``html`
#Markdown directive
It works!
You can also bind the markdown input to a scope variable:
`html`
Or include a markdown file:
`html`
You can configure the markdownConverterProvider:
`javascript``
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']
});
}])