Built-in Plugins
Mahresources ships with six plugins in the plugins/ directory. They are not enabled by default. Enable them from the plugin management page or via the API.
The data-views, meta-editors, and widgets plugins register shortcodes for use in custom template fields (CustomHeader, CustomSidebar, CustomSummary, CustomAvatar, CustomMRQLResult) and entity descriptions. Full interactive documentation with live previews is available on each plugin's documentation page after enabling.
data-views
Data visualization shortcodes for rendering metadata values, charts, and tables. All charts use pure HTML/CSS or SVG with no JavaScript dependencies.
| Shortcode | Description |
|---|---|
badge | Colored status badge from a meta field value |
format | Formatted value display (currency, percent, date, filesize, number, duration) |
stat-card | Card with label, value, and optional icon |
meter | Horizontal gauge bar with min/max/value |
sparkline | Inline SVG sparkline from an array meta field |
table | HTML table from an array-of-objects meta field |
list | Vertical list from an array meta field |
count-badge | Badge showing the count of items in an array meta field |
embed | Inline embed of a resource by ID (image, video, audio, iframe) |
image | Image display from a meta field containing a URL or resource ID |
barcode | Code 128 barcode SVG from a meta field value |
qr-code | QR code SVG from a meta field value or literal string |
link-preview | Card with title, URL, and optional description from a meta field |
json-tree | Collapsible JSON tree view of a meta field |
bar-chart | Horizontal bar chart from an object or array meta field |
pie-chart | SVG pie chart from an object or array meta field |
timeline-chart | Horizontal timeline from an array of date-range objects |
Usage: [plugin:data-views:badge path="status"]
meta-editors
Inline editing shortcodes for entity metadata fields. Each shortcode renders an Alpine.js component that saves changes via the editMeta API endpoint. Changes persist immediately without a full page reload.
| Shortcode | Description |
|---|---|
slider | Range slider with min/max/step |
stepper | Increment/decrement numeric input |
star-rating | Clickable star rating (1-N) |
toggle | Boolean on/off switch |
multi-select | Checkbox group for selecting multiple values from a list |
button-group | Single-select button row |
color-picker | Color input with hex value |
tags-input | Free-form tag chips with add/remove |
textarea | Multi-line text editor |
date-picker | Date input |
date-range | Start and end date inputs |
status-badge | Clickable badge that cycles through defined statuses |
progress-input | Editable progress bar (0-100) |
key-value | Add/edit/remove key-value pairs |
checklist | Checkbox list with add/remove |
url-input | URL input with validation and clickable link |
markdown | Markdown text editor with preview |
Usage: [plugin:meta-editors:slider path="rating" min=0 max=10 step=1]
widgets
Dashboard-style shortcodes for category custom templates. These query owned entities to build summaries, galleries, and hierarchy views.
| Shortcode | Description |
|---|---|
summary | Entity count dashboard (owned resources, notes, and sub-groups) |
gallery | Thumbnail grid of owned image resources with lightbox |
progress | Progress bar driven by a meta field value |
activity | Timeline of recently updated owned entities |
tree | Group hierarchy visualization (ancestors and children) |
Usage: [plugin:widgets:summary]
example-blocks
Demonstrates custom plugin block types for the note block editor via mah.block_type().
| Block Type | Description |
|---|---|
counter | A click counter block with label editing and +1 increment |
Usage: Enable the plugin, then add a "Counter" block in the note block editor.
example-plugin
Reference implementation demonstrating the plugin API: injections, hooks, pages, menus, settings, and the database/HTTP/KV APIs. Most API calls are commented out to serve as copy-paste examples.
| Feature | Description |
|---|---|
| Page injection | Footer banner controlled by a boolean setting |
| Hooks | Logs note and resource creation events |
| Custom page | /plugins/example-plugin/info displays the greeting setting |
| Menu item | "Plugin Info" links to the custom page |
fal-ai
AI-powered image processing using fal.ai. Requires a FAL.AI API key configured in plugin settings.
| Action | Description |
|---|---|
colorize | Colorize black and white images |
upscale | Upscale image resolution (multiple model options) |
restore | Restore and enhance old or damaged photos |
edit | Edit image using a text prompt |
vectorize | Convert raster image to SVG |
Also provides a Generate Image page (/plugins/fal-ai/generate) for text-to-image generation.
Enabling a Plugin
Via the UI:
- Navigate to the plugin management page
- Click Enable on the plugin
Via the API:
curl -X POST http://localhost:8181/v1/plugin/enable -d "name=data-views"
Via the CLI:
mr plugin enable data-views
Plugin Documentation Pages
After enabling a plugin, its documentation page shows all registered shortcodes with descriptions, parameters, and live previews using example data. Access it from the plugin management page by clicking the plugin name.