{"id":13769744,"url":"https://github.com/naduma/editorjs-mermaid","last_synced_at":"2025-05-11T02:33:20.184Z","repository":{"id":46236013,"uuid":"513969427","full_name":"naduma/editorjs-mermaid","owner":"naduma","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-15T16:27:16.000Z","size":462,"stargazers_count":22,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-27T19:45:58.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naduma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-14T16:18:20.000Z","updated_at":"2025-04-02T23:07:50.000Z","dependencies_parsed_at":"2022-09-03T22:51:30.306Z","dependency_job_id":null,"html_url":"https://github.com/naduma/editorjs-mermaid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naduma%2Feditorjs-mermaid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naduma%2Feditorjs-mermaid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naduma%2Feditorjs-mermaid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naduma%2Feditorjs-mermaid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naduma","download_url":"https://codeload.github.com/naduma/editorjs-mermaid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253507202,"owners_count":21919172,"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-03T17:00:31.133Z","updated_at":"2025-05-11T02:33:19.853Z","avatar_url":"https://github.com/naduma.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":["Block Tools"],"readme":"# Mermaid Tool\n\n![Version of EditorJS that the plugin is compatible with](https://badgen.net/badge/Editor.js/v2.0/blue)\n\nProvides [Mermaid](http://mermaid-js.github.io/mermaid/) Blocks for the [Editor.js](https://ifmo.su/editor).\n\n## Installation\n\n### Install via NPM\n\nGet the package\n\n```shell\nnpm i --save editorjs-mermaid\n```\n\nInclude module at your application\n\n```javascript\nconst MermaidTool = require('editorjs-mermaid');\n```\n\n### Download to your project's source dir\n\n1. Upload folder `dist` from repository\n2. Add `dist/bundle.js` file to your page.\n\n### Load from CDN\n\nYou can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@editorjs/header).\n\n`https://cdn.jsdelivr.net/npm/editorjs-mermaid@latest`\n\nThen require this script on page with Editor.js through the `\u003cscript src=\"\"\u003e\u003c/script\u003e` tag.\n\n## Usage\n\nAdd a new Tool to the `tools` property of the Editor.js initial config.\n\nIf you want to configure mermaid, use the `onReady` property of Editor.js.\n\n```javascript\nvar editor = EditorJS({\n  ...\n\n  tools: {\n    ...\n    mermaid: MermaidTool,\n  },\n\n  ...\n\n  onReady: () =\u003e {\n    MermaidTool.config({ 'theme': 'neutral' })\n  }\n\n  ...\n});\n```\n\n## Output data\n\n| Field   | Type     | Description        |\n| ------- | -------- | ------------------ |\n| caption | `string` | caption            |\n| code    | `string` | mermaid code       |\n\n```json\n{\n  \"type\": \"header\",\n  \"data\": {\n    \"caption\": \"flowchart sample\",\n    \"code\": \"flowchart LR\\nA--\u003eB\"\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaduma%2Feditorjs-mermaid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaduma%2Feditorjs-mermaid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaduma%2Feditorjs-mermaid/lists"}