Update readme and clean up

This commit is contained in:
Endeavorance 2025-04-02 15:41:20 -04:00
parent 6a3157762a
commit 435d555394
17 changed files with 320 additions and 486 deletions

11
demo/main/binding.md Normal file
View file

@ -0,0 +1,11 @@
---
markdownKey: description
options:
dunks:
key: dunkaroos
processors:
- ./processors/scream.js
- ./processors/announce-slam-dunks.js
---
A markdown-powered binding file!

View file

@ -1,3 +0,0 @@
markdownKey: description
processors:
- ./processors/scream.js

View file

@ -0,0 +1,13 @@
export const name = "Announce Slam Dunks";
export const process = (binding, { dunks }) => {
const slamDunkKey = dunks?.key ?? "slamDunks";
for (const entry of binding.entries) {
if (slamDunkKey in entry.data) {
console.log(`Slam dunk!`);
}
}
return binding;
};

View file

@ -1,5 +1,5 @@
export const name = "Scream";
export function process(binding, opts) {
export function process(binding) {
const modifiedEntries = binding.entries.map(entry => {
if (binding.markdownKey in entry.data) {
entry.data = {

View file

@ -1 +1,2 @@
slamDunks = 100
player = "Flynn"
dunkaroos = 100