Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

gubler/gitbook-plugin-callouts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitbook Plugin: Transform annotated quotes to callouts

This plugin was modified from erixtekila/gitbook-plugin-richquotes to create callouts similar to the ones provided by Sphinx.

How to create callouts

Callouts are an extension of markdown blockquotes. All callouts must start with a h4 header, the callout type, and an optional title. The format for this is:

For Markdown:

> #### type::title
>
> cotent

For AsciiDoc:

> ==== type::title
> 
> content

Supported default callouts are:

  • > #### Info::Info
  • > #### Note::Note
  • > #### Tag::Tag
  • > #### Comment::Comment
  • > #### Hint::Hint
  • > #### Success::Success
  • > #### Warning::Warning
  • > #### Caution::Caution
  • > #### Danger::Danger
  • > #### Quote::Quote

Callouts are case-insensitive.

Installation

Add this plugin to your book.json:

{
	"plugins": ["callouts"]
}

Then run gitbook install to download and install the plugin.

Override built-in callouts

You can add user defined or override built-in callouts in book.json file:

{
	"plugins": ["callouts"],
	"pluginsConfig":
	{
		"callouts":
		{
			"star": {
				"alert": "warning",
				"picto": "fa-star"
			}
		}
	}
}

Alert values are:

  • primary
  • info
  • success
  • warning
  • danger

Examples of each alert type (both "White" and "Night" modes supported) are:

Examples

Refer to Font Awesome doc for picto value.

Show type in header

As shown above, the callout type (info, warning, danger, etc.) will be shown in the callout header (type: title). If you do not want to have the type displayed in the header, you can set the showTypeInHeader option to false.

{
    "plugins": ["callouts"],
    "pluginsConfig":
    {
        "callouts":
        {
            "showTypeInHeader": false
        }
    }
}

As long as you have a title defined (ex. type::title) the type will not be displayed in the header. The type will be displayed in the header if no title is defined (ex. type::).

About

Gitbook plugin : Transform annoted quotes to notes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 63.8%
  • CSS 36.2%