Node architecture
Custom nodes in Fylepad follow this pattern:Mermaid node
Renders Mermaid diagrams with live preview.Implementation
Features
- Live rendering — Diagrams update as you type (300ms debounce)
- Error handling — Shows error messages for invalid syntax
- Unique IDs — Each diagram gets a random ID for Mermaid rendering
- SVG output — Diagrams render as scalable SVG
Markdown integration
Block menu integration
Mermaid appears in the block menu (/ command):
Input rule
Type:::mermaid to insert:
PlantUML node
Renders PlantUML diagrams using the PlantUML server.Implementation
Features
- Server rendering — Uses PlantUML’s public server for rendering
- Encoding — Encodes PlantUML code using
plantuml-encoder - SVG images — Renders as
<img>with SVG source - Error handling — Catches encoding errors
Input rule
Type:::plantuml to insert:
Math node
Renders KaTeX mathematical expressions.Implementation
Features
- KaTeX rendering — Fast math typesetting
- Display mode — Block-level equations
- Error tolerance —
throwOnError: falseprevents crashes - Live preview — Updates as you type
TabLink node
Creates links between tabs.Implementation
Features
- Tab references — Links store tab ID and title
- Click to navigate — Clicking switches to the linked tab
- Auto-update — Title updates if tab is renamed
- Suggestion menu — Type
@to see tab suggestions
Embed node
Embeds external content (videos, tweets, etc.).Implementation
Features
- iframe embedding — Embeds external content
- URL detection — Auto-detects embeddable URLs
- Responsive — Embeds scale to container width
InnerEditorView
Custom node views use theInnerEditorView helper:
- Editable content area
- Preview area for rendered output
- Update handling
- Selection management
Node storage
Nodes register with extension storage for:Markdown parsing
Block menu
Next steps
TipTap extensions
Overview of all TipTap extensions
Markdown parser
How Markdown parsing works