dokka icon indicating copy to clipboard operation
dokka copied to clipboard

Source links don't seem to work in module.md

Open mikehearn opened this issue 3 years ago • 1 comments

Describe the bug

It's not totally obvious how to link to things in a module when writing module.md. The IDE offers no suggestions and Dokka just seems to render the obvious attempts like [ClassName] or [a.b.c.ClassName] as code.

Expected behaviour

If a hyperlink without a destination is found, dokka should do a best effort match against known identifiers.

mikehearn avatar Jun 04 '22 16:06 mikehearn

Hi! It would be nice if Dokka could resolve such links, but it's not implemented, and I'm not sure it will be in the foreseeable future.

What you're describing can be done by kotlinx-knit, it's used for this particular use case in coroutines and serialization libraries, you can have a look at it for reference. I believe you'd need to enable pathsaver-plugin as well, just as in coroutines and serliaization.

I'll write a tutorial on how to use it in some time, so I've added the tag and will leave this issue be until then

IgnatBeresnev avatar Jun 07 '22 10:06 IgnatBeresnev

Dokka seems to be able to resolve links in module markdown files, like [DisplayLabel](a.b.c.ClassName), but that's all it can do. See here.

For linking to functions and properties I have not found a better way than HTML tags: <a href="./-gradle%20-kotlin%20-d-s-l/org.gradle.api/-project/allprojects.html">allprojects { }</a>

jbartok avatar Mar 30 '23 06:03 jbartok