-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format docstrings #120
Comments
(Autoformatting can be done by JuliaFormatter's functions, e.g. https://domluna.github.io/JuliaFormatter.jl/stable/api/#JuliaFormatter.format_text-Tuple{AbstractString} ) |
I think this would be great. We could probably check for the length of the single line docstring and then make it multiline if it's longer than some number of characters? |
Yes, just breaking the thing to lines would in my opinion solve the majority of the problematic the use-cases. Instead of f(a, b, c, d) write, in case line width can't fit length of the signature + indent, f(
a,
b,
c,
d,
) There might be cases where this still breaks, such as when people have long typenames or very long default values (e.g. functions with begin/end), but these would really require JuliaFormatter to be taken care of properly. Possible example of what not to care about: fn(
test::LongNamedAbstractThingInterface{AbstractLongNamedThingInterfaceProbablyContentIdontKnow},
test2 = (p1,p2,p3) -> begin do_this(p1); also_now_do_that(p2); and_finally_do_something_more(p3) end,
) |
I started working on this here. Basically, I modified |
Is there a way to generate formatted docstrings using
DocStringExtensions.jl
? For example, in a package we are currently developing our docstrings are defined like this:but we would like to make use of
DocStringExtentions.jl
like this:However, the generated docstrings look like this:
which makes it difficult to read. It would be great if we could format them somehow. Is there functionality for this?
The text was updated successfully, but these errors were encountered: