Gantt TODO Panel
May 24, 2026 Β· View on GitHub
π This document is in English. δΈζηζ¬: readme_zh.md.
Gantt TODO Panel β Trilium Gantt Task Management
Overview
Trilium's built-in todo-list supports task markers (#date, #P1β#P4, #Follow-up, recurring tasks), but there's no visual panel to browse, filter, and track all tasks across notes on a timeline.
This plugin adds a Gantt TODO Panel to Trilium's frontend showcase page. It collects tasks from specified notes, parses the task markers, and presents them in three views:
Tab 1: Gantt Chart
- Visual timeline of all dated tasks using Frappe Gantt
- Toggle between Day / Week / Month / Year views
- Click a bar to navigate to the source note
- Progress bar reflects completion status
- Automatically adapts to Trilium's light/dark theme
- Filter β Filter tasks by source note
- Sort β Sort by priority (highβlow / lowβhigh), start date, end date
- Hide done β Toggle completed tasks visibility

Tab 2: Task List
- Filter β Search tasks by text content
- Sort β Click any column header (#, Status, Content, Note, Priority, Start, End) to sort
- Pagination β Adjustable page size (10/20/30/50/100)
- Checkbox toggle β Check to complete, uncheck to restore
- Completed section β Done tasks shown separately, can be undone
- Note column β Click note title to navigate to the source note

Tab 3: Settings
- Collection Scope β Specify which notes (IDs) to collect tasks from
- Auto-refresh β Automatic data refresh interval
- History Retention β Limit how many recurring task history entries are kept
- Overdue Priority β Toggle overdue-first sorting
Installation
Option 1: Manual File Copy
- Open the note
nlKR1j0QzfmS(Frontend Showcase) in Trilium - Create the following structure under that note:
Gantt TODO (render type)
βββ ~renderNote β GanttTodoTemplate (code, mime: text/html)
βββ GanttTodoBackend (code, mime: application/javascript;env=frontend)
βββ GanttTodoScript (code, mime: application/javascript;env=frontend)
- Copy the contents of
gantt-todo-template.htmlinto the GanttTodoTemplate note - Copy the contents of
gantt-todo-backend.jsinto the GanttTodoBackend note - Copy the contents of
gantt-todo-script.jsinto the GanttTodoScript note - Set the
~renderNoterelation on the Gantt TODO note pointing to GanttTodoTemplate
Option 2: Download ZIP from Releases
Download the latest release archive from GitHub Releases and import it into Trilium via Import β Import from ZIP to automatically create the full note structure.
Usage
- Open the Gantt TODO panel from the frontend showcase (
nlKR1j0QzfmS) - Go to Settings tab
- Enter one or more note IDs in the scope field (separated by spaces) β tasks from these notes and all their descendants will be collected
- Click Save Settings
- Switch to Gantt Chart or Task List to see your tasks
Task Syntax Reference
Tasks in notes use standard Trilium todo-list syntax with markers:
| Syntax | Meaning | Example |
|---|---|---|
#YYYY-MM-DD | Due date (end date) | #2026-05-28 |
#S-YYYY-MM-DD | Start date | #S-2026-05-24 |
#E-YYYY-MM-DD | End date (explicit) | #E-2026-06-01 |
#P1 ~ #P4 | Priority (1 highest, 4 lowest) | #P1 |
#Follow-up | Mark as follow-up | #Follow-up |
#every n day/week/month | Recurring task | #every 1 day |
Example:
- [ ] Write daily report #2026-05-24 #every 1 day #P4
- [ ] Code review #S-2026-05-25 #E-2026-05-29 #P1 #Follow-up
- [ ] Monthly summary #S-2026-05-20 #E-2026-05-30 #P2
When a recurring task is completed, the next occurrence is automatically generated with the updated date. Completed history entries are moved into a nested sub-list under the next occurrence.
Architecture
Note Structure
nlKR1j0QzfmS (Frontend Showcase)
βββ Gantt TODO (render) ββrenderNoteβββ GanttTodoTemplate
βββ GanttTodoTemplate (code/text/html)
βββ GanttTodoBackend (pos 10) β Backend data operations
βββ GanttTodoScript (pos 20) β Frontend UI rendering
Module System
Trilium loads child notes of a render/code note as CommonJS modules. The note title becomes the module name:
// GanttTodoBackend β exports functions
module.exports = { runBackendAction };
// GanttTodoScript β imports sibling module
const { runBackendAction } = GanttTodoBackend;
Child notes are loaded in position order (lower loads first). Position 10 = Backend loads before Position 20 = Script.
Data Flow
User opens panel β init() β cacheDom() β loadTasks()
β runBackendAction('fetchTasks', {rootNoteIds: [...]})
β api.runOnBackend(fn, [action, payload]) β executes on Trilium server
β 1. Walk note tree from each root ID
β 2. For each text note, parse HTML via Cheerio
β 3. Find <ul class="todo-list"> items
β 4. Extract description, parse markers (dates, priority, repeat, follow-up)
β 5. Return structured task objects
β Frontend renders Gantt chart / Task list / Settings
API Usage
| API | Purpose |
|---|---|
api.runOnBackend(callback, args) | Execute backend operations (task collection, completion) |
api.getNote(noteId) | Fetch a note by ID (backend) |
api.dayjs() | Date parsing and formatting (backend) |
api.cheerio.load(html) | Parse note HTML content (backend) |
Buffer.isBuffer(content) | Handle binary note content (backend) |
api.activateNote(noteId) | Navigate to source note on bar/card click |
localStorage | Store settings (frontend) |
api.searchForNotes(query) | Search notes by type (fallback) |
Task Markers Parsing
The backend function parseTaskMeta() extracts structured data from task description text using regex:
- Strip all marker tokens (
#S-date,#E-date,#P1β#P4,#Follow-up,#every n unit) - The remaining text becomes the task display text
- Extracted markers populate
startDate,endDate,priority,followUp,repeatfields
Development
Files
| File | Purpose |
|---|---|
gantt-todo-template.html | HTML template + CSS for the render note |
gantt-todo-backend.js | Backend module (task collection, parsing, completion, repeat) |
gantt-todo-script.js | Frontend module (UI rendering, events, settings) |
readme.md | This file (English) |
readme_zh.md | Chinese documentation |
Dependencies
- Frappe Gantt (v0.6.1) β Loaded from CDN (
cdn.jsdelivr.net) for Gantt chart rendering - Trilium built-ins β
api.dayjs,api.cheerio,api.runOnBackend,api.getNote
Known Issues
- Gantt chart Day/Week views require datetime precision (ISO format with
Tseparator) - Frappe Gantt CDN must be accessible; if blocked by CSP, the chart will show a load error
- The settings "Scope" field is required β empty scope shows an instruction message instead of searching all notes
License
MIT