Skip to content

Commit

Permalink
add light entry for prism
Browse files Browse the repository at this point in the history
  • Loading branch information
conorhastings committed Dec 9, 2017
1 parent d65e38a commit 9247eb9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ languages
light.js
create-element.js
highlight.js
demo
prism-light.js
demo
18 changes: 9 additions & 9 deletions AVAILABLE_STYLES_PRISM.MD
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
## Available `stylesheet` props
* coy
* dark
* funky
* okaidia
* solarizedlight
* tomorrow
* twilight
* prism
* atomDark
* base16AteliersulphurpoolLight
* cb
Expand All @@ -21,4 +13,12 @@
* hopscotch
* pojoaque
* vs
* xonokai
* xonokai
* coy
* dark
* funky
* okaidia
* solarizedlight
* tomorrow
* twilight
* prism
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,6 @@ const Component = () => {
return <SyntaxHighlighter language='javascript' style={docco}>{codeString}</SyntaxHighlighter>;
}
```
### Light Build

React Syntax Highlighter used in the way described above can have a fairly large footprint. For those that desire more control over what exactly they need, there is an option to import a light build. If you choose to use this you will need to specifically import desired languages and register them using the registerLanguage export from the light build

```js
import SyntaxHighlighter, { registerLanguage } from "react-syntax-highlighter/light"
import js from 'react-syntax-highlighter/languages/hljs/javascript';
import docco from 'react-syntax-highlighter/styles/docco';

registerLanguage('javascript', js);
```

### Prism

Expand All @@ -76,6 +65,27 @@ const Component = () => {
}
```

### Light Build

React Syntax Highlighter used in the way described above can have a fairly large footprint. For those that desire more control over what exactly they need, there is an option to import a light build. If you choose to use this you will need to specifically import desired languages and register them using the registerLanguage export from the light build. There is also no default style provided.

```js
import SyntaxHighlighter, { registerLanguage } from "react-syntax-highlighter/light";
import js from 'react-syntax-highlighter/languages/hljs/javascript';
import docco from 'react-syntax-highlighter/styles/docco';

registerLanguage('javascript', js);
```

You can require `react-syntax-highlighter/prism-light` to use the prism light build instead of the standard light build.

import SyntaxHighlighter, { registerLanguage } from "react-syntax-highlighter/prism-light";
import jsx from 'react-syntax-highlighter/languages/prism/jsx';
import prism from 'react-syntax-highlighter/prism/prism';

registerLanguage('jsx', jsx);
```
### Built with React Syntax Highlighter
- [DBGlass](https://github.com/web-pal/DBGlass) - PostgreSQL client built with Electron.
Expand Down
16 changes: 8 additions & 8 deletions src/styles/prism/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export { default as coy } from './coy';
export { default as dark } from './dark';
export { default as funky } from './funky';
export { default as okaidia } from './okaidia';
export { default as solarizedlight } from './solarizedlight';
export { default as tomorrow } from './tomorrow';
export { default as twilight } from './twilight';
export { default as prism } from './prism';
export { default as atomDark } from './atom-dark';
export { default as base16AteliersulphurpoolLight } from './base16-ateliersulphurpool.light';
export { default as cb } from './cb';
Expand All @@ -21,3 +13,11 @@ export { default as hopscotch } from './hopscotch';
export { default as pojoaque } from './pojoaque';
export { default as vs } from './vs';
export { default as xonokai } from './xonokai';
export { default as coy } from './coy';
export { default as dark } from './dark';
export { default as funky } from './funky';
export { default as okaidia } from './okaidia';
export { default as solarizedlight } from './solarizedlight';
export { default as tomorrow } from './tomorrow';
export { default as twilight } from './twilight';
export { default as prism } from './prism';

0 comments on commit 9247eb9

Please sign in to comment.