Hello, I'm dealing with a huge monorepo that uses ...
# dokka
b
Hello, I'm dealing with a huge monorepo that uses the Buck build system, and I'm trying to generate KDoc for just a tiny sliver of that codebase. I created a 
build.gradle.kts
 specifically for Dokka with a 
sourceSet
 containing just the subdirectory I'm interested in, and it generates documentation, but the problem is that any dependency outside of my 
sourceSet
 is shown as 
<ERROR CLASS>
. Obviously, Dokka can't generate docs for these classes since it can't resolve them, but is there there any way to get these class names to appear as text rather than an error? Ideally, I'd be able to link these classes to a URL containing their source code, but even just getting the raw text name would be a huge improvement. Any suggestions?
Ok, progress -- adding all of the .jars as
dependencies
in
build.gradle
gets rid of the
<ERROR CLASS>
and shows the class names as I wanted. Next question: is there any way to add external links to classes that aren't included in the documentation? That is, if documentation is generated for a class, link to it; otherwise, link to some URL as a fallback?
m
I think adding an external documentation link should do the trick. You need to have a package list and an url to link to:
Copy code
externalDocumentationLink {
                // Root URL of the generated documentation to link with. The trailing slash is required!
                url.set(URL("<https://example.com/docs/>"))

                // If package-list file is located in non-standard location
                // packageListUrl = URL("file:///home/user/localdocs/package-list")
            }
Source: https://kotlin.github.io/dokka/1.4.32/user_guide/gradle/usage/#configuration-options
b
Thanks -- I actually have exactly that block under my
dokkaSourceSets
already, but it doesn't seem to have any effect. Just to confirm: if a class can't be found, it should fallback to the external URL, and all classes should be linked? This is what I'm seeing:
(note the unlinked
Fragment
and
HasDefaultViewModelProviderFactory
)