MerX is a web-based tool that allows you to render diagrams from Mermaid syntax and export them as PNG or SVG files. It provides a simple and intuitive interface for quickly visualizing and sharing your Mermaid diagrams.
- Live Mermaid Rendering: Input your Mermaid code and see the diagram render in real-time.
- Export to PNG: Download your diagram as a high-quality PNG image.
- Export to SVG: Download your diagram as a scalable SVG vector graphic.
- Interactive Preview: View your diagram in a modal with zoom-in and zoom-out capabilities.
- Responsive Interface: The application is designed to work seamlessly across different screen sizes.
- Error Handling: Provides feedback for invalid Mermaid syntax.
- HTML
- CSS (Tailwind CSS)
- JavaScript
- Mermaid.js (v10)
- Open
default.htmlin your web browser., or try https://ixim.com.cn/merx directly. - Enter Mermaid Syntax: Type or paste your Mermaid diagram code into the input text area on the left.
- Generate Diagram: Click the "生成图表" (Generate Diagram) button.
- View Diagram: The rendered diagram will appear in the panel on the right.
- Export:
- Click "导出 PNG" (Export PNG) to download the diagram as a PNG file.
- Click "导出 SVG" (Export SVG) to download the diagram as an SVG file.
- Preview: Click on the rendered diagram to open it in a larger preview modal. Use the "+" and "-" buttons or mouse wheel to zoom.
This project primarily uses client-side technologies and does not require a complex build process for its core functionality.
- Clone the repository (if applicable).
- Ensure you have a modern web browser.
- Tailwind CSS (Optional - for development):
- If you want to modify styles and use Tailwind CSS, you'll need Node.js and npm installed.
- Install dependencies:
npm install
- To compile Tailwind CSS during development (watch for changes):
npx tailwindcss -i ./src/input.css -o ./main.css --watch
- To build Tailwind CSS for production:
npx tailwindcss -i ./src/input.css -o ./main.css --minify
- The
main.cssfile is already included, so you can rundefault.htmldirectly without needing to compile Tailwind unless you make style changes.
default.html: The main HTML file for the application.main.css: Compiled Tailwind CSS styles.src/input.css: Source CSS file for Tailwind processing.tailwind.config.js: Configuration file for Tailwind CSS.package.json: Lists development dependencies (Tailwind CSS)..gitignore: Specifies intentionally untracked files for Git.README.md: This file.