Is there a way to link to other modules from modul...
# dokka
r
Is there a way to link to other modules from module documentation? I've tried KDoc-style links to the module name (
[my-module]
), relative links to the directory (
[my-module](./my-module)
), and relative HTML links (
[my-module](../my-module/index.html)
), none of which work. The second two are rendered as the link address rather than being links.
👀 1
o
Unfortunately, at this moment, only absolute HTML links will work
a
What about using HTML links? I got
<a href="../../../childProjectA/index.html">Link to module a</a>
working for me
image.png
o
probably? 🙂 Not sure that it is better than absolute links, as at least, absolute links will be clickable in IDE (if it's in kdoc) or on GitHub (if it's in module documentation)
true 1
r
By "absolute HTML links" do you mean something like
[symbols-kotlin-compiler](/symbols-kotlin-compiler/index.html)
? Because that's not working either. Or do you mean an
<a>
element?
My ideal solution would be relative links to the sub-module directories in the project, i.e.
./my-module
, where dokka would figure out if that there is a module included corresponding to that directory and turn it into a link (and error if it can't find one).
o
I mean, really, absolute links like
[core](<https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core>)
My ideal solution would be relative links to the sub-module directories in the project
A better idea might be to support default markdown links to files, and if links point to other module doc, Dokka can replace them during generation (or throw a warning) In this case, both IDEs, GitHub, and Dokka will recognize those links. I haven't found an issue specific to module-to-module links, so it would be nice if you leave your use-case/how/why you will use it: https://github.com/Kotlin/dokka/issues/1863
r
Huh, that (linking to classes from per-module (not multi-module) module docs) works fine for me. Will add the use-case