pr_set_docs_callback | R Documentation |
callback
to tell where the API visual documentation is locatedWhen set, it will be called with a character string corresponding to the API visual documentation url. This allows RStudio to locate visual documentation.
pr_set_docs_callback(pr, callback = getOption("plumber.docs.callback", NULL))
pr |
A Plumber API. Note: The supplied Plumber API object will also be updated in place as well as returned by the function. |
callback |
a callback function for taking action on the docs url. |
If using options_plumber()
, the value must be set before initializing your Plumber router.
The Plumber router with the new docs callback setting.
## Not run: pr() %>% pr_set_docs_callback(function(url) { message("API location: ", url) }) %>% pr_get("/plus/<a:int>/<b:int>", function(a, b) { a + b }) %>% pr_run() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.