https://github.com/gaearon/gitbook-plugin-prism
Gitbook plugin for Prism highlighting
https://github.com/gaearon/gitbook-plugin-prism
Last synced: 9 months ago
JSON representation
Gitbook plugin for Prism highlighting
- Host: GitHub
- URL: https://github.com/gaearon/gitbook-plugin-prism
- Owner: gaearon
- License: apache-2.0
- Created: 2015-09-12T15:32:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-11-06T16:30:26.000Z (about 3 years ago)
- Last Synced: 2025-03-29T23:25:54.514Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 70.3 KB
- Stars: 89
- Watchers: 1
- Forks: 26
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- favorite-link - Gitbook 的高亮插件。
README
Gitbook Plugin for [Prism](http://prismjs.com/)
==============
[](https://www.npmjs.com/package/gitbook-plugin-prism)
##### Before

##### After

## 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"
}
}
}
```
### `ignore`
Due to other plugins using code block notion to denote other functionality, you can ignore certain langs
```json
"pluginsConfig": {
"prism": {
"ignore": [
"mermaid",
"eval-js"
]
}
}
```
### Prism Themes
[https://github.com/PrismJS/prism](https://github.com/PrismJS/)
#### Okaidia `prismjs/themes/prism-okaidia.css`

#### Solarized Light `prismjs/themes/prism-solarizedlight.css`

#### Tomorrow `prismjs/themes/prism-tomorrow.css`

#### Dark `prismjs/themes/prism-dark.css`

#### Coy `prismjs/themes/prism-coy.css`

## Atelierbram Themes
[https://github.com/atelierbram/syntax-highlighting](https://github.com/atelierbram/syntax-highlighting)
#### Base16 Ocean Dark `syntax-highlighting/assets/css/prism/prism-base16-ocean.dark.css`

#### Google Light `syntax-highlighting/assets/css/prism/prism-base16-google.light.css`

#### Xonokai `syntax-highlighting/assets/css/prism/prism-xonokai.css`

## Credits
Originally based on https://github.com/spricity/google_code_prettify.
## License
Apache 2