{"id":22477164,"url":"https://github.com/mathedu4all/mmarked","last_synced_at":"2025-08-02T13:30:50.904Z","repository":{"id":255445411,"uuid":"852095242","full_name":"mathedu4all/mmarked","owner":"mathedu4all","description":"A Typescript library for rendering customized markdown syntax and providing tex2svg for server-side rendering.","archived":false,"fork":false,"pushed_at":"2024-11-11T12:33:38.000Z","size":6128,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-28T06:41:49.712Z","etag":null,"topics":["highlightjs","markdown","markedjs","mathjax"],"latest_commit_sha":null,"homepage":"https://lab.mathcrowd.cn/mmarked","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathedu4all.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-04T08:06:12.000Z","updated_at":"2024-11-13T13:59:37.000Z","dependencies_parsed_at":"2024-10-28T06:39:43.405Z","dependency_job_id":null,"html_url":"https://github.com/mathedu4all/mmarked","commit_stats":null,"previous_names":["mathedu4all/mathcrowd-marked-lib"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathedu4all%2Fmmarked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathedu4all%2Fmmarked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathedu4all%2Fmmarked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathedu4all%2Fmmarked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathedu4all","download_url":"https://codeload.github.com/mathedu4all/mmarked/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228476049,"owners_count":17926134,"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":["highlightjs","markdown","markedjs","mathjax"],"created_at":"2024-12-06T14:09:41.869Z","updated_at":"2025-08-02T13:30:50.891Z","avatar_url":"https://github.com/mathedu4all.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# mmarked\n\n[![npm version](https://badge.fury.io/js/%40mathcrowd%2Fmmarked.svg)](https://badge.fury.io/js/%40mathcrowd%2Fmmarked)\n[![License: Custom](https://img.shields.io/badge/License-Custom-yellow.svg)](https://creativecommons.org/licenses/by-nc/4.0)\n\n![icon.png](./icon.png)\n\n[中文](./README.zh.md)\n\nA powerful TypeScript library for rendering customized markdown syntax with LaTeX support, designed for mathematical visualization in educational contexts.\n\n## 🌟 Features\n\n- ✅ **Full CommonMark syntax support:** Comprehensive compatibility with CommonMark standards\n- 🔢 **Footnotes Blocks:** Support for auto-numbered footnotes with easy reference links\n- 📘 **Theorem-like blocks:** Support for mathematical theorems, lemmas, and examples in a block format with titles, auto-numbering, and reference links\n- 🖼️ **Image resizing capabilities:** Customizable rendering of images and videos using simple syntax\n- 🔍 **Hidden/Show solution blocks:** Solution blocks with toggle buttons for easy visibility control, implemented with straightforward syntax\n- 🧮 **TeX to SVG conversion:** Conversion of TeX equations to scalable vector graphics for high-quality rendering\n- 🔗 **Easy Integration with Existing Systems:** Support for both server-side and browser-side implementations\n\n## 🚀 Quick Start\n\n### Editor Integration\n\nUse mmarked in VSCode: https://marketplace.visualstudio.com/items?itemName=MCLab.mmarked  \n\nUse mmarked in Logseq: https://github.com/mathedu4all/mmarked-logseq-extension\n\n### Server-Side Integration\n\n#### Installation\n\n```bash\nnpm install @mathcrowd/mmarked mathjax-full highlight.js\n```\n\n#### Basic Usage\n\n```typescript\nimport { tex2svg, renderMarkdown } from '@mathcrowd/mmarked'\n\n// Convert TeX to SVG\nconst svg = tex2svg('$x^2$')\n\n// Render Markdown to HTML\nconst html = renderMarkdown('### Heading').parsed\n```\n\n### Browser-Side Integration\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eMarked in the browser\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cdiv id=\"content\"\u003e\u003c/div\u003e\n    \u003cscript src=\"dist/browser.umd.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n        const { tex2svg, renderMarkdown } = marked;\n        document.getElementById('content').innerHTML = \n            tex2svg(renderMarkdown('# Marked in the browser \\n\\n $x^2+y^2=1$ \\n\\nRendered by **mmarked**.').parsed);\n        console.log(renderMarkdown('# Marked in the browser\\n\\nRendered by **mmarked**.').lexed);\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## 📚 API Reference\n\n| Function | Description |\n|----------|-------------|\n| `tex2svg(tex: string): string` | Converts TeX to SVG in HTML format |\n| `renderMarkdown(markdown: string): {parsed: string, lexed: Token[], time: number}` | Renders Markdown to HTML |\n| `renderMarkdownCompact(markdown: string): {parsed: string, lexed: Token[], time: number}` | Renders Markdown to HTML without `\u003cp\u003e` tags |\n\n⚠️ **Important**: Always purify the output HTML using [DOMPurify](https://github.com/cure53/DOMPurify) to prevent XSS attacks.\n\n## 📖 Documentation\n\nFor detailed documentation in Chinese, visit our [Product Page](https://lab.mathcrowd.cn/mmarked).\n\n## 🎮 Demo\n\nTry out our interactive demo [here](https://mathedu4all.github.io/mmarked/).\n\n## 👥 About Mathcrowd\n\nMathcrowd is an innovative startup founded by experienced independent developers and mathematics educators. We're on a mission to revolutionize math education in China through cutting-edge technology. Our goal is to create an engaging online community for math enthusiasts and self-learners, offering rich, interactive, and visualized learning content.\n\n🌐 MCLab Official Website: [https://lab.mathcrowd.cn](https://lab.mathcrowd.cn)  \n🌐 Our Online Math Community: [https://www.mathcrowd.cn](https://www.mathcrowd.cn)  \n💬 Join Our Discord: [https://discord.gg/6VMUVA5Yq2](https://discord.gg/6VMUVA5Yq2)\n\n## 📄 License\n\nSee [LICENSE](./LICENSE.md)\n\nFor commercial use, please contact charles@mathcrowd.cn for licensing details.\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details.\n\n## 📞 Support\n\nFor questions or issues, please [open an issue](https://github.com/mathedu4all/mathcrowd-marked-lib/issues) on our GitHub repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathedu4all%2Fmmarked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathedu4all%2Fmmarked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathedu4all%2Fmmarked/lists"}