accent
v0.0.9
Published
A simple library for serializable highlights.
Downloads
20
Maintainers
Readme
accent
A simple library for serializable highlights.
import Accent from 'accent';
const accent = new Accent();
accent.highlightCurrentSelection()
.then(highlight => {
highlight.scrollIntoView();
}).catch(err => {
console.log('Oh no!');
});
/* or */
accent.highlightFromString('Hello, world!')
.then(highlight => {
highlight.scrollIntoView();
}).catch(err => {
console.log('Oh no!');
});
Installation
npm install accent --save
Usage
Bundle with browserify if you're building a project with node.
Or, if making a static website, paste this line of HTML into your code:
<script src="https://www.brcdn.org/accent/latest/?standalone=Accent"></script>
Accent
will be available in the global scope.