https://github.com/si3nloong/go-editorjs
Go backend for Editor.js
https://github.com/si3nloong/go-editorjs
editorjs go go-backend
Last synced: 6 months ago
JSON representation
Go backend for Editor.js
- Host: GitHub
- URL: https://github.com/si3nloong/go-editorjs
- Owner: si3nloong
- License: mit
- Created: 2020-05-10T16:32:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-30T23:16:19.000Z (over 1 year ago)
- Last Synced: 2025-03-26T05:33:21.605Z (7 months ago)
- Topics: editorjs, go, go-backend
- Language: Go
- Homepage: https://editorjs.io
- Size: 47.9 KB
- Stars: 10
- Watchers: 0
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Editor.js (Go)
Server-side implementation sample for the [Editor.js](https://github.com/codex-team/editor.js). It contains data validation and converts output from Editor.js to HTML.
## Installation
```bash
go get github.com/si3nloong/go-editorjs
```## Basic usage
```go
import (
editorjs "github.com/si3nloong/go-editorjs"
)func main() {
b := []byte(`
{
"time": 1589098011153,
"blocks": [
{
"type": "header",
"data": {
"text": "Editor.js",
"level": 2
}
}
],
"version": "2.17.0"
}
`)ejs := editorjs.NewEditorJS()
buf := new(bytes.Buffer)
if err := ejs.ParseTo(b, buf); err != nil {
panic(err)
}log.Println("HTML result =>", buf.String())
}
```## Example of Editor.js output
```json
{
"time": 1589098011153,
"blocks": [
{
"type": "header",
"data": {
"text": "Editor.js",
"level": 2
}
}
],
"version": "2.17.0"
}
```