gitbook plugin [updated pkgs] https://github.com/windhamdavid/gitbook-plugin-prism-dw
Hao Luo 67ff4753e3 upped minor version per semantic versioning | 7 years ago | |
---|---|---|
.eslintrc | 8 years ago | |
.gitignore | 8 years ago | |
.travis.yml | 8 years ago | |
LICENSE | 10 years ago | |
README.md | 7 years ago | |
index.js | 7 years ago | |
package.json | 7 years ago | |
prism-ebook.css | 8 years ago | |
test.js | 7 years ago |
Add the plugin to your book.json
, and disable default GitBook code highlighting:
{
"plugins": ["prism", "-highlight"]
}
css
Override default styles. All css files must reside in the same folder.
"pluginsConfig": {
"prism": {
"css": [
"prismjs/themes/prism-solarizedlight.css"
]
}
}
lang
Support non-standard syntax prefixes by aliasing existing prefixes.
"pluginsConfig": {
"prism": {
"lang": {
"flow": "typescript"
}
}
}
ignore
Due to other plugins using code block notion to denote other functionality, you can ignore certain langs
"pluginsConfig": {
"prism": {
"ignore": [
"mermaid", //used by https://github.com/yanni4night/gitbook-plugin-mermaid-full
"eval-js" //used by https://github.com/brian-dawn/gitbook-plugin-klipse
]
}
}
https://github.com/PrismJS/prism
prismjs/themes/prism-okaidia.css
prismjs/themes/prism-solarizedlight.css
prismjs/themes/prism-tomorrow.css
prismjs/themes/prism-dark.css
prismjs/themes/prism-coy.css
https://github.com/atelierbram/syntax-highlighting
syntax-highlighting/assets/css/prism/prism-base16-ocean.dark.css
syntax-highlighting/assets/css/prism/prism-base16-google.light.css
syntax-highlighting/assets/css/prism/prism-xonokai.css
Originally based on https://github.com/spricity/google_code_prettify.
Apache 2