We currently define displayas:
#' Display an object using any available reprs
#'
#' @param obj The object to be displayed
#' @importFrom repr mime2repr repr_text
#' @export
display <- function (obj) {
data <- namedlist()
if (getOption('jupyter.rich_display')) {
for (mime in getOption('jupyter.display_mimetypes')) {
r <- mime2repr[[mime]](obj)
if (!is.null(r)) data[[mime]] <- r
}
} else {
data[['text/plain']] <- repr_text(obj)
}
publish_mimebundle(data)
}
I would like to shorten that to
#' Display an object using any available reprs
#'
#' @param obj The object to be displayed
#' @importFrom repr mime2repr repr_text
#' @export
display <- function (obj) {
data <- namedlist()
for (mime in getOption('jupyter.display_mimetypes')) {
r <- mime2repr[[mime]](obj)
if (!is.null(r)) data[[mime]] <- r
}
publish_mimebundle(data)
}
This would mean that I can remove the auto rich display output (jupyter.rich_display = FALSE) and could still use display(something) and get all available output. That would in line with display_XXX which do not honor this option (and rightly so). It would also be more in line of the current doc string: "using any available reprs".
This would also mean that jupyter.rich_display would be an option of the kernel alone and not of the IRdisplay package. IMO it could then be renamed to jupyter.auto_rich_display.
We currently define
displayas:I would like to shorten that to
This would mean that I can remove the auto rich display output (
jupyter.rich_display = FALSE) and could still usedisplay(something)and get all available output. That would in line withdisplay_XXXwhich do not honor this option (and rightly so). It would also be more in line of the current doc string: "using any available reprs".This would also mean that
jupyter.rich_displaywould be an option of the kernel alone and not of the IRdisplay package. IMO it could then be renamed tojupyter.auto_rich_display.