mermaid-rasterize

Convert mermaid block diagrams in markdown files to PNG images.

206|14|Updated Sep 19, 2021
One-click install
npx skills add https://github.com/JocysCom/FocusLogger --skill mermaid-rasterize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mermaid-rasterize
Source: https://github.com/JocysCom/FocusLogger/tree/main/.agents/skills/mermaid-rasterize
Command: npx skills add https://github.com/JocysCom/FocusLogger --skill mermaid-rasterize

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @mermaid-js/mermaid-cli, puppeteer, and includes scripts (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the issue of mermaid diagrams not rendering in certain viewers, offering a solution to rasterize these diagrams into PNG images for universal compatibility.

Core Features & Use Cases

  • Rasterization: Converts mermaid diagrams within markdown files into PNG images, ensuring they are displayed correctly across platforms and viewers.
  • Trigger Points: Can be triggered when mermaid diagrams fail to render, prompting the user to convert them manually or automatically.
  • Use Case: If you're using GitHub, Notion, or PDFs to share your diagrams, and they don't render properly, this Skill can help ensure they are displayed as intended.

Quick Start

To rasterize mermaid diagrams in your markdown file, use the mermaid-rasterize skill with the command: rasterize diagrams in file 'example.md'.

Frequently Asked Questions about mermaid-rasterize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert mermaid diagrams to PNG images in markdown?

To convert mermaid diagrams to PNG images in markdown, use a rasterization tool that processes mermaid blocks and replaces them with universally compatible PNG image files.

Why are my mermaid diagrams not rendering in GitHub and PDFs?

Mermaid diagrams may not render in GitHub, Notion, or PDFs due to viewer limitations. Rasterizing them into PNG images ensures they are displayed correctly across all platforms.

Do I need puppeteer and mmdc to rasterize mermaid diagrams?

Yes, you need the mmdc command-line tool and puppeteer to rasterize mermaid diagrams, as they handle the headless browser rendering and diagram scaling required for PNG generation.

What is the best way to fix mermaid diagram rendering issues in markdown files?

The best way to fix mermaid rendering issues in markdown is to rasterize the diagrams into PNG images, providing universal compatibility across viewers that fail to render native mermaid blocks.

Does converting mermaid blocks to PNG images work for Notion?

Yes, converting mermaid blocks to PNG images works for Notion, GitHub, and PDFs by replacing native code blocks with rasterized images that display correctly in environments lacking native mermaid support.