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
.
#> [2018-12-02T17:14:09 CET] Re-defining 'foo' ... OKprint_info("foo")#> # Info #> This is a docstring for `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) })