0.0.5 • Published 7 years ago

gitbook-plugin-glossary-tooltip v0.0.5

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
7 years ago

GitBook Glossary Tooltip Plugin

A plugin that uses tooltipjs to automatically transform glossary items into tooltips instead of seeing the default browser title attribute on hover.

npm version Build Status

Add Plugin

book.json

{
    "plugins": ["glossary-tooltip"]
}

then run

$ gitbook install

Configure (Optional Step)

book.json

"pluginsConfig": {
    "glossary-tooltip":{
        "parseGlossaryItems": false,
    }
}

Config Options:

OptionDescription
parseGlossaryItems {Boolean} default: truetells the plugin whether to apply tooltips to glossary items or not
trigger {string} default: hoverthe event that triggers the tooltip. one of 'hover', 'click', 'focus'
placement {string} default: topplacement of the tooltip relative to the trigger element. one of 'top', 'bottom', 'left', 'right'"

Template

You can also place your own tooltip in your markdown

Args

tooltip takes one required named/unnamed argument:

  • topic (string): The text to display in the tooltip trigger element.

example:

Sample output

output

Pull requests are welcome