https://github.com/hypercubed/angular-commonmark
CommonMark rendering in angularjs (A strongly specified, highly compatible implementation of Markdown).
https://github.com/hypercubed/angular-commonmark
Last synced: about 1 year ago
JSON representation
CommonMark rendering in angularjs (A strongly specified, highly compatible implementation of Markdown).
- Host: GitHub
- URL: https://github.com/hypercubed/angular-commonmark
- Owner: Hypercubed
- Created: 2014-09-24T08:30:26.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-05-07T02:13:27.000Z (about 11 years ago)
- Last Synced: 2025-03-30T09:31:34.415Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://hypercubed.github.io/angular-commonmark/
- Size: 592 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# angular-CommonMark [](http://badge.fury.io/bo/angular-CommonMark)
===
Render markdown in AngularJS using [CommonMark](http://commonmark.org/); A strongly specified, highly compatible implementation of Markdown.
*Please note: neither this directive nor the CommonMark implementation does any type of sanitization. As always, sanitizing is necessary for user-generated content.*
[](http://bower.io/ "get this with bower")
## Usage
1. `bower install Hypercubed/angular-commonmark`
2. Include the `commonmarkjs` script into your app. By default should be at `bower_components/commonmark/dist/commonmark.js`.
3. Include the `angular-CommonMark.js` into your app. By default should be at `bower_components/angular-commonmark/angular-commonmark.js`.
4. Add `hc.commonmark` as a module dependency to your app.
### As a directive
```html
#Markdown directive
*It works!*
```
Bind the markdown input to a scope variable:
```html
```
Include a markdown file:
```html
```
### As a service
```js
app.controller('myCtrl', ['CommonMark', function(CommonMark) {
$scope.html = CommonMark('#TEST');
}]);
```
## Testing
Install npm and bower dependencies:
```bash
npm install
bower install
npm test
```
## Acknowledgments
Based on
- [angular-marked](https://github.com/Hypercubed/angular-marked) by [Hypercubed](https://github.com/Hypercubed/) via
- [angular-markdown-directive](https://github.com/btford/angular-markdown-directive) by [briantford](http://briantford.com/) via
- [this excellent tutorial](http://blog.angularjs.org/2012/05/custom-components-part-1.html) by [@johnlinquist](https://twitter.com/johnlindquist).
Using
- [commonmark.js](https://github.com/jgm/commonmark.js) by [John MacFarlane](https://github.com/jgm/)
## License
Copyright (c) 2014 Jayson Harshbarger [](https://www.gittip.com/hypercubed/ "Donate weekly to this project using Gittip")
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X7KYR6T9U2NHC "One time donation to this project using Paypal")
[MIT License](http://en.wikipedia.org/wiki/MIT_License)