An open API service indexing awesome lists of open source software.

https://github.com/lwhiteley/gitbook-plugin-glossary-tooltip


https://github.com/lwhiteley/gitbook-plugin-glossary-tooltip

gitbook gitbook-glossary gitbook-plugin glossary tooltip

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

GitBook Glossary Tooltip Plugin
==============

A plugin that uses [tooltipjs](https://popper.js.org/tooltip-examples.html) to automatically transform glossary items into tooltips instead of seeing the default browser title attribute on hover.

[![npm version](https://badge.fury.io/js/gitbook-plugin-glossary-tooltip.svg)](https://badge.fury.io/js/gitbook-plugin-glossary-tooltip)
[![Build Status](https://travis-ci.org/lwhiteley/gitbook-plugin-glossary-tooltip.svg?branch=master)](https://travis-ci.org/lwhiteley/gitbook-plugin-glossary-tooltip)

## Add Plugin

book.json
```js
{
"plugins": ["glossary-tooltip"]
}
```

then run
```bash
$ gitbook install
```

### Configure (Optional Step)

book.json
```js
"pluginsConfig": {
"glossary-tooltip":{
"parseGlossaryItems": false,
}
}
```

### Config Options:
| Option | Description |
| ------------- | ------------- |
| `parseGlossaryItems` {Boolean}
**default**: `true` | tells the plugin whether to apply tooltips to glossary items or not |
| `trigger` {string}
**default**: `hover` | the event that triggers the tooltip. one of ['hover', 'click', 'focus'] |
| `placement` {string}
**default**: `top` | placement 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**:



{% tooltip "sample tooltip" %} sample tooltip test with **Emphasis** {% endtooltip %}

### Sample output

![output](https://i.imgur.com/Ug5MEEf.png)

Pull requests are welcome