Gelin Luo
Gelin Luo

Reputation: 14373

dokka mess up markdown in javadoc

I am trying to find a way to enable me to use markdown in the Javadoc of my java source code. I tried markdown-doclet, and it works perfectly previously. However, it stops working after java 8, e.g. java 11.

I want to give dokka a try. It generates Javadoc or HTML successfully, however, the doc it generated messed up with the markdown content in my original Javadoc.

E.g.

Original javadoc in my source code:

    /**
     * The `UNKNOWN` version instance.
     *
     * This is used when a certain library/app does not have
     * `.version` file defined.
     *
     * The `UNKNOWN` is constructed with
     *
     * - empty string for {@link #getPackageName()}
     * - {@link #UNKNOWN_STR} for {@link #getArtifactId()} and {@link #getProjectVersion()}
     * - `null` for {@link #getBuildNumber()}
     */

content generated by dokka:

The `UNKNOWN` version instance. This is used when a certain library/app does not have `.version` file defined. The `UNKNOWN` is constructed with - empty string for getPackageName - UNKNOWN_STR for getArtifactId and getProjectVersion - `null` for getBuildNumber

My configurations for Dokka in pom.xml:

  <profiles>
    <profile>
      <id>dokka</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jetbrains.dokka</groupId>
            <artifactId>dokka-maven-plugin</artifactId>
            <configuration>
              <jdkVersion>8</jdkVersion>
              <!-- Short form list of sourceRoots, by default, set to ${project.compileSourceRoots} -->
              <sourceDirectories>
                <dir>src/main/java</dir>
              </sourceDirectories>
            </configuration>
            <executions>
              <execution>
                <id>attach-dokka-artifacts</id>
                <phase>install</phase>
                <goals>
                  <goal>dokka</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

the command line used to generate the doc:

mvn clean install -P dokka

Upvotes: 1

Views: 294

Answers (0)

Related Questions