Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mxstbr authored Mar 21, 2018
1 parent 2b7cfdf commit f0b2bf0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
[![NPM version](https://badge.fury.io/js/draft-js-prism.svg)](http://badge.fury.io/js/draft-js-prism)
[![Build Status](https://travis-ci.org/SamyPesse/draft-js-prism.svg?branch=master)](https://travis-ci.org/SamyPesse/draft-js-prism)

`draft-js-prism` is a decorator for DraftJS to highlight code blocks using [Prism](https://github.com/PrismJS/prism). It only decorates code blocks with syntax highlighting, if you're interested in providing a correct edition UX for code blocks, take a look at [draft-js-code](https://github.com/SamyPesse/draft-js-code).
`draft-js-prism` is a decorator for DraftJS to highlight code blocks using [Prism](https://github.com/PrismJS/prism).

> Note: It only decorates code blocks with syntax highlighting, if you're interested in providing a correct edition UX for code blocks, take a look at [draft-js-code](https://github.com/SamyPesse/draft-js-code).
![Prism](./preview.gif)

### Installation
## Installation

```
$ npm install draft-js-prism prismjs
```

### Usage
## Usage

```js
var Draft = require('draft-js');
Expand All @@ -29,4 +31,10 @@ 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).

### Usage with `draft-js-plugins`

If you're using `draft-js-plugins` simply use the [`draft-js-prism-plugin`](https://github.com/withspectrum/draft-js-prism-plugin), a wrapper around this decorator.

### Usage with other decorators

You can use this decorator combined with others by using [draft-js-multidecorators](https://github.com/SamyPesse/draft-js-multidecorators)

0 comments on commit f0b2bf0

Please sign in to comment.