Sirena Documentation
Welcome to Sirena, a pure Ruby Mermaid diagram rendering library that converts Mermaid syntax into SVG diagrams. Built for server-side rendering, Sirena provides native integration with Ruby applications without requiring Node.js or browser dependencies.
Why Sirena?
Pure Ruby Implementation
-
No Node.js dependencies
-
No Puppeteer/Chrome requirements
-
Simpler deployment in Ruby environments
-
Callable directly from Rails, Jekyll, and any Ruby application (no dedicated integration layer built yet)
No Browser Dependency
-
No headless browser launch required
-
Suitable for serverless environments
-
A dated Apple M2 comparison run and its reproduction commands are published in the Performance Benchmark report; memory was not measured, and the report does not generalize one machine’s timings
Quick Start
# Basic usage
require 'sirena'
svg = Sirena.render(<<~MERMAID)
graph TD
Start --> End
MERMAID
puts svg
See Getting Started Tutorial for complete installation and usage instructions.
Documentation Structure
Core Topics
Compatibility and comparison pages.
Tutorials
Step-by-step guides to help you get started and accomplish specific tasks.
Guides
Installation, quick start and the CLI reference.
Diagram Types
Complete reference for all 24 diagram types with syntax and examples.
Features
Detailed documentation of Sirena’s unique features and capabilities.
References
CLI reference and compatibility lookup.
Supported Diagram Types
Sirena registers 24 diagram types that read Mermaid.js syntax (parity varies by type; see the compatibility page):
| Type | Use Case |
|---|---|
Process flows and directed graphs |
|
Message interactions over time |
|
Object-oriented class structures |
|
State machines and transitions |
|
Database entity relationships |
|
User experience mapping |
|
Repository history visualization |
|
Proportional data visualization |
|
Project timeline planning |
|
Priority/complexity matrices |
|
Requirements traceability |
|
Software architecture (Context, Container, Component, Code) |
|
Hierarchical idea organization |
|
Historical event visualization |
|
Flow quantity visualization |
|
Data point plotting |
|
Component relationships |
|
System architecture views |
|
Workflow board visualization |
|
Multi-dimensional data comparison |
|
Network packet structure |
|
Hierarchical data as nested rectangles |
|
Information display |
|
Error message display |
See the complete Diagram Types Reference for detailed syntax and examples.
Key Features
-
Theme System: YAML-based theming with 4 built-in themes (default, dark, light, high_contrast)
-
Batch Processing: Built-in batch renderer for documentation sets
-
Ruby Integration: Call
Sirena.renderdirectly from Rails, Jekyll, or any Ruby application; no dedicated Rails helpers or Jekyll plugin exist yet -
Parslet Parsing: Grammar-based parsing; parse errors report line and column
-
SVG Output: Scalable vector graphics, self-contained
Compatibility & Comparison
Sirena reads Mermaid.js syntax in a pure Ruby implementation; how much of each type’s real-world input it handles is measured on the compatibility page.
-
Mermaid.js Compatibility - Detailed syntax compatibility matrix
-
Tool Comparison - Compare Sirena with Mermaid.js, PlantUML, and Graphviz
Getting Help
-
Report Issues: GitHub Issues
-
Source Code: GitHub Repository
-
RubyGems: Sirena Gem