| Gitbook Plugin for [Prism](http://prismjs.com/) |
| ============== |
| |
| [](https://www.npmjs.com/package/gitbook-plugin-prism) |
| |
| ##### Before |
| <img src='http://i.imgur.com/cbk6O52.png'> |
| |
| ##### After |
| <img src='http://i.imgur.com/S1YMlee.png'> |
| |
| ## Usage |
| |
| Add the plugin to your `book.json`, and disable default GitBook code highlighting: |
| |
| ```json |
| { |
| "plugins": ["prism", "-highlight"] |
| } |
| ``` |
| |
| ## Options |
| |
| |
| ### `css` |
| Override default styles. All css files must reside in the same folder. |
| |
| ```json |
| "pluginsConfig": { |
| "prism": { |
| "css": [ |
| "prismjs/themes/prism-solarizedlight.css" |
| ] |
| } |
| } |
| ``` |
| |
| ### `lang` |
| Support non-standard syntax prefixes by aliasing existing prefixes. |
| |
| ```json |
| "pluginsConfig": { |
| "prism": { |
| "lang": { |
| "flow": "typescript" |
| } |
| } |
| } |
| ``` |
| |
| ### Prism Themes |
| |
| [https://github.com/PrismJS/prism](https://github.com/PrismJS/) |
| |
| #### Okaidia <small>`prismjs/themes/prism-okaidia.css`</small> |
|  |
| |
| #### Solarized Light <small>`prismjs/themes/prism-solarizedlight.css`</small> |
|  |
| |
| #### Tomorrow <small>`prismjs/themes/prism-tomorrow.css`</small> |
|  |
| |
| #### Dark <small>`prismjs/themes/prism-dark.css`</small> |
|  |
| |
| #### Coy <small>`prismjs/themes/prism-coy.css`</small> |
|  |
| |
| ## Atelierbram Themes |
| |
| [https://github.com/atelierbram/syntax-highlighting](https://github.com/atelierbram/syntax-highlighting) |
| |
| #### Base16 Ocean Dark <small>`syntax-highlighting/assets/css/prism/prism-base16-ocean.dark.css`</small> |
|  |
| |
| #### Google Light <small>`syntax-highlighting/assets/css/prism/prism-base16-google.light.css`</small> |
|  |
| |
| #### Xonokai <small>`syntax-highlighting/assets/css/prism/prism-xonokai.css`</small> |
|  |
| |
| ## Credits |
| |
| Originally based on https://github.com/spricity/google_code_prettify. |
| |
| ## License |
| |
| Apache 2 |