https://github.com/gitbookio/slate-edit-footnote
A Slate plugin to handle footnotes
https://github.com/gitbookio/slate-edit-footnote
Last synced: 9 months ago
JSON representation
A Slate plugin to handle footnotes
- Host: GitHub
- URL: https://github.com/gitbookio/slate-edit-footnote
- Owner: GitbookIO
- License: apache-2.0
- Created: 2016-11-01T21:51:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-22T14:12:25.000Z (over 8 years ago)
- Last Synced: 2025-04-20T16:49:24.425Z (9 months ago)
- Language: JavaScript
- Size: 2.3 MB
- Stars: 10
- Watchers: 3
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# slate-edit-footnote
[](http://badge.fury.io/js/slate-edit-footnote)
[](https://travis-ci.org/GitbookIO/slate-edit-footnote)
A Slate plugin to handle footnote edition.
### Install
```
npm install slate-edit-footnote
```
### Features
- Normalize footnotes to be at end of the document
### Simple Usage
```js
import EditFootnote from 'slate-edit-footnote'
const plugins = [
EditFootnote()
]
```
#### Arguments
- ``[typeFootnote: String]`` — type for the footnote block
- ``[typeRef: String]`` — type for the footnote ref
### Utilities and Transform
`slate-edit-footnote` exports utilities and transforms:
#### `transforms.insertFootnote`
`plugin.transforms.insertFootnote(transform: Transform) => Transform`
Insert a new empty footnote, with a reference at the current position.
#### `plugin.isSelectionInFootnote(options, state)`
Utilities to determine if the current selection in the provided `state` is
within a footnote. `options` is an object with a property `typeFootnote` which
defaults to `footnote`.