Upgrade to Pro — share decks privately, control downloads, hide ads and more …

KDoc

scache
September 18, 2017

 KDoc

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

scache

September 18, 2017
Tweet

More Decks by scache

Other Decks in Technology

Transcript

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

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

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

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

    * @return ໭Γ஋ʹ͍ͭͯ * @receiver Ϩγʔόʹ͍ͭͯ * @throws IllegalArgumentException ྫ֎ * @exception IllegalArgumentException ྫ֎
 */ fun <T> T.doc(arg: String): Int { ... }
  5. Sample fun usage() {
 val s = "str"
 doc(s)
 }


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


    
 /**
 * @sample usage
 */
 fun doc(arg: String): Int { ... }