Cooklang and SilverBullet

I'm considering taking a stab at integrating https://cooklang.org/ into SilverBullet. Though there's a Lua implementation it hasn't been updated in a couple of years, and there are two more recent implementations in Typescript.

I'm guessing based on what little I know that this would be a good candidate for a plug? Any suggestions on even where I'd begin? Is there a starter plug somewhere I can look at? I'm not even sure which topic is best to post this into, so took a stab at Plug Development.

I'd start by taking a look at some plugs, that's really the best documentation there is. There are the builtin plugs and community plugs. The basic setup shouldn't be too hard I think. It then really depends on what you want to do.
What I could imagine, is that you implement an indexer, which grabs all codeblocks which are recipes, or pages with frontmatter indicating they are recipes, parse them and put them in the index. This for example is the code which indexes space lua blocks.
You could then also implement widgets for rendering. This would be done by exporting a syscall. There are examples of that on here or inside of existing plugs.

Can you elaborate on what you mean by exporting a syscall to render a widget?

I just made a guide about plug development, which may help.

This is exactly what I was looking for, thank you!

I hope you make this happen, I'd be super excited about this integration!

Me too, now I just have to remember how to write code--it's been a while :grinning_face:

I'm realizing that I'm a bit over my head, mainly lack of free time to dedicate to this but also my withering coding skills. I wouldn't be at all offended if someone else takes a crack at this.

@stainless I'm curious what it would have done if you'd been able to build it
It looks like cooklang is sort of an extension of markdown with stuff like @flour{2%cups}?

Were you imagining rendering those @flour{2%cups} bits nicely + a header with ingredients + cook time? Just curious!

I wonder if one could get somewhere just using Syntax syntax.define to render widgets inline for the special bits along with tag tag.transform to index them in order to make an ingredients header... :thinking:

Yes, cooklang is an extension of markdown with recipe specific syntax. I was thinking I'd integrate a cooklang parser (there are several to choose from, including one in lua--though I believe the typescript versions are more robust) to generate the markup. Then you'd "just" need to apply some css to make it pretty.