Skip to content

litmon/gitbook-plugin-codeblock-filename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •