{"id":13600215,"url":"https://github.com/micheleriva/editorjs-go","last_synced_at":"2025-04-30T18:26:35.906Z","repository":{"id":57548766,"uuid":"292380772","full_name":"micheleriva/editorjs-go","owner":"micheleriva","description":"Fast markdown/HTML generator for Editor.js","archived":false,"fork":false,"pushed_at":"2023-02-14T10:48:53.000Z","size":243,"stargazers_count":37,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T18:44:02.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micheleriva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["MicheleRiva"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-09-02T19:52:35.000Z","updated_at":"2024-10-16T12:09:17.000Z","dependencies_parsed_at":"2024-01-06T20:45:40.436Z","dependency_job_id":"d915b729-f95e-4f64-8f66-02f02bd33301","html_url":"https://github.com/micheleriva/editorjs-go","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleriva%2Feditorjs-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleriva%2Feditorjs-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleriva%2Feditorjs-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleriva%2Feditorjs-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micheleriva","download_url":"https://codeload.github.com/micheleriva/editorjs-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251759585,"owners_count":21639259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T18:00:32.346Z","updated_at":"2025-04-30T18:26:35.831Z","avatar_url":"https://github.com/micheleriva.png","language":"Go","funding_links":["https://github.com/sponsors/MicheleRiva"],"categories":["Go","Libraries"],"sub_categories":["Go"],"readme":"\u003cimg src=\"/misc/cover.png\" alt=\"Editorjs.go\" /\u003e\n\nA simple library which converts **[Editor.js](https://editorjs.io)** JSON output to **Markdown** or **HTML**.\n\n## Installation\n\n```bash\ngo get github.com/micheleriva/editorjs-go\n```\n\n## Usage\n\nLet's suppose that we have the following Editor.js output saved in a file called `editorjs_output.json`:\n\n```json\n{\n  \"blocks\": [\n    {\n      \"type\" : \"header\",\n      \"data\" : {\n        \"text\" : \"Editor.js\",\n        \"level\" : 2\n      }\n    },\n    {\n      \"type\" : \"paragraph\",\n      \"data\" : {\n        \"text\" : \"Hey. Meet the new Editor. On this page you can see it in action — try to edit this text.\"\n      }\n    }\n  ]\n}\n```\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  editorjs \"github.com/micheleriva/editorjs-go\"\n\t\"io/ioutil\"\n\t\"log\"\n)\n\nfunc main() {\n  myJSON, err := ioutil.ReadFile(\"./editorjs_output.json\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n  }\n  \n  resultMarkdown := editorjs.Markdown(string(data))\n  resultHTML := editorjs.HTML(string(data))\n\n  fmt.Println(\"=== MARKDOWN ===\\n\")\n  fmt.Println(resultMarkdown)\n\n  fmt.Println(\"=== HTML ===\\n\")\n  fmt.Println(resultHTML)\n}\n```\n\nIt will generate the following output:\n\n```\n=== MARKDOWN ===\"\n\n## Editor.js\n\nHey. Meet the new Editor. On this page you can see it in action — try to edit this text.\n\n=== HTML ===\n\n\u003ch2\u003e Editor.js \u003c/h2\u003e\n\u003cp\u003eHey. Meet the new Editor. On this page you can see it in action — try to edit this text.\u003c/p\u003e\n```\n\n## License\n[GPLv3](/LICENSE.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicheleriva%2Feditorjs-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicheleriva%2Feditorjs-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicheleriva%2Feditorjs-go/lists"}