0.0.9 • Published 10 years ago
accent v0.0.9
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 --saveUsage
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.