pub struct Docs { /* private fields */ }Expand description
api.docs in the PHP package. Mount the pages with routes.
Implementations§
Source§impl Docs
impl Docs
Sourcepub const fn renderer(self, renderer: Renderer) -> Self
pub const fn renderer(self, renderer: Renderer) -> Self
Which page renders the reference (api.docs.renderer).
Sourcepub fn scalar_url(self, url: &str) -> Self
pub fn scalar_url(self, url: &str) -> Self
Where Scalar is loaded from (api.docs.scalar.url): a fixed version on jsDelivr unless
set. The default’s hash does not fit another file, so this loads url unchecked until
scalar_integrity gives its hash.
Sourcepub fn scalar_integrity(self, integrity: &str) -> Self
pub fn scalar_integrity(self, integrity: &str) -> Self
The hash of the file at scalar_url, such as sha384-…
(api.docs.scalar.integrity). The browser only runs the script when it matches, so a
file that changed on the CDN never runs on the reference. Call it after scalar_url.
Sourcepub fn scalar_config(self, config: Map<String, Value>) -> Self
pub fn scalar_config(self, config: Map<String, Value>) -> Self
Options for Scalar.createApiReference (api.docs.scalar.config), such as theme.
Without a theme or customCss, the reference uses Fusion Stack’s colours. Scalar’s
developer toolbar and AI assistant are off unless set here.
Sourcepub const fn lint_fails(self, fails: bool) -> Self
pub const fn lint_fails(self, fails: bool) -> Self
Whether api:docs:lint exits with an error when anything has no description, for CI
(api.docs.lint set to fail). It only warns by default.
Sourcepub fn redoc_url(self, url: &str) -> Self
pub fn redoc_url(self, url: &str) -> Self
Where Redoc is loaded from (api.docs.redoc.url): a fixed version on Redoc’s CDN unless
set. The default’s hash does not fit another file, so this loads url unchecked until
redoc_integrity gives its hash.
Sourcepub fn redoc_integrity(self, integrity: &str) -> Self
pub fn redoc_integrity(self, integrity: &str) -> Self
The hash of the file at redoc_url, such as sha384-…
(api.docs.redoc.integrity). Call it after redoc_url.