Textolite is a simle text editor.
In order to install package:
npm i textolite
Then you can use it in your project:
<div id="editor-container"></div>
import { Editor } from 'textolite';
const editor = new Editor("editor-container");
For now editor still doesn't support json export, so the easiest method of getting inserted text is to read innerHTML property of editor container.
const html = editor.getHTML();
Please find example of usage below.
Running unit/integration tests: npm test
Running unit/integration tests with coverage details: npm test -- --coverage
Checking formatting: npx eslint .
or npm run lint .
There are 2 exemples. One uses React, second is just Vanilla JS.
Examples were meant to be used with local version of textolite
library, but you can also use latest released version.
Skip this is you want to use local library.
- Go to folder with example:
cd examples/react-example
- Install textolite:
npm i textolite
Skip this is you use latest released textolite.
- Go to
textolite
directory. - Transpile typescript files to js:
tsc
- Create global link to package:
npm link
- Go to folder with example:
cd examples/react-example
- Link local library to project:
npm link textolite
- Go to folder with example:
cd examples/react-example
- Install packages:
npm install
- Build main.js using webpack:
npm run build
- Run example:
npm start