Skip to content

Linking to a package in Javadoc using @see renders weirdly #3004

@nea89o

Description

@nea89o

Describe the bug
I have a java file, which in the Javadoc for the containing file contains an @see other.package directive.
This directive is parsed by Dokka and generates a "See also" section, however the content of that section are not a link, and are also broken into two separate lines. Similarly the @link directive gets ignored / turned into a regular non-link text segment.

Expected behaviour
I would expect the contents of the see also section to contain a clickable link to the package content overview for that package, and to not break apart the package name.

Screenshots
image

To Reproduce
ConfigAccordionId.java from the screenshot:

package io.github.moulberry.moulconfig.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 *
 * Test link: {@link io.github.moulberry.moulconfig.test}. End of link.
 *
 * @see io.github.moulberry.moulconfig.test
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Deprecated
public @interface ConfigAccordionId {
	int id();
}

Dokka configuration
Configuration of dokka used to reproduce the bug

// Plugin: 
id("org.jetbrains.dokka") version "1.8.10"

// Task config: 
tasks.dokkaHtml {
    dokkaSourceSets {
        create("main") {
            moduleName.set("MoulConfig")
            sourceRoots.from(sourceSet.main.get().allSource)
            classpath.from(tasks.compileJava.get().classpath)

            includes.from(fileTree("docs") { include("*.md") })

            sourceLink {
                localDirectory.set(file("src/main/"))
                remoteUrl.set(URL("https://github.com/NotEnoughUpdates/MoulConfig/blob/$hash/src/main/"))
                remoteLineSuffix.set("#L")
            }
        }
    }
}

Installation

  • Operating system: Linux
  • Build tool: Gradle v7.5
  • Dokka version: 1.8.10

Additional context
I've had similar problems linking to a package overview from a markdown file using

See the [annotations](io.github.moulberry.moulconfig.annotations) documentation

Are you willing to provide a PR?
Sure

Metadata

Metadata

Assignees

Labels

bugkdoc-specAn issue that requires clarification from the KDoc spec's perspectivelanguage: JavaIssue/PR related to the Java language feature/analysis/docs

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions