Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/btford/angular-markdown-directive
AngularJS markdown directive using Showdown.js
https://github.com/btford/angular-markdown-directive
Last synced: 5 days ago
JSON representation
AngularJS markdown directive using Showdown.js
- Host: GitHub
- URL: https://github.com/btford/angular-markdown-directive
- Owner: btford
- Created: 2013-03-08T08:31:52.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-05-04T19:09:10.000Z (almost 7 years ago)
- Last Synced: 2025-02-03T08:25:45.522Z (12 days ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 569
- Watchers: 17
- Forks: 120
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# angular-markdown-directive [![Build Status](https://travis-ci.org/btford/angular-markdown-directive.png)](https://travis-ci.org/btford/angular-markdown-directive)
Bower Component for a simple AngularJS Markdown directive using [Showdown](https://github.com/coreyti/showdown). Based on [this excellent tutorial](http://blog.angularjs.org/2012/05/custom-components-part-1.html) by [@johnlinquist](https://twitter.com/johnlindquist).
## Usage
1. `bower install angular-markdown-directive`
2. Include `angular-sanitize.js`. It should be located at `bower_components/angular-sanitize/`.
3. Include `showdown.js`. It should be located at `bower_components/showdown/`.
4. Include `markdown.js` provided by this component into your app.
5. Add `btford.markdown` as a module dependency to your app.
6. Insert the `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
```
## Options
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']
});
}])
```## License
MIT