tmattio / spin

OCaml project generator.
ISC License
297 stars 15 forks source link

Generator documenation #106

Closed joseferben closed 3 years ago

joseferben commented 3 years ago

Hey!

Neat project and DSL, everything works nicely.

I have the initial version of https://github.com/oxidizing/spin-sihl ready and would like to keep the template options simple, but support adding components later on. Are generators covering this use case?

I saw the spin gen GENERATOR feature mentioned in the readme. Is this somewhere documented, in particular how to implement generators? I wasn't able to find implementations in any of the templates.

tmattio commented 3 years ago

Hi @jerben 🙂

Indeed, the DSL ought to be documented properly. There is some documentation here: https://github.com/tmattio/spin/blob/master/doc/template-dsl.md, but it does not document the generator stanza.

If you want an example, you can look into the cli template that provides a cmd generator: https://github.com/tmattio/spin/blob/master/template/cli/spin#L14

tmattio commented 3 years ago

I'm going to remove the generator feature in the next release. I'm not quite happy with it in its current state, so I'll come back to it to implement a better version. I'll also provide a clear documentation when that's ready.

So I'll close this in the meantime, don't hesitate to share feedback on the "previous" generator implementation if you ended up using it, it will be useful when I work on this again 🙂