Gitbook produces code examples. This plugin adds a button next to them. Then, one can send the result to the browser inspector console.
You can use install it via NPM:
$ npm install gitbook-plugin-toconsole
And use it for your book with:
$ gitbook build ./ --plugins=toconsole
You can set the button message with the plugins configuration (command line option: --pluginsConfig
) :
{
"toconsole": {
"buttontext": "Evaluate in console"
}
}