5

As part of building my project, I am looking to have Dokka's maven plugin build a markdown wiki that I can deploy to github without modification. I have no problem building the markdown, and viewing the documentation through intellij, but I am hoping to host it directly in my project's github wiki. If anyone has any ideas how to do this, that would be great.

This is my current Dokka configuration

        <plugin>
            <groupId>org.jetbrains.dokka</groupId>
            <artifactId>dokka-maven-plugin</artifactId>
            <version>0.9.16</version>
            <executions>
                <execution>
                    <phase>pre-site</phase>
                    <goals>
                        <goal>dokka</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <!-- Set to true to skip dokka task, default: false -->
                <skip>false</skip>

                <outputFormat>gfm</outputFormat>

                <!-- Default: ${project.basedir}/target/dokka -->
                <outputDir>${project.basedir}/docs/privateurl</outputDir>

                <!-- Use default or set to custom path to cache directory to enable package-list caching. -->
                <!-- When set to default, caches stored in $USER_HOME/.cache/dokka -->
                <cacheRoot>default</cacheRoot>

                <!-- List of '.md' files with package and module docs -->
                <!-- http://kotlinlang.org/docs/reference/kotlin-doc.html#module-and-package-documentation -->
                <includes>
                    <file>packages.md</file>
                    <file>extra.md</file>
                </includes>

                <!-- Used for linking to JDK, default: 6 -->
                <jdkVersion>8</jdkVersion>

                <!-- Do not output deprecated members, applies globally, can be overridden by packageOptions -->
                <skipDeprecated>true</skipDeprecated>

                <!-- Emit warnings about not documented members, applies globally, also can be overridden by packageOptions -->
                <reportNotDocumented>false</reportNotDocumented>
                <!-- Do not create index pages for empty packages -->
                <skipEmptyPackages>true</skipEmptyPackages>

                <!-- See platforms section of documentation -->
                <impliedPlatforms>
                    <platform>JVM</platform>
                </impliedPlatforms>

                <!-- Short form list of sourceRoots, by default, set to ${project.compileSourceRoots} -->
                <sourceDirectories>
                    <dir>src/main</dir>
                </sourceDirectories>

                <!-- Specifies the location of the project source code on the Web. If provided, Dokka generates "source" links
                     for each declaration. -->
                <sourceLinks>
                    <link>
                        <!-- Source directory -->
                        <dir>${project.basedir}/src/main</dir>
                        <!-- URL showing where the source code can be accessed through the web browser -->
                        <url>https://github.com/privateurl</url>
                        <!--Suffix which is used to append the line number to the URL. Use #L for GitHub -->
                        <urlSuffix>#L</urlSuffix>
                    </link>
                </sourceLinks>

                <!-- No default documentation link to kotlin-stdlib -->
                <noStdlibLink>true</noStdlibLink>
            </configuration>
        </plugin>

1 Answers1

0

This tells dokka to generate md files instead of HTML:

<outputFormat>markdown</outputFormat>

And then you can push the results to github.

kocka
  • 657
  • 6
  • 14
  • 3
    Yeah, I had it set to `gfm` currently, which is github flavored markdown. But it doesn't result in a wiki that you can really browse based on the link structure, and that it creates individual markdown files for each function – Mackenzie Bligh Mar 16 '18 at 02:01