print_info | R Documentation |
Output the docstring info of a module.
print_info(name = .Last.name, line_numbers = FALSE, sep = "\n", load = TRUE)
info(name = .Last.name, line_numbers = FALSE, sep = "\n", load = TRUE)
name |
A string (character vector of lenght one). A module name can contain letters, figures and some special characters,
namely Names containing The name "modulr" corresponds to a special module and is therefore reserved. |
line_numbers |
A flag. Should the source line numbers be outputed? |
sep |
A string (character vector of length one) containing the separator between docstrings blocs. |
load |
A flag. Should the module be loaded? |
A docstring is intended to document a module and provide the user
with the ability to inspect it at run time, for instance as an interactive
help system, or as metadata. Formally, it is a block of commented lines
prefixed with #'
and located at the top of the module provider.
The preferred formatting for a docstring is R Markdown, notabely for Modulr
Gears (see prepare_gear
).
define
, prepare_gear
, and
reset
.
define("foo", NULL, {
#' # Info
#' This is a docstring for `foo`.
})
print_info("foo")
## Not run:
tmp <- tempfile(fileext = ".html")
cat((knitr::knit2html(text = info("foo"))), file = tmp)
if(interactive()) rstudio::viewer(tmp)
Sys.sleep(1L); unlink(tmp)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.