All Projects → notelix → web-marker

notelix / web-marker

Licence: MIT license
a web page highlighter - Please star if you like this project

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
HTML
75241 projects

Projects that are alternatives of or similar to web-marker

Web Highlighter
✨ A no-runtime dependency lib for text highlighting & persistence on any website ✨🖍️
Stars: ✭ 373 (+631.37%)
Mutual labels:  text, range, selection, highlight
texthighlighter
a no dependency typescript npm package for highlighting user selected text
Stars: ✭ 17 (-66.67%)
Mutual labels:  annotation, text, range, highlight
Vscode Highlight
Advanced text highlighter based on regexes. Useful for todos, annotations etc.
Stars: ✭ 71 (+39.22%)
Mutual labels:  annotation, text, highlight
text-editor
A text selection range API written in pure JavaScript, for modern browsers.
Stars: ✭ 24 (-52.94%)
Mutual labels:  text, range, selection
Traces.vim
Range, pattern and substitute preview for Vim
Stars: ✭ 568 (+1013.73%)
Mutual labels:  range, highlight
markee
Visual text selection
Stars: ✭ 22 (-56.86%)
Mutual labels:  selection, highlight
Mark.js
JavaScript keyword highlighting. Mark text with with options that fit every application. Also available as jQuery plugin.
Stars: ✭ 2,004 (+3829.41%)
Mutual labels:  highlighter, highlight
Colorhighlight
🎨 Lightweight Color Highlight colorizer for Sublime Text
Stars: ✭ 76 (+49.02%)
Mutual labels:  highlighter, highlight
Insert Text At Cursor
Fast crossbrowser insertion of text at cursor position in a textarea / input
Stars: ✭ 49 (-3.92%)
Mutual labels:  text, selection
Sharect
🔗 A lightweight JavaScript library to let users share their text selections to social networks.
Stars: ✭ 192 (+276.47%)
Mutual labels:  text, selection
selecton-extension
Selecton provides popup with actions on text selection in all major browsers
Stars: ✭ 36 (-29.41%)
Mutual labels:  text, selection
Prestyler
Elegant text formatting tool in Swift 🔥
Stars: ✭ 36 (-29.41%)
Mutual labels:  text
KodeEditor
A simple code editor with syntax highlighting and pinch to zoom
Stars: ✭ 60 (+17.65%)
Mutual labels:  highlighter
enhanced-slack
🌴 PoC Slack enhancer/injector
Stars: ✭ 48 (-5.88%)
Mutual labels:  highlight
web-verse
Toolbox for deep, resilient, markup-invariant linking into HTML documents without their cooperation
Stars: ✭ 25 (-50.98%)
Mutual labels:  annotation
hotscript
HotScript - Revolutionizing how Windows works.
Stars: ✭ 29 (-43.14%)
Mutual labels:  text
cummings.ee
A collection of the work of Edward Estlin Cummings, as it enters the public domain.
Stars: ✭ 32 (-37.25%)
Mutual labels:  text
text-to-freemind
A simple text to Freemind conversion program
Stars: ✭ 38 (-25.49%)
Mutual labels:  text
lda2vec
Mixing Dirichlet Topic Models and Word Embeddings to Make lda2vec from this paper https://arxiv.org/abs/1605.02019
Stars: ✭ 27 (-47.06%)
Mutual labels:  text
TextHighlighter
TextHighlighter is a simple android library to show highlighted and styled text in android apps.
Stars: ✭ 25 (-50.98%)
Mutual labels:  highlighter

web-marker

logo

A web page highlighter that features

  • accurate serialization and deserialization which makes it possible to correctly restore the highlights, even if part of the web page has changed
  • nested highlighting
  • no runtime-dependency

demo

How to run

git clone https://github.com/notelix/web-marker
cd web-marker
npm i
npm start

How to use

npm install @notelix/web-marker
import {Marker} from "@notelix/web-marker"

const marker = new Marker({
    rootElement: document.body,
    eventHandler: {
        onHighlightClick: (context, element) => {
            marker.unpaint(context.serializedRange);
        },
        onHighlightHoverStateChange: (context, element, hovering) => {
            if (hovering) {
                element.style.backgroundColor = "#f0d8ff";
            } else {
                element.style.backgroundColor = "";
            }
        }
    },
    highlightPainter: {
        paintHighlight: (context, element) => {
            element.style.color = "red";
        }
    }
});

marker.addEventListeners();

document.addEventListener('mouseup', (e) => {
    const selection = window.getSelection();
    if (!selection.rangeCount) {
        return null;
    }
    const serialized = marker.serializeRange(selection.getRangeAt(0));
    console.log(JSON.stringify(serialized));
    marker.paint(serialized);
})

How to build library

npm run build-lib
npm pack

Built with web-marker

  • notelix/notelix: An open source web note taking / highlighter software (chrome extension with backend)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].