My first package in npm. I would be grateful for any.
- Adds numbering for lines of code.
- Adds a special marker for the code block in the console.
- Adds a button to copy the contents of the code block.
- Formatting the copy button.
{
"plugins": [
"block-code"
]
}gitbook installnpm install gitbook-plugin-block-codeAll basic settings are default.
{
"pluginsConfig": {
"block-code": {
"cloneButton": true,
"lineNumber": true,
"cloneButtonStyle": {
"color": "#c1c7cd",
"color-hover": "#c1c7cd",
"bg": "transparent",
"bg-hover": "transparent"
},
"cloneButtonIcon": {
"clone": "fa-clone",
"check": "fa-check"
}
}
}
}| property | default | available values |
|---|---|---|
cloneButton |
true |
true | false |
lineNumber |
true |
true | false |
cloneButtonStyle |
{} |
contains such fields: color, color-hover, bg,bg-hover |
color |
#c1c7cd |
Format HEX color and transparent |
color-hover |
#c1c7cd |
Format HEX color and transparent |
bg |
#c1c7cd |
Format HEX color and transparent |
bg-hover |
#c1c7cd |
Format HEX color and transparent |
cloneButtonIcon |
{} |
contains such fields: clone, check |
clone |
fa-clone |
Icon font in string format |
check |
fa-check |
Icon font in string format |
cloneButtontruefalse
lineNumbertrueconsolefalse
cloneButtonStylecolorcolor-hoverbgbg-hover
cloneButtonIconclonecheck
In order to replace one of the icons, you need to go to the site fontawesome.com, select the necessary one and copy the class that begins with
fa-*title*.
Attention! Not all icons can be displayed, be careful.














