https://kotlinlang.org logo
#dokka
Title
g

Gabriel Feo

01/03/2023, 7:50 PM
Hey, is there a way to have Dokka display all function parameters on separate lines, even if just one param? i.e. this
Copy code
abstract fun getBuild(
  id: String,
  availabilityWaitTimeoutSecs: Int? = null
): Call<Build>
instead of how it's in the image
1
i

Ignat Beresnev

01/03/2023, 7:57 PM
Hi! Your case is quite interesting as I believe Dokka should've added line breaks here Is this API reference public? Can you link to it?
It does break line when there's many parameters, such as in
getBuilds
(same page), but not when there's 1 or 2
i

Ignat Beresnev

01/03/2023, 8:04 PM
Oh, sorry, that's an older version of Dokka, it indeed had hardcoded logic about adding line breaks when there are >=3 params Can you update to 1.7.20? Starting from this version, it calculates the width of the signature and, if it doesn't fit on your screen in one line, adds line breaks automatically, even if it's only one parameter
If it's not possible right now or too difficult/etc, I can suggest a quick and dirty solution until you do update 🙂
g

Gabriel Feo

01/03/2023, 8:11 PM
It works great in 1.7.20 and also detects dark mode now. My bad for not checking the Kotlin version first. Thank you for your help and good work! 🙂
👍 1
i

Ignat Beresnev

01/03/2023, 8:12 PM
Awesome, I'm glad it helped 🙂 1.7.20 has many neat UI improvements, hopefully it was worth the upgrade!
👍 1
3 Views