% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/str-value.R
\name{str_value}
\alias{str_value}
\alias{str_value.default}
\title{Compact rendering}
\usage{
str_value(x, ...)

\method{str_value}{default}(x, ...)
}
\arguments{
\item{x}{Object to render.}

\item{...}{Generic consistency.}
}
\value{
\code{str_value()} returns a length-one character vector (multi-line for
containers). The \code{\link[utils:str]{utils::str()}} methods are called for their side effect
(display) and return their \code{object} invisibly.
}
\description{
\code{str_value()} returns a compact string describing an object. It is the
value-returning half of the compact rendering tier: where \code{\link[utils:str]{utils::str()}}
only displays (it \code{cat()}s and returns \code{NULL}), \code{str_value()} returns the
string, mirroring how \code{\link[=format]{format()}} returns what \code{\link[=print]{print()}} displays in the
full, multi-line tier. The \code{\link[utils:str]{utils::str()}} methods are thin wrappers that
display \code{str_value()}.
}
\details{
A scalar object (a \code{block}, \code{stack}, \code{link}, \code{board_option} or \code{plugin})
renders as a single line; a container (\code{blocks}, \code{stacks}, \code{links},
\code{board_options}, \code{plugins}) and a whole \code{board} render as one element per
line below a \verb{<class[n]>} header. The \code{block} method lists a block's
constructor inputs, marking the externally controllable ones (those
reported by \code{\link[=external_ctrl_vars]{external_ctrl_vars()}}) with a trailing \code{*}; the \code{stack}
method shows the stack name and its member block ids.

This is the blockr extension point for token-dense renderings such as a
board summary. A home package surfaces a subclass's state by defining a
\code{str_value()} method, typically extending the parent's via \code{\link[=NextMethod]{NextMethod()}}
(the way \code{format.dock_stack()} appends a stack colour). \code{\link[=print]{print()}} and
\code{\link[=format]{format()}} are unaffected and remain the full, multi-line tier.
}
\examples{
str_value(new_dataset_block())

str_value(new_stack(c("plot", "data"), name = "My stack"))

board <- new_board(c(a = new_dataset_block()))
str(board)

}
