KDoc

07cc3901ba91cc4fc0fee0d26944e314?s=47 scache
September 18, 2017

 KDoc

Kotlinコードにドキュメントを書くためのKDocで使えるタグや記法について紹介

07cc3901ba91cc4fc0fee0d26944e314?s=128

scache

September 18, 2017
Tweet

Transcript

  1. KDoc Ryo Sotoyama( @scal_ch )

  2. About Me • ֎ࢁ ໆ (Ryo Sotoyama) • Twitter: @scal_ch

    • AndroidΞϓϦ࡞ͬͯ·͢
  3. KDoc • KotlinͷυΩϡϝϯτهड़༻ݴޠ • Javadocͱॻ͖ํ͸ࣅ͍ͯΔ

  4. Summary, Detailed Description fun doc() {}

  5. Summary, Detailed Description /**
 * ࠷ॳͷߦʹ֓ཁΛॻ͘
 */ fun doc() {}

  6. Summary, Detailed Description /**
 * ࠷ॳʹ֓ཁΛॻ͘
 *
 * վߦͨ͠ޙʹৄࡉΛॻ͘
 */

    fun doc() {}
  7. Link /**
 * Ϋϥε΁ͷϦϯΫ [android.app.Activity]
 */ fun doc() {}

  8. Link import android.app.Activity /**
 * Activity΁ͷϦϯΫ [Activity]
 */ fun doc()

    {}
  9. Link import android.app.Activity /**
 * [Activity΁ͷϦϯΫ][Activity]
 */ fun doc() {}

  10. Link import android.app.Activity /**
 * [ؔ਺΁ͷϦϯΫ][Activity.onCreate]
 */ fun doc() {}

  11. Link /**
 * [github](https://github.com/sckm) */ fun doc() {}

  12. Block Tags

  13. Function fun doc() { ... }

  14. Function /**
 * @param arg argʹ͍ͭͯ
 */ fun doc(arg: String)

    { ... }
  15. Function /**
 * @param[arg] argʹ͍ͭͯ
 */ fun doc(arg: String) {

    ... }
  16. Function /**
 * @param arg argʹ͍ͭͯ * @return ໭Γ஋ʹ͍ͭͯ
 */

    fun doc(arg: String): Int { ... }
  17. Function /**
 * @param arg argʹ͍ͭͯ * @return ໭Γ஋ʹ͍ͭͯ *

    @receiver Ϩγʔόʹ͍ͭͯ
 */ fun String.doc(arg: String): Int { ... }
  18. Function /** * @param T ܕύϥϝʔλT
 * @param arg argʹ͍ͭͯ

    * @return ໭Γ஋ʹ͍ͭͯ * @receiver Ϩγʔόʹ͍ͭͯ
 */ fun <T> T.doc(arg: String): Int { ... }
  19. Function /** * @param T ܕύϥϝʔλT
 * @param arg argʹ͍ͭͯ

    * @return ໭Γ஋ʹ͍ͭͯ * @receiver Ϩγʔόʹ͍ͭͯ * @throws IllegalArgumentException ྫ֎ * @exception IllegalArgumentException ྫ֎
 */ fun <T> T.doc(arg: String): Int { ... }
  20. Function /** * @param T ܕύϥϝʔλT
 * @param arg argʹ͍ͭͯ

    * @return ໭Γ஋ʹ͍ͭͯ * @receiver Ϩγʔόʹ͍ͭͯ * @throws IllegalArgumentException ྫ֎ * @exception IllegalArgumentException ྫ֎
 */ fun <T> T.doc(arg: String): Int { ... }
  21. Class class Doc

  22. Class /**
 * @constructor ϓϥΠϚϦίϯετϥΫ
 */
 class Doc(val p: String)

  23. Class /**
 * @constructor ϓϥΠϚϦίϯετϥΫ * @property p ϓϩύςΟp
 */


    class Doc(val p: String)
  24. Sample fun usage() {
 val s = "str"
 doc(s)
 }


    
 /**
 * @sample usage
 */
 fun doc(arg: String): Int { ... }
  25. Sample fun usage() {
 val s = "str"
 doc(s)
 }


    
 /**
 * @sample usage
 */
 fun doc(arg: String): Int { ... }
  26. Tags /**
 * @see android.app.Activity
 * @author scache
 * @since

    1.0
 * @suppress
 */
 class BlockTags
  27. Tags /**
 * @see android.app.Activity
 * @author scache
 * @since

    1.0
 * @suppress
 */ class BlockTags
  28. Tags /**
 * @see android.app.Activity
 * @author scache
 * @since

    1.0
 * @suppress
 */
 class BlockTags
  29. Tags /**
 * @see android.app.Activity
 * @author scache
 * @since

    1.0
 * @suppress
 */ class BlockTags
  30. • Javadocͱॻ͖ํ͸΄ͱΜͲಉ͡ • DokkaΛ࢖͏ͱhtmlʹग़ྗՄೳ