Update readme and clean up
This commit is contained in:
parent
6a3157762a
commit
435d555394
17 changed files with 320 additions and 486 deletions
11
demo/main/binding.md
Normal file
11
demo/main/binding.md
Normal 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!
|
|
@ -1,3 +0,0 @@
|
|||
markdownKey: description
|
||||
processors:
|
||||
- ./processors/scream.js
|
13
demo/main/processors/announce-slam-dunks.js
Normal file
13
demo/main/processors/announce-slam-dunks.js
Normal 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;
|
||||
};
|
|
@ -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 = {
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
slamDunks = 100
|
||||
player = "Flynn"
|
||||
dunkaroos = 100
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue