outmoded / lout

API documentation generator
Other
276 stars 49 forks source link

Fix: nicely print values with allow and valid #156

Closed joeybaker closed 8 years ago

joeybaker commented 8 years ago

Previously, if you used valid or allow, and only had one value, lout would show just that value. This was very inconvenient if the additional value was null. It looks like the only valid value is null :\

This change get smart about valid and allow, and deals with multiple values.

  1. If you only have one value and use valid, we just show that value. It's the only possibility (this is current behavior).
  2. If you use valid, but have multiple values, we show all of them, but specify that the value "must be one of" the list.
  3. If you use allow and specify one value, we show the type and note that the value "can also be" the additional value.
  4. If you use allow and specify multiple values, we show the type and note that the value "can also be one of" the additional values.
joeybaker commented 8 years ago

@Marsup When you get the time, I'd really appreciate if you looked at this. It fixes a few things that I think are kind of important. Thanks!

Marsup commented 8 years ago

Sorry for the delay, your PR went in at a bad time and I forgot about it, thanks for the reminder and the patch.

joeybaker commented 8 years ago

Thanks!