Open jbartok opened 2 months ago
The kdoc spec for see tags https://kotlinlang.org/docs/kotlin-doc.html#see-identifier says that it only supports links to classes and methods, not URL literals.
I think kdoc should have parity with javadoc (https://docs.oracle.com/en/java/javase/19/docs/specs/javadoc/doc-comment-spec.html#see), which it sounds like it already may in dokka--I think that kdoc spec page should be updated.
Hey, thanks for reporting this! During the investigation if it's possible to somehow easy fix it I found several inconsistencies in behaviour of Dokka with KDoc and JavaDoc @see
tag:
KDoc:
@see identifier
: Adds a link to the specified class or method to the See also
block of the documentation.@see identifier text
and @see[indetifier] text
where identifier
is DRI (link to declaration)
@see identifier
(what is said in docs) and, for some reason, supports links in a JavaDoc format...JavaDoc:
"
)<a href="...">Label</>
- external link (identified by opening angle bracket char <
)Type#function label
- a.k.a DRI with optional label which should replace Type#function
in html label for the link"
(quote) symbolsType
if it's a link to a functionlabel
alongside the link, not replacing the name@see
tags because they have the same Type
but different functionName
Dokka implementation details:
See also
as a table with 2 fields in a row: identifier and text@see
tag for both KDoc and JavaDoc, but is KDoc specific and supports only identifier
as DRIPossible solutions:
externalAddress: String?
and fill it only in case of JavaDoc - then we will need to parse this mini html of a link in javadoc to get the label
and the link
DocTag
and then it will be displayed not in the normal way on the left - but on the right. If we will add additional logic to show it on the left, we may possible support even more undefined behaviours
in this regard@see
tag for both KDoc and JavaDoc consistently in future during KDoc spec design refinements (which are currently started to be real, e.g https://github.com/Kotlin/KEEP/issues/385)Keeping in mind all this, we don't really want to introduce any more fragile ad-hoc solutions with no clear specification of how it should work having in mind that we have other more important issues to resolve even with Kotlin-only sources with bigger impact. So we would like to stick with the solution number three. Hope this is understandable.
Describe the bug Following line is not interpreted correctly when in Javadoc in a Java file. Works however properly in Javadoc in Kotlin files:
See example here (at the end of the class documentation, after the "See also: Provider Factory" part), generated from these sources.
Screenshots
Dokka configuration Generation done via the Dokkatoo plugin
2.3.1
, based on Dokka1.9.20
.