This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.hbs
127 lines (81 loc) · 3.09 KB
/
README.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Freedom Editor
Freedom Editor is a lightweight, fully extensible, zero-dependencies, framework agonistic block editor. You can use vanilla code or your favorite framework to build blocks you need.
## Features
### Framework agonistic
Create blocks with vanilla code or with your favorite frontend framework, be it React, Angular, Vue, or lighter frameworks like lighterhtml or Reef.
### Full customiziable and modular
Unlike other block editors, every parts of Freedom editor is modular except its core loading and saving functions. You can extend it and build whatever you want to control editor and blocks behaviors. Sky is the limit.
### Lightweight and zero-dependencies
The core of Freedom Editor is written in vanilla code, and it only weights 1.5KB gzipped, tremendously smaller than other block editors.
### Other block editor specific features
- Predefined block template support
- i18n and rtl support
- Clean JSON data output (You can even define your own data structure!)
```
Json data structure to be added
```
## Getting Started
### Prerequisites
You need to have [node.js](https://nodejs.org/en/) and npm installed to easily download packages of Freedom Editor. If you don't, download with the following.
npm will be installed by default, when you install node.js
Use this command to download node.js or
```
Give examples
```
### Installing
A step by step series of examples that tell you how to get a development env running
Say what the step will be
```
npm i freedom-editor
```
And repeat
```
until finished
```
End with an example of getting some data out of the system or using it for a little demo
## Deployment
To use Freedom Editor in browser, you have to do the following:
1. Create a new instance of Freedom Editor
2. Call `FreedomEditor.init()` to set up the editor and hook plugins you want to use to the editor
3. Call `FreedomEditor.loadBlocks()` to load blocks from block template or saved data.
### Example
```
import FreedomEditor from '../core.esm.js'
import {
FreedomEditorKeyBindings
} from './plugins/keyBindings.js'
import {
Paragraph
} from './blocks/paragraph.js'
const paragraphBlock = new Paragraph()
const editor = new FreedomEditor({
containerId: 'freedom-editor',
defaultBlock: paragraphBlock,
registeredBlocks: {
paragraphBlock: paragraphBlock
},
blockTemplate: [
paragraphBlock
],
i18n: {
rtl: 'ltr'
}
})
editor.init([
new FreedomEditorKeyBindings({
editor: editor
}).init
])
editor.loadBlocks()
```
## API Reference
{{>main}}
## Contributing
Please read [CONTRIBUTING.md](https://github.com/winston0410/freedom-editor/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Authors
- **Hugo Sum** - _Initial work_ -
See also the list of [contributors](https://github.com/winston0410/freedom-editor/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [license](https://github.com/winston0410/freedom-editor/LICENSE.md) for more details.
## Acknowledgments
- Inspiration from Gutenberg editor and editor.js