gitbook-plugin-codeblock-filename

0.0.9 • Public • Published

Gitbook Plugin: Add Filename to Codeblock

This is a gitbook plugin.

Add filename to codeblock.

Usage

You can install this plugin via NPM and save it to package.json.

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

Add the plugin to your book.json:

{
    plugins: [ "codeblock-filename" ] 
}

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


!FILENAME filename
```
codeblock
```

You can also write below like qiita,


```js:test.js
codeblock
```

Code format is not necessary. So you can exclude js.

You can also write below,


```:test.js
codeblock
```

Then, you can see the filename on top of the codeblock.

Example

write this code ↓


!FILENAME test.js
```
var a = 10;
a = a + 1;

console.log(a);
```

then result is ↓

screenshot

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i gitbook-plugin-codeblock-filename

      Weekly Downloads

      11

      Version

      0.0.9

      License

      MIT

      Last publish

      Collaborators

      • fukuo