Skip to content
/ redoc Public

A collection of 'HTML', 'JavaScript', 'CSS' and fonts assets that generate 'Redoc' documentation from an OAS compliant API.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

meztez/redoc

Repository files navigation

Generates Redoc documentation from an OAS Compliant API

CRAN_Status_Badge R build status RStudio community

redoc is a collection of HTML, JavaScript, CSS and fonts assets that generate Redoc documentation from an OpenAPI Specification.

The main purpose of this package is to enable package authors to create APIs that are compatible with redoc and openapis.org.

Package authors providing web interfaces can serve the static files from redoc_path() using httpuv or fiery. As a start, we can also browse them by running

library(redoc)
browseURL(redoc_index())

Installation

remotes::install_github("https://github.com/meztez/redoc")

Use with plumber R package

plumber annotation syntax

library(redoc)

#* @plumber
function(pr) {
  pr$setDocs("redoc", theme = list(menu = list(backgroundColor = "#00DE9C")))
}

#* @get /hello
function() {
  "hello"
}

plumber programmatic usage

library(plumber)
library(redoc)
pr() %>%
  pr_get("hello", function() {"hello"}) %>%
  pr_set_docs("redoc", theme = list(menu = list(backgroundColor = "#00DE9C"))) %>%
  pr_run()

Using Redoc API attributes

Further customize Redoc using its configuration object. Use nested named list for nested configuration options.

pr()$setDocs("redoc", theme = list(menu = list(backgroundColor = "#00DE9C")), disableSearch = TRUE)

pr() %>% pr_set_docs("rapidoc", theme = list(menu = list(backgroundColor = "#00DE9C")), disableSearch = TRUE)

The full set of Redoc configuration options is supported.

To learn more about Redoc visit:

About

A collection of 'HTML', 'JavaScript', 'CSS' and fonts assets that generate 'Redoc' documentation from an OAS compliant API.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages