gitbook-plugin-codeblock-filename

Add to Filename in Codeblock

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gitbook-plugin-codeblock-filename
1200.0.96 years ago9 years agoMinified + gzip package size for gitbook-plugin-codeblock-filename in KB

Readme

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></pre>

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

You can also write below,

<pre><code>
```: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