Closed hayleigh-dot-dev closed 1 year ago
This has been annoying me forever but I never get round to it. Lets get this fixed.
Currently the same function is used in the docs and the formatter to format a function head, I think they should be two functions so we can format them differently. This will be even more useful later when we add links to the type definitions
I find that the way that the documentation generates the type signatures does not match the way code is formatted by
gleam format
. Beyond being a bit triggering, I find it can hurt readability because of how the docs types get rendered.Consider this function from
nibble/pratt
. In the source code it is formatted like so:But in the generated docs it is formatted as...
This is significantly harder to read! It would be great if we just lift the approach taken by
gleam format
and make sure it is also applied to the docs generator.