The Lector Experience
Lector produces a reading enviroment, and summons a pointer that will help you read more efficient. It's sole purpose is to transfer a piece of text
in the most efficient way possible to your melting brain.
To achieve this, Lector attempts to move the pointer precisely as your eyes would move on the text. This creates a dynamic between the pointer, your eyes and
your mind. This dynamic can be expressed as "wiring in". Also known as super fucking focused on the text.
Contribute
First time:
git clone git@github.com:robo-monk/lector.git
cd lector
yarn install
- Python 3 required (prefferably installed with
brew
) - virtualenv (
pip install virtualenv
)
Run this to compile the code when you make changes:
Depends on your package manager (my recommendation would be yarn
)
source setup yarn
source setup npm
Install
Use npm or yarn:
yarn add pragmajs animejs compromise mousetrap
Using pragmajs:
import { Script } from 'pragmajs'
await Script.load('https://unpkg.com/lectorjs@latest/dist/lector.umd.js')
lectorjs.globalify()
Development
import { Script } from 'pragmajs'
console.time('📖 [lectorjs] load...')
await Script.load('https://unpkg.com/lectorjs@latest/dist/lector.umd.js', 'lector')
console.timeEnd('📖 [lectorjs] load...')
lectorjs.globalify()
Set up
Plug & play
The simplest way you can hookup Lector to your document is like this:
lec = Lector('#article')
;(async () => {
await Lector('#article', options)
})()
This will trigger a pointer to the element's text, and generate a toolbar to control the pointer's settings.
Plug harder & play harder
You can declare Lector with many settings:
settings = {
debug: false,
onboarding: false,
wfy: true,
loop: false,
autostart: false,
autoscroll: false,
fullStyles: true,
defaultStyles: true,
scaler: true,
pragmatizeOnCreate: true,
experimental: true,
settings: true,
stream: fetchContent,
paginate: {
from: 'stream',
as: 'infiniteScroll',
config: {
first: 1,
last: 69,
headspace: 4,
timeout: 1,
onPageAdd,
onCreate,
onCreate,
onPageActive,
onPageInactive,
onPageDestroy,
},
},
}
lec = Lector('#article', settings)
const defaultOptions = {
onboarding: false,
wfy: true,
settings: false,
defaultsStyles: true,
fullStyles: false,
debug: false,
hintPointer: true,
autoscroll: true,
disableWhenNotInView: false,
global: false,
experimental: false,
scaler: false,
stream: false,
paginate: false,
}