Hey, I am developing JavaDoc for our Android proje...
# dokka
s
Hey, I am developing JavaDoc for our Android project using Dokka.
Copy code
dependencies {
    dokkaJavadocPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.4.10.2")
}
Copy code
dokkaJavadoc.configure {
    dokkaSourceSets {
        named("main") {
            noAndroidSdkLink.set(false)
        }
    }
}
But I am facing problem when I add a class name from another package. Here is one example - Clicked Url should be:
dokka/javadoc/com/nativewaves/livesdk/root/NWLive.html
but the url is:
dokka/javadoc/com/nativewaves/livesdk/ui/com/nativewaves/livesdk/root/NWLive.html
and also when I use like -
Copy code
/**
 * @see [BaseViewModel.selectedAudioEntityId]
 */
and in the JavaDoc, there is no content. It just blank in the description column. But in DokkaHtml, it’s working. Thanks…
m
What do you mean by saying
add a class name from another package
? As for the
@see
tag: dokka doesn't render some of the tags in javadoc format. As those tags are processed and are available in the model adding those wouldn't be hard. If you have some spare time we would be extremely grateful for a PR ☺️
s
I meant to say regarding the package, like I am calling a class
com.nativewaves.livesdk.root.NwLive
from
com.nativewaves.livesdk.ui.football.FootballPlaybackHandler
in the doc. I am directly, sharing the comments -
Copy code
/**
 * [FootballPlaybackHandler] interface contains all the LiveData instances and functions
 * It will directly communicate with [FootballPlaybackActivity] and [NWLive] to update the UI.
 */
Here [NWLive] is from another package/folder In the JavaDoc, when I click the NwLive, it shows 404 with a wrong URL.
Regarding the PR, sure, it would be awesome. 😄 I am not familiar but I want to try this. 😄 Thanks for offering this. I will try.
m
Oh i see I managed to reproduce the issue and will work on it
s
Hey, I fork and cloned the Dokka, can you help on this? I really want to contribute 🙂 as the CONTRIBUTING.md said, I built using
./gradlew publishToMavenLocal
Thanks 🙂
m
By using this command you have published dokka artefacts to your local maven repository. Now you can run this snapshot build on your project. This build will have a version that is
<dokka-version>-SNAPSHOT
right now the dokka version is 1.4.20, so the version should be
1.4.20-SNAPSHOT
. Please remember to have
mavenLocal()
in your repositories. I'd start by looking at the model of DocTag-s as they are an abstract representation of documentation. Later it will be nice to see how javadoc is rendered (start with
JavadocPlugin
and
org.jetbrains.dokka.javadoc.renderer
package. After that you should have a basic understanding of how dokka renders javadoc so adding a tag to be rendered is a matter of transforming DocTags to ContentNodes (see
JavadocPageCreator
) and rendering it in Korte templates. It is fine to be confused at first. We have a documentation about the model: https://kotlin.github.io/dokka/1.4.20/developer_guide/introduction/ And if you have more questions, I am here to help
K 1
s
Thanks. I will check.
m
I think that this is fixing your issue with cross package linking: https://github.com/Kotlin/dokka/pull/1659 IMHO you need to use a fully qualified name to reference the element from other package since there is no way we can resolve those (imagine 2 classes with same names but in different packages, we have no way of knowing where to link only by a class name)
s
Thank you for this.
Can you please give me a brief so that it make more easy to understand? 🙂 If there get any free time for a small video chat, like 30 - 45 mins
m
I wouldn't like to have this knowledge passed in a 1 on 1 fashion simply because many people will probably have same doubts as you, so it is more efficient to just leave them answers and by keeping it written it is easier for me to update the docs afterwards.