【问题标题】:How to have Dokka generate a deployable github wiki?如何让 Dokka 生成可部署的 github wiki?
【发布时间】:2018-03-15 05:00:03
【问题描述】:

作为构建我的项目的一部分,我希望让 Dokka 的 maven 插件构建一个 markdown wiki,我可以在不修改的情况下部署到 github。我在构建 markdown 并通过 intellij 查看文档时没有问题,但我希望将它直接托管在我项目的 github wiki 中。如果有人对如何做到这一点有任何想法,那就太好了。

这是我当前的 Dokka 配置

        <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>

【问题讨论】:

  • 你解决了吗?
  • 不是我想要的方式。我正在考虑分叉项目并在我有时间的时候自己做

标签: kotlin kotlin-dokka


【解决方案1】:

这告诉 dokka 生成 md 文件而不是 HTML:

<outputFormat>markdown</outputFormat>

然后你可以将结果推送到github。

【讨论】:

  • 是的,我目前将其设置为 &lt;outputFormat&gt;gfm&lt;/outputFormat&gt;,这是 github 风格的降价。但这并不会导致您真正可以基于链接结构浏览的 wiki,并且它会为每个功能创建单独的降价文件
猜你喜欢
  • 2017-07-28
  • 1970-01-01
  • 2020-02-17
  • 2023-04-11
  • 2020-08-15
  • 2016-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多