Marker

Marker is a tool that can help you mark some words or sentences in website.

But now it is too weak, I will try to make it more interesting.

you can see a simple demo at https://linkgod.github.io/marker/demo

Installation

First load Marker via tag:

<link rel="stylesheet" href="src/markPer.css">
<script src="src/marker.js">

You can also load Marker by RequireJS or Sea.js.

Usage

init with id attribute

var editor = new Marker('#marker');

init with an element

var editor = new Marker(document.getElementById('marker'));

init with options

var options = {
    dom: document.getElementById('marker'), // {DOM Element} [required]
    type: [
        {
            name: '精粹',
            color: '#00f127'
        },
        {
            name: '糟粕',
            color: '#a0a0a0'
        }
    ]
}

var marker = new Marker(options);

After mark some words or sentences

console.log(marker.getKeywordList());
console.log(marker.getTemplet());

License

Licensed under MIT