This plugin is the default GitBook plugin used to highlight code blocks.
You can remove it using:
{
plugins: ["-highlight"]
}
Default syntax highlighter for GitBook
If I want to add a new language for syntax highlighting, where would I need to place the file? I can't find highlight.js anywhere on my machine, although I built a few Gitbooks with JS(ON) highlighting. There's no subfolder node_modules in gitbook-plugin-highlight, where I had expected the files of highlight.js...
Hey,
I am new into CS and have little idea about npm and node.js, I tried to read the code but still not know how to use it.
This is my book.json file:
{
"gitbook": "2.x.x",
"plugins": [
"katex",
"include-codeblock",
"image-captions",
"search",
"codesnippet",
"katex",
"highlight"
],
"pluginsConfig": {
"include-codeblock": {
"unindent": true
}
}
}
however, after I enable "highlight", I still don't know how to start using it. For example if I had a code block like this:
int main(){
cout << "Hello world" << endl;
return 0;
}
and I want to highlight "return 0", how can I do that?
Thanks...!!
When doing
+ x
- y
it doesn't highlight in gitbook default or night themes, but it does in the sepia theme.
This code is seen with proper highlighting here.
from Crypto.Cipher import DES3
from Crypto import Random
key = b'Sixteen byte key
iv = Random.new().read(DES3.block_size)
cipher = DES3.new(key, DES3.MODE_OFB, iv)
plaintext = b'Sample plaintext'
msg = iv + cipher.encrypt(plaintext)
But on Gitbook it appears without the highlighting :
I am using triple backquotes followed by python and ending the code chunk with triple backquotes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.