Open lucaswerkmeister opened 10 years ago
I do it manually. The problem with autowrapping is that you would need to be able to distinguish code blocks, which shouldn't be auto-wrapped.
(We could easily do this for anonymous doc strings since they’re special AST nodes, AnonymousAnnotation
s; it would be much harder to detect that the string literal in doc("documentation")
is documentation, so I’d just not do it there.)
The problem with autowrapping is that you would need to be able to distinguish code blocks, which shouldn't be auto-wrapped.
True, we’d start to get into Markdown parsing… indentation is not enough, because in (nested) lists, code blocks need to be indented further. Tricky.
+1
Normally, the formatter doesn’t touch string literals; however, in the case of doc strings, we could wrap them since we know they’re supposed to be Markdown. The wrap length for these should be a separate option from regular code wrapping, since documentation is mostly text, which is easier to read with shorter lines.
@gavinking you often seem to re-wrap documentation when updating it; do you use some kind of utility for that, or do you do it manually?