What is the standard convention (or tag) to add code examples in ScalaDoc? Example in the code below, I want to provide coding example to demonstrate it's usage:
/**
* Adds a filter on DB Table Query if value is defined. Example:
*
* {code}
* val startIncluded: Option[Timestamp] = _
* tableQuery.filter(startIncluded)(startTime => _.start >= startTime)
* {code}
*
* ... other doc ...
*/
def filter (value: Option[T])(condition: T => Table => Option[Boolean]) = {
Like in javadocs, @code is used.
You can use {{{ }}}
to delimit code blocks:
/**
* This is a comment.
*
* {{{
* this.is(example.code)
* }}}
*/
def is(some: Code): Unit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With