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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.91latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.91
0.0.81
0.0.71
0.0.61
0.0.51
0.0.41
0.0.31
0.0.21
0.0.12

Package Sidebar

Install

npm i gitbook-plugin-codeblock-filename

Weekly Downloads

10

Version

0.0.9

License

MIT

Last publish

Collaborators

  • fukuo