-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
# draftjs-prism | ||
# draft-js-prism | ||
|
||
[](http://badge.fury.io/js/draftjs-prism) | ||
[](http://badge.fury.io/js/draft-js-prism) | ||
|
||
`draftjs-prism` is a decorator for DraftJS to highlight code blocks using [Prism](https://github.com/PrismJS/prism). | ||
`draft-js-prism` is a decorator for DraftJS to highlight code blocks using [Prism](https://github.com/PrismJS/prism). | ||
|
||
 | ||
|
||
### Installation | ||
|
||
``` | ||
$ npm install draftjs-prism | ||
$ npm install draft-js-prism | ||
``` | ||
|
||
### Usage | ||
|
||
```js | ||
var Draft = require('draft-js'); | ||
var PrismDecorator = require('draftjs-prism'); | ||
var PrismDecorator = require('draft-js-prism'); | ||
|
||
var decorator = new PrismDecorator(); | ||
var editorState = Draft.EditorState.createEmpty(decorator) | ||
``` | ||
|
||
You'll also need to include the css for one of the [Prism themes](https://github.com/PrismJS/prism/tree/gh-pages/themes). | ||
|
||
You can use this decorator combined with others by using [draftjs-multidecorators](https://github.com/SamyPesse/draftjs-multidecorators) | ||
You can use this decorator combined with others by using [draft-js-multidecorators](https://github.com/SamyPesse/draft-js-multidecorators) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "draftjs-prism", | ||
"name": "draft-js-prism", | ||
"version": "1.0.2", | ||
"description": "Code highlighting for DraftJS", | ||
"main": "./lib/index.js", | ||
|
@@ -13,17 +13,17 @@ | |
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/SamyPesse/draftjs-prism.git" | ||
"url": "git+https://github.com/SamyPesse/draft-js-prism.git" | ||
}, | ||
"keywords": [ | ||
"draftjs" | ||
"draft-js" | ||
], | ||
"author": "Samy Pesse <[email protected]>", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/SamyPesse/draftjs-prism/issues" | ||
"url": "https://github.com/SamyPesse/draft-js-prism/issues" | ||
}, | ||
"homepage": "https://github.com/SamyPesse/draftjs-prism#readme", | ||
"homepage": "https://github.com/SamyPesse/draft-js-prism#readme", | ||
"dependencies": { | ||
"extend": "^3.0.0", | ||
"immutable": "*", | ||
|