Kotlin 未在Dokka生成的HTML中呈现KDoc注释

Kotlin 未在Dokka生成的HTML中呈现KDoc注释,kotlin,code-documentation,kotlin-dokka,kdoc,Kotlin,Code Documentation,Kotlin Dokka,Kdoc,我目前正在测试Dokka文档,我所做的一些注释没有呈现出来。以下是我的发现: 类不显示@sample,也不显示html标记,:请参阅SimpleCalculator类文档 如果描述位于html标记下,则不会显示:请参阅enum class OPERATORcode文档 方法根本不显示@sample和@property:请参阅所有方法代码文档 @property和@param之间的定义混合。在类声明中,@param是中的一个(例如组)。但在方法中,它是参数中的一个 请查看我的代码: package

我目前正在测试Dokka文档,我所做的一些注释没有呈现出来。以下是我的发现:

  • 类不显示
    @sample
    ,也不显示html标记
    :请参阅
    SimpleCalculator
    类文档
  • 如果描述位于html标记下,则不会显示:请参阅
    enum class OPERATOR
    code文档
  • 方法根本不显示
    @sample
    @property
    :请参阅所有方法代码文档
  • @property
    @param
    之间的定义混合。在类声明中,
    @param
    中的一个(例如
    )。但在方法中,它是参数中的一个 请查看我的代码:

    package example
    
    /**
     * <h1> A Simple Calculator for your daily needs! </h1>
     *
     * <p> This class can help you add, subract, multiply and divide Integers </p>
     *
     * @property firstNumber the first Number you want to use
     * @property secondNumber the second Number you want to use.
     * @constructor Creates a Simple Calculator with the two numbers
     * @sample SimpleCalculator(100,10)
     */
    class SimpleCalculator(val firstNumber: Int, val secondNumber: Int) {
    
        /**
         * <h1> An OPERATOR checker to be used by the Simple Calculator </h1>
         *
         * <p> This class has four enums namely: </p>
         * - ADD
         * - SUB
         * - MUL
         * - DIV
         * @see SimpleCalculator
         */
        enum class OPERATOR { ADD, SUB, MUL, DIV }
    
        /**
         * Computes with the [firstNumber] and [secondNumber] you have created with [SimpleCalculator].
         * @param operator the required OPERATOR needed for the computation
         * @sample compute(OPERATOR.ADD)
         * @see SimpleCalculator
         * @return the required answer
         */
        fun compute(operator: OPERATOR): Int {
            return when (operator) {
                OPERATOR.ADD -> add(firstNumber, secondNumber)
                OPERATOR.SUB -> sub(firstNumber, secondNumber)
                OPERATOR.MUL -> mul(firstNumber, secondNumber)
                OPERATOR.DIV -> div(firstNumber, secondNumber)
            }
        }
    
        /**
         * Adds the [firstNumber] and [secondNumber] you have created with [SimpleCalculator].
         * @property firstNumber the first number
         * @property secondNumber the first number
         * @sample add(100, 10)
         * @see SimpleCalculator
         * @return the sum
         * @throws Exception
         */
        fun add(firstNumber: Int, secondNumber: Int): Int = firstNumber + secondNumber
    
        /**
         * Subtracts the [firstNumber] and [secondNumber] you have created with [SimpleCalculator].
         * Returns the differences
         * @param firstNumber the first number
         * @param secondNumber the second number
         * @sample sub(100, 10)
         * @see SimpleCalculator
         * @return the difference
         * @throws Exception
         */
        fun sub(firstNumber: Int, secondNumber: Int): Int = firstNumber - secondNumber
    
        /**
         * Multiplies the [firstNumber] and [secondNumber] you have created with [SimpleCalculator].
         * Using [add] as a multiplication factor
         * @sample mul(100, 10)
         * @see add
         * @return the product
         * @throws Exception
         */
        fun mul(firstNumber: Int, secondNumber: Int): Int {
            var result = firstNumber
            var i = 2
            while (i < secondNumber && secondNumber != 0) {
                result += add(result, firstNumber)
                i++
            }
    
            return result
        }
    
        /**
         * Divides the [firstNumber] and [secondNumber] you have created with [SimpleCalculator].
         * Using [sub] as a division factor
         * @sample div(100, 10)
         * @see sub
         * @return the dividend
         * @throws Exception
         */
        fun div(firstNumber: Int, secondNumber: Int): Int {
            var result = firstNumber
            var i = 2
            while (i < secondNumber && secondNumber != 0) {
                result -= sub(result, firstNumber)
                i++
            }
    
            return result
        }
    
    }
    
    我的项目生成文件:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        ext.kotlin_version = '1.2.0'
        ext.dokka_version = '0.9.15'
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.1'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
            classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    apply plugin: 'com.android.application'
    
    apply plugin: 'kotlin-android'
    
    apply plugin: 'kotlin-android-extensions'
    
    apply plugin: 'org.jetbrains.dokka'
    
    android {
        compileSdkVersion 26
        defaultConfig {
            applicationId "com.example.hellodokka"
            minSdkVersion 18
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dokka {
        outputFormat = 'html'
        outputDirectory = "$buildDir/html"
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
        implementation 'com.android.support:appcompat-v7:26.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    }
    
    产出:


    有人能帮忙吗?

    不确定这是否是一个bug,所以我也在这里添加了它。