{"id":26140500,"url":"https://github.com/quochung-cyou/editorjs-mathcyou","last_synced_at":"2026-05-19T06:01:42.831Z","repository":{"id":281491148,"uuid":"945436714","full_name":"quochung-cyou/editorjs-mathcyou","owner":"quochung-cyou","description":"A plugin for Editor.js that adds support for LaTeX math formulas, both inline and as blocks.","archived":false,"fork":false,"pushed_at":"2025-03-09T12:47:46.000Z","size":247,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T10:54:55.598Z","etag":null,"topics":["block","editor","editorjs","equation","formula","inline","katex","latex","math"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/editorjs-mathcyou","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quochung-cyou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-09T12:24:57.000Z","updated_at":"2025-05-20T15:14:47.000Z","dependencies_parsed_at":"2025-03-09T13:43:15.711Z","dependency_job_id":null,"html_url":"https://github.com/quochung-cyou/editorjs-mathcyou","commit_stats":null,"previous_names":["quochung-cyou/editorjs-mathcyou"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quochung-cyou/editorjs-mathcyou","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochung-cyou%2Feditorjs-mathcyou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochung-cyou%2Feditorjs-mathcyou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochung-cyou%2Feditorjs-mathcyou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochung-cyou%2Feditorjs-mathcyou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quochung-cyou","download_url":"https://codeload.github.com/quochung-cyou/editorjs-mathcyou/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochung-cyou%2Feditorjs-mathcyou/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265363261,"owners_count":23753300,"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":["block","editor","editorjs","equation","formula","inline","katex","latex","math"],"created_at":"2025-03-11T02:53:57.066Z","updated_at":"2026-05-19T06:01:42.748Z","avatar_url":"https://github.com/quochung-cyou.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EditorJS MathCyou\n\nA plugin for Editor.js that adds support for LaTeX math formulas, both inline and as blocks.\n\nDemo: https://chatchit-dc6fa.web.app/\n\n![alt text](image.png)\n\n## Features\n\n- **Inline Math Tool**: Add LaTeX equations within your text\n- **Math Block Tool**: Add standalone LaTeX equations as blocks\n- **KaTeX Integration**: Uses KaTeX for fast and beautiful math rendering\n- **Custom Parser**: Helper function to parse the editor's output into a structured format\n- **Lightweight**: Minimal dependencies, just EditorJS and KaTeX\n\n## Installation\n\n```bash\nnpm install editorjs-mathcyou\n```\n\nOr using yarn:\n\n```bash\nyarn add editorjs-mathcyou\n```\n\n## Requirements\n\n- Editor.js v2.20 or higher\n- KaTeX v0.13.0 or higher\n\nFor Static Build and using WebPack/Vite/... you may need to do\n\n```javascript\nimport katex from 'katex'\nwindow.katex = katex\n```\n\n## Usage\n\n### Basic Setup\n\n```javascript\nimport EditorJS from '@editorjs/editorjs';\nimport { InlineMathTool, MathBlockTool, parseEditorOutput } from 'editorjs-mathcyou';\nimport katex from 'katex';\nimport 'katex/dist/katex.min.css';\n\nconst editor = new EditorJS({\n  holder: 'editorjs',\n  tools: {\n    paragraph: {\n      class: Paragraph,\n      inlineToolbar: true\n    },\n    inlineMath: {\n      class: InlineMathTool\n    },\n    mathBlock: {\n      class: MathBlockTool\n    }\n  },\n  // ...\n});\n\n// To save and parse the content\nconst saveButton = document.getElementById('save-button');\nsaveButton.addEventListener('click', async () =\u003e {\n  const savedData = await editor.save();\n  const parsedData = parseEditorOutput(savedData.blocks);\n  console.log('Parsed data:', parsedData);\n});\n```\n\n### Adding Styles\n\nAdd the following CSS to your project:\n\n```css\n.math-block-wrapper {\n  margin: 15px 0;\n  padding: 10px;\n  background-color: #f8f8f8;\n  border-radius: 5px;\n}\n\n.math-block-preview {\n  display: flex;\n  justify-content: center;\n  padding: 15px 0;\n  overflow-x: auto;\n}\n\n.math-block-input {\n  width: 100%;\n  padding: 8px;\n  font-family: monospace;\n  border: 1px solid #ddd;\n  border-radius: 3px;\n  min-height: 60px;\n}\n\n.inline-math {\n  display: inline-block;\n  cursor: pointer;\n  padding: 0 2px;\n  background-color: rgba(74, 144, 226, 0.1);\n  border-radius: 3px;\n}\n```\n\nOr use the included utility function:\n\n```javascript\nimport { getStyles } from 'editorjs-mathcyou';\n\n// Add styles programmatically\nconst styleElement = document.createElement('style');\nstyleElement.textContent = getStyles();\ndocument.head.appendChild(styleElement);\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquochung-cyou%2Feditorjs-mathcyou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquochung-cyou%2Feditorjs-mathcyou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquochung-cyou%2Feditorjs-mathcyou/lists"}