Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victrme/pocket-editor
Blazingly fast block style wysiwyg editor that returns markdown
https://github.com/victrme/pocket-editor
editor markdown npm-package texteditor typescript wysiwyg-editor
Last synced: 10 days ago
JSON representation
Blazingly fast block style wysiwyg editor that returns markdown
- Host: GitHub
- URL: https://github.com/victrme/pocket-editor
- Owner: victrme
- License: mit
- Created: 2022-12-20T16:34:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T08:42:01.000Z (2 months ago)
- Last Synced: 2024-10-31T19:24:13.071Z (17 days ago)
- Topics: editor, markdown, npm-package, texteditor, typescript, wysiwyg-editor
- Language: TypeScript
- Homepage: https://pocketeditor.victr.me
- Size: 422 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is yet another wysiwyg editor, it focuses mainly on two things:
- Very fast load time
- Reliable markdown output### Install
```
npm install pocket-editor
```### What you can do
```ts
interface Options {
text?: string
id?: string
defer?: true | number
}class PocketEditor {
constructor(selector: string, options?: Options)
get value(): string
set value(string): void
oninput: ((content: string) => void) => void
}
```### How to use
```html
```
```ts
import PocketEditor from "pocket-editor"
import "pocket-editor/style.css"const editor = new PocketEditor("#wrapper")
editor.value = "## Hello world !!"
editor.oninput((content) => {
console.log(content)
})
```### Keybindings
| Keybind | Action |
| ------------------ | ----------------- |
| `Ctrl + Shift + 1` | To big heading |
| `Ctrl + Shift + 2` | To medium heading |
| `Ctrl + Shift + 3` | To small heading |
| `Ctrl + Shift + 4` | To bullet list |
| `Ctrl + Shift + 5` | To todo list |
| `Ctrl + Shift + 6` | To normal line |_Ctrl is Cmd key on MacOS_
### Developement
```bash
# Install pnpm to use these scripts
npm i -g pnpm# First install all
pnpm i -rpnpm dev
pnpm preview
pnpm build
```