dashbitco / nimble_options

A tiny library for validating and documenting high-level options. 💽
Apache License 2.0
507 stars 38 forks source link

Use typespecs when possible to document types #91

Closed whatyouhide closed 2 years ago

josevalim commented 2 years ago

I am actually not the biggest fan because I think it makes understanding the options more complex, specially if you are not familar with typespecs.

Maybe we could support NimbleOptions.spec macro though that returns the spec for a given type?

whatyouhide commented 2 years ago

@josevalim the macro is a good idea in and of its own, I'll work on that.

When it comes to the docs, I think this makes it easier because we can express more complex types, with type documentation linked to them, in a bit easier syntax. The non-typespec docs can be verbose. We can think about it for a bit, I'll work on NimbleOptions.spec/1 for now 😉

whatyouhide commented 2 years ago

@josevalim I added the new NimbleOptions.option_type_union/1 function. 👍 Ready for review!

whatyouhide commented 2 years ago

@josevalim ready for another round 😉