This repository hosts the reference sample plugin for RefMD. It demonstrates:
- A minimal Extism backend + ESM frontend
- Commands (
sample.*) that return host-applied effects - Keeping plugin metadata (
author,repository) in the manifest - Provisioning sandbox documents via the
sample.createcommand
GitHub Actions (.github/workflows/build-plugin.yml) builds the plugin and:
- Checks out the repository
- Installs Rust
stablewith thewasm32-wasip1target - Installs Node.js 20 and runs
npm ci && npm run buildto bundle the frontend- The frontend (
frontend/index.mjs) imports@refmdio/plugin-sdk - The build bundles the SDK into a single ESM at
frontend/dist/index.mjs
- The frontend (
- Runs
cargo build --release --target wasm32-wasip1 - Packages
backend/plugin.wasm,frontend/dist/index.mjs(asdist/index.mjs), andplugin.jsoninto a zip named${PLUGIN_ID}-plugin.zip - Uploads that zip as both an Actions artifact and a GitHub Release asset (when
the ref is a tag like
v*)
To install in RefMD:
- Open the Plugins page (
/plugins) - Use “Install from URL” and paste
https://github.com/refmdio/sample-plugin/releases/download/<tag>/sample-plugin.zip
After installation, the toolbar exposes New Sample Document (sample.create).
When invoked, it provisions a demo document marked with meta.isSample = true.
Opening that document routes to /sample/<docId> where the frontend handles
records and markdown rendering.
See docs/overview.md and docs/architecture.md
for a detailed walkthrough.