52 lines
772 B
Markdown
52 lines
772 B
Markdown
# Silverbullet API
|
|
|
|
Should be a thing running beside silverbullet and providing a API a user can interact with that allows them to define a schema for a specific path and then turn that into an api with the docs.
|
|
|
|
|
|
_Recipe Schema_
|
|
```js
|
|
{
|
|
meta: {
|
|
type: "frontmatter"
|
|
}
|
|
title: {
|
|
type: "heading",
|
|
depth: 1
|
|
},
|
|
description: {
|
|
|
|
},
|
|
ingredients: {
|
|
type: "list"
|
|
type: "paragraph",
|
|
}
|
|
}
|
|
```
|
|
|
|
|
|
## TMDB API
|
|
|
|
552674
|
|
https://image.tmdb.org/t/p/original/zl9uqCl5iUSb50sTk2BPzw6bJnU.jpg
|
|
|
|
```ts
|
|
|
|
type Doc = {
|
|
|
|
}
|
|
|
|
const {create,read,update,delete} = createCrud<Doc>({
|
|
convertIdToPath(id:string){
|
|
ctx.getDocument(`Media/movies/`)
|
|
},
|
|
parse(doc:string,ctx){
|
|
|
|
},
|
|
update(id:string, ctx){
|
|
|
|
}
|
|
})
|
|
|
|
const doc = await read("Suspiria");
|
|
|
|
``` |