Comments (4)
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,
)
from docstringextensions.jl.
I started working on this here. Basically, I modified printmethod
to calculate the length of the method signatures and then break them into multiline format if longer than some threshold (no JuliaFormatter involvement). I will test it out on my packages to see if it looks ugly and then make a PR if not.
from docstringextensions.jl.
(Autoformatting can be done by JuliaFormatter's functions, e.g. https://domluna.github.io/JuliaFormatter.jl/stable/api/#JuliaFormatter.format_text-Tuple{AbstractString} )
from docstringextensions.jl.
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?
from docstringextensions.jl.
Related Issues (20)
- How to use alias of AbstractArray instead of the full name? (Feature request) HOT 2
- Display parametric types in a better way? HOT 2
- Remove documentation page for v0.1
- Update CI badges in the README HOT 2
- TagBot trigger issue HOT 7
- The `TYPES` template does not apply to parametric types
- MODULES key not found for `@template` HOT 1
- Doctest failures
- Considering writing a script to add function signatures to a code base. HOT 5
- Examples of how to use all of the functionality HOT 5
- expected test failure from the incoming `Core.Compiler` changes HOT 3
- Cannot get source for generated functions
- feature request: non-api doc marker HOT 7
- How to show default values and types of keyword arguments? HOT 1
- Update docs to latest version of Documenter HOT 5
- different abbreviations for concrete and abstract types HOT 1
- FUNCTIONNAME inside a function that generates the docstring HOT 7
- Would it be possible to add a TYPEDMETHODLIST abbreviation HOT 2
- Internal errors when (ab)using `@template` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docstringextensions.jl.