notemdpro-mermaid-summarizer
NoteMD Pro - Summarize as Mermaid Diagram
Overview
This feature converts markdown document content into a Mermaid mindmap diagram. It uses LLM to analyze the document structure and generate a hierarchical mindmap with summaries and key sentences.
When to Use
- Visual summaries: Create visual mindmaps of documents
- Outline generation: Generate hierarchical structure
- Study aids: Create visual study guides
- Knowledge mapping: Map relationships between ideas
Function Call Chain
summarizeToMermaidCommand (main.ts)
├── read_file(inputPath)
├── getProviderAndModelForTask('summarizeToMermaid')
├── getPromptForTask('summarizeToMermaid')
├── call[Provider]API(prompt, content)
├── saveMermaidSummaryFile(settings, inputPath, mermaidContent)
│ ├── mkdir_p(outputFolderPath)
│ └── write_file(outputPath, content)
└── [Optional] Translate output
Key Functions
summarizeToMermaidCommand (main.ts)
Main command handler for summarization.
saveMermaidSummaryFile (fileUtils.ts)
Saves the generated mermaid content to a file.
export async function saveMermaidSummaryFile(
settings: NotemdSettings,
inputPath: string,
mermaidContent: string,
progressReporter: ProgressReporter,
): Promise<string>;
Settings
Provider Settings
| Setting | Description |
|---|---|
summarizeToMermaidProvider |
LLM provider for summarization |
summarizeToMermaidModel |
Model for summarization |
summarizeToMermaidLanguage |
Language for output |
Contextual Context (Macro Settings)
| Setting | Description |
|---|---|
enableFocusedLearning |
Inject macro user domain preferences globally |
focusedLearningDomain |
The specific domain context (e.g., "Software Architecture") |
Output Settings
| Setting | Description |
|---|---|
useCustomSummarizeToMermaidSuffix |
Use custom filename suffix |
summarizeToMermaidCustomSuffix |
Custom suffix (default: "_summ") |
useCustomSummarizeToMermaidSavePath |
Use custom save path |
summarizeToMermaidSavePath |
Custom save path |
Translation
| Setting | Description |
|---|---|
translateSummarizeToMermaidOutput |
Translate mermaid output |
disableAutoTranslation |
Disable auto-translation |
Prompt Template (summarizeToMermaid)
Full prompt from promptUtils.ts:
You are an AI assistant specializing in text analysis and data visualization.
Your sole task is to act as a processor that converts the user-provided
document into a single, comprehensive Mermaid diagram.
The most important point is: Delete all parentheses.
Parentheses are not allowed in Mermaid diagrams.
Primary Instructions:
- Analyze and Summarize: Read the entire provided document to understand
its structure and identify its primary sections and key ideas.
- Generate Mermaid Diagram Only: Your entire output must be a single
Mermaid code block. Do not include any titles, explanations,
greetings, or any text whatsoever outside of the mermaid ... block.
Critical Syntax Rules for Obsidian Compatibility:
1. Diagram Type: The diagram must begin with the mindmap keyword on the first line.
2. Hierarchy via Indentation: The structure of the mind map is defined
only by indentation. Use a consistent four (4) spaces for each level.
3. Root Node: The first node after the mindmap declaration should be
the root, with its text enclosed in double parentheses: root(("Title")).
4. No List Markers: Never use hyphens (-), double hyphens (--),
asterisks (*), or any other characters to denote list items.
5. Character Replacement: Replace --> with "to" or "implies" to avoid conflicts.
Content and Structure Rules:
- Hierarchical Structure: Mirror the document structure
- Root: Document's title as root node
- Section Branches: Each major section as primary branch
- Section Summary: Maximum 5 summary points per section (max 300 words each)
- Key Sentences: Critical verbatim sentences from each section
Example Output Format:
```mermaid
mindmap
Article Title
Section 1: Title of the First Section
Summary Point 1 for Section 1
Summary Point 2 for Section 1
Key Sentences
Critical sentence from section 1.
Another critical sentence.
Section 2: Title of the Second Section
Summary Point 1 for Section 2
Key Sentences
Critical sentence from section 2.
## Output Example
Input: A document about Machine Learning
Output:
```mermaid
mindmap
Machine Learning
Introduction to ML
Definition and types of machine learning
Supervised vs unsupervised learning
Key Sentences
Machine learning is a subset of artificial intelligence.
Neural Networks
Structure of neurons
Activation functions
Key Sentences
Neural networks are inspired by biological neurons.
Applications
Computer vision
Natural language processing
Key Sentences
ML powers many modern applications.
Integration with Auto-fix
After generating mermaid, the output can be auto-fixed using:
refineMermaidBlocks()- Fix syntax errorscheckMermaidErrors()- Validate syntax
See notemdpro-mermaid-healer for details.
Error Handling
Common Errors
-
Parentheses in content
- Issue: LLM includes parentheses in mermaid
- Solution: Prompt instructs to remove all parentheses
-
Invalid syntax
- Issue: Mermaid syntax errors in output
- Solution: Auto-fix applied, check validation
-
Large documents
- Issue: Content too long for single call
- Solution: Use chunking (if implemented)
Related skills
notemdpro— for broader NoteMD Pro workflow routingnotemdpro-mermaid-healer— to repair generated mindmapsnotemdpro-content-generator— when summary diagrams are part of a larger generation flow
More from zpankz/obsidian-skills
viva-llm
Use VIVA LLM for multi-provider chat, voice calls, terminal integration, assistants, skills, MCP tools, and agent mode inside Obsidian. Trigger when the user mentions VIVA LLM, voice chat, realtime voice, LLM providers in Obsidian, or vault-integrated AI chat.
1obsidian-plugin-accessibility
Use this skill when building or reviewing Obsidian plugin UI for keyboard access, ARIA labels, screen reader support, focus handling, or mobile touch targets. Accessibility is treated as mandatory, not optional.
1tasks
Create and query tasks using the Tasks plugin syntax including due dates, recurrence, priorities, and task queries. Use when the user mentions Tasks plugin, recurring tasks, task queries, or advanced task management in Obsidian.
1dataview
Create Dataview queries using DQL (Dataview Query Language), inline queries, and DataviewJS. Use when the user mentions Dataview, DQL, querying notes, listing notes by metadata, or creating dynamic views of vault content.
1defuddle
Extract clean markdown from web pages using Defuddle CLI, removing clutter to save tokens. Use when the user provides a URL to read or analyze.
1datacore
Create Datacore views using JSX/React syntax and the dc.* API. Use when the user mentions Datacore, dc.useQuery, JSX views, or React-based vault queries. Datacore is the successor to Dataview with better performance and interactive views.
1