Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/showdownjs/ng-showdown
Angular integration for Showdown
https://github.com/showdownjs/ng-showdown
Last synced: 8 days ago
JSON representation
Angular integration for Showdown
- Host: GitHub
- URL: https://github.com/showdownjs/ng-showdown
- Owner: showdownjs
- License: bsd-3-clause
- Created: 2015-01-15T02:23:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-12-30T01:46:11.000Z (almost 5 years ago)
- Last Synced: 2024-10-18T20:58:14.786Z (21 days ago)
- Language: JavaScript
- Size: 921 KB
- Stars: 106
- Watchers: 9
- Forks: 33
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ng-showdown
Angular integration for [Showdown](https://github.com/showdownjs/showdown)
## How to use it
1. Install it
a. via bower:
```
bower install --save ng-showdown
```
b. via npm
```
npm install --save ng-showdown
```
2. Include `'ng-showdown'` in your module dependencies
3. Use it
```
```## Dependencies
ng-showdown depends on the [ngSanitize module](https://docs.angularjs.org/api/ngSanitize). Don't forget to include it:
```html
```
## API#### `$showdown`
`$showdown.makeHtml(markdown)` - Converts a markdown text into HTML
Input: *string* - markdown to be parsed
Output: *string* - html output from showdown
`$showdown.stripHtml` - Strips a text of it's HTML tags. See http://stackoverflow.com/questions/17289448/angularjs-to-output-plain-text-instead-of-html
Input: *string* - html to be stripped
Output: *string* - string without `` tags
#### `markdownToHtml` directive
Example usage:
```
```Input: *string* - markdown to be parsed
Output: *string* - html output from showdown
#### `stripHtml` filter
Example usage:
```
```Input: *string* - Input to be stripped of html
Output: *string* - stripped html
## Configuration
You can configure the options and extensions passed to showdown by using the `$showdownProvider`. To see these options, visit the [Showdown page](https://github.com/showdownjs/showdown).
`$showdownProvider.setOption(key, value)` - sets the passed in option as a configuration option in showdown
`$showdownProvider.getOption(key)` - get the option as determined by the passed in key.
`$showdownProvider.loadExtension(extensionName)` - loads the extension into showdown as determined by the passed in extension name