// The list of tools. The sidebar, the home page and the router are all built from it. // // To add a tool: create js/tools/.js exporting mount(el, ctx) (see app.js for ctx), // then add an entry here. A tool owns every path under its `path`, so /paste/abc123 // goes to the paste tool with ctx.rest = "abc123". // // Optional fields: // opensPaste: true the tool loads ?paste=; it then appears in a paste's "Open in" menu // badge: () => number a count shown on the tool's nav item (0 hides it); call // window.dispatchEvent(new Event('tools:badges')) when it changes import { unreadCount } from './tools/paste-state.js'; export const TOOLS = [ { id: 'markdown', name: 'Markdown', path: '/markdown', category: 'Text', icon: 'M↓', description: 'Write Markdown with a live preview: side by side, editor only or full-page preview.', opensPaste: true, load: () => import('./tools/markdown.js'), }, { id: 'syntax', name: 'Syntax Highlighting', path: '/syntax', category: 'Code', icon: '', description: 'Highlight and format source code with VS Code and Android Studio themes, then copy it as rich text or RTF.', opensPaste: true, load: () => import('./tools/syntax.js'), }, { id: 'json', name: 'JSON editor', path: '/json', category: 'Data', icon: '{ }', description: 'Validate, prettify and compact JSON, with a live tree view you can edit.', opensPaste: true, load: () => import('./tools/json.js'), }, { id: 'paste', name: 'Pastebin', path: '/paste', category: 'Sharing', icon: '⎘', description: 'Share text with a short link. Pastes are deleted after 24 hours.', badge: unreadCount, load: () => import('./tools/paste.js'), }, ]; // Sidebar groups appear in this order; unknown categories go last, alphabetically. export const CATEGORY_ORDER = ['Text', 'Code', 'Data', 'Sharing'];