Skip to main content

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.

ShortcodeDescription
badgeColored status badge from a meta field value
formatFormatted value display (currency, percent, date, filesize, number, duration)
stat-cardCard with label, value, and optional icon
meterHorizontal gauge bar with min/max/value
sparklineInline SVG sparkline from an array meta field
tableHTML table from an array-of-objects meta field
listVertical list from an array meta field
count-badgeBadge showing the count of items in an array meta field
embedInline embed of a resource by ID (image, video, audio, iframe)
imageImage display from a meta field containing a URL or resource ID
barcodeCode 128 barcode SVG from a meta field value
qr-codeQR code SVG from a meta field value or literal string
link-previewCard with title, URL, and optional description from a meta field
json-treeCollapsible JSON tree view of a meta field
bar-chartHorizontal bar chart from an object or array meta field
pie-chartSVG pie chart from an object or array meta field
timeline-chartHorizontal 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.

ShortcodeDescription
sliderRange slider with min/max/step
stepperIncrement/decrement numeric input
star-ratingClickable star rating (1-N)
toggleBoolean on/off switch
multi-selectCheckbox group for selecting multiple values from a list
button-groupSingle-select button row
color-pickerColor input with hex value
tags-inputFree-form tag chips with add/remove
textareaMulti-line text editor
date-pickerDate input
date-rangeStart and end date inputs
status-badgeClickable badge that cycles through defined statuses
progress-inputEditable progress bar (0-100)
key-valueAdd/edit/remove key-value pairs
checklistCheckbox list with add/remove
url-inputURL input with validation and clickable link
markdownMarkdown 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.

ShortcodeDescription
summaryEntity count dashboard (owned resources, notes, and sub-groups)
galleryThumbnail grid of owned image resources with lightbox
progressProgress bar driven by a meta field value
activityTimeline of recently updated owned entities
treeGroup 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 TypeDescription
counterA 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.

FeatureDescription
Page injectionFooter banner controlled by a boolean setting
HooksLogs 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.

ActionDescription
colorizeColorize black and white images
upscaleUpscale image resolution (multiple model options)
restoreRestore and enhance old or damaged photos
editEdit image using a text prompt
vectorizeConvert 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:

  1. Navigate to the plugin management page
  2. 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.