0.0.2 • Published 6 years ago

gitbook-plugin-code-captions v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

MIT License npm version

Gitbook Plugin: Add captions to code snippets

Description

A simple gitbook plugin for adding captions or titles to code blocks.

This plugin is based on gitbook-plugin-codeblock-filename.

Installation

Add the plugin to your book.json:

{
	"plugins": [ "code-captions" ]
}

Then install it with gitbook:

gitbook install

Usage

Just add a !CAPTION sentence before the desired block:

!CAPTION This the hello_world.rb file
```ruby
puts "Hello world"
```

Generating the following result:

Sample

To override the CSS style, include this in your CSS files:

div.code-caption > span.code-caption-text {
  background-color: rgba(255, 0, 0, 0.07);
  /* Your css rules */
}

Generating the following result:

Custom sample

Contributors

This project has been developed by:

AvatarNameNicknameEmail
npm.ioDaniel HerzogWikitiinfo@danielherzog.es