Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perehinik/textolite
Text editor.
https://github.com/perehinik/textolite
editor rich-text-editor text-editor
Last synced: 6 days ago
JSON representation
Text editor.
- Host: GitHub
- URL: https://github.com/perehinik/textolite
- Owner: perehinik
- License: mit
- Created: 2023-05-16T01:50:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-20T02:53:18.000Z (about 1 year ago)
- Last Synced: 2024-10-10T23:31:14.388Z (about 1 month ago)
- Topics: editor, rich-text-editor, text-editor
- Language: TypeScript
- Homepage:
- Size: 614 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Textolite
Textolite is a simle text editor.
![](./images/editor.png)
## Using
In order to install package:
```shell
npm i textolite
```Then you can use it in your project:
```html
``````JavaScript
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.```JavaScript
const html = editor.getHTML();
```Please find example of usage below.
## Running tests
Running unit/integration tests: ```npm test```
Running unit/integration tests with coverage details: ```npm test -- --coverage```
Checking formatting: ```npx eslint .``` or ```npm run lint .```## Example
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.### Using latest released version of textolite library:
Skip this is you want to use local library.
1. Go to folder with example:
```shell
cd examples/react-example
```
2. Install textolite:
```shell
npm i textolite
```### Create link to local textolite library:
Skip this is you use latest released textolite.
1. Go to ```textolite``` directory.
2. Transpile typescript files to js:
```shell
tsc
```
3. Create global link to package:
```shell
npm link
```
4. Go to folder with example:
```shell
cd examples/react-example
```
5. Link local library to project:
```shell
npm link textolite
```### Running example
1. Go to folder with example:
```shell
cd examples/react-example
```
2. Install packages:
```shell
npm install
```
3. Build main.js using webpack:
```shell
npm run build
```
3. Run example:
```shell
npm start
```