gitbook-plugin-codeblock-label

Add a filenames above codeblocks


License
MIT
Install
npm install gitbook-plugin-codeblock-label@1.0.1

Documentation

Gitbook Plugin: Add labels to codeblocks

This is a gitbook plugin.

Id adds a label to codeblocks, it's useful for adding filenames over code blocks.

Usage

You can install this plugin via NPM and save it to package.json. The plugin requires gitbook >= 3, for older versions see the original package.

$ npm install gitbook-plugin-codeblock-label --save

Add the plugin to your book.json:

{
    plugins: [ "codeblock-label" ]
}

Then, you need only to insert before codeblock the code below.


{% label %}filename{% endlabel %}
```
codeblock
```

Example

write this code ↓


{% label %}test.js{% endlabel %}
```js
var a = 10;
a = a + 1;

console.log(a);
```

then result is ↓

screenshot