Reworked support for processing
This commit is contained in:
parent
c1166680a8
commit
6a3157762a
14 changed files with 318 additions and 473 deletions
3
demo/main/binding.yaml
Normal file
3
demo/main/binding.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
markdownKey: description
|
||||
processors:
|
||||
- ./processors/scream.js
|
18
demo/main/processors/scream.js
Normal file
18
demo/main/processors/scream.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
export const name = "Scream";
|
||||
export function process(binding, opts) {
|
||||
const modifiedEntries = binding.entries.map(entry => {
|
||||
if (binding.markdownKey in entry.data) {
|
||||
entry.data = {
|
||||
...entry.data,
|
||||
[binding.markdownKey]: entry.data[binding.markdownKey].toUpperCase()
|
||||
}
|
||||
}
|
||||
|
||||
return entry;
|
||||
});
|
||||
|
||||
return {
|
||||
...binding,
|
||||
entries: modifiedEntries
|
||||
};
|
||||
}
|
1
demo/main/stats/statistics.toml
Normal file
1
demo/main/stats/statistics.toml
Normal file
|
@ -0,0 +1 @@
|
|||
slamDunks = 100
|
5
demo/main/stories/a-neat-story.md
Normal file
5
demo/main/stories/a-neat-story.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
published: true
|
||||
---
|
||||
|
||||
This is a neat story I wrote!
|
Loading…
Add table
Add a link
Reference in a new issue