dashbitco / nimble_options

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

Fix formatting of lists #93

Closed josevalim closed 2 years ago

josevalim commented 2 years ago

Lists were not correctly indented before, which means that if you wanted to add multiline content inside the docs, it would not be formatted properly and the default would also be out of place. For example:

doc: """
Options are:

  * :foo
  * :bar
""", default: :foo

Would either not indent or add the default line wrongly:

Options are:

  * :foo
  * :bar The default value is :bar.

This PR fixes it so lists are naturally indented and the nest_level hack is no longer necessary. We also remove types printing in complex cases, because it ends up verbose and/or showing duplicate information.