pub struct DocsRegistry {
pub nav: NavConfig,
pub default_path: String,
pub api_group_name: String,
pub theme: Option<ThemeConfig>,
/* private fields */
}Expand description
Central documentation registry holding all parsed content.
Created via DocsConfig builder and typically stored in a Lazy<DocsRegistry> static.
Provide it to UI components via use_context_provider(|| &*DOCS as &'static DocsRegistry).
Fields§
Navigation configuration.
default_path: StringDefault page path for redirects.
api_group_name: StringDisplay name for the API Reference sidebar group.
theme: Option<ThemeConfig>Optional theme configuration.
Implementations§
Source§impl DocsRegistry
impl DocsRegistry
Sourcepub fn get_parsed_doc(&self, path: &str) -> Option<&ParsedDoc>
pub fn get_parsed_doc(&self, path: &str) -> Option<&ParsedDoc>
Get a pre-parsed document by path.
Get the sidebar title for a documentation path.
Sourcepub fn get_doc_title(&self, path: &str) -> Option<String>
pub fn get_doc_title(&self, path: &str) -> Option<String>
Get the document title from frontmatter.
Sourcepub fn get_doc_icon(&self, path: &str) -> Option<String>
pub fn get_doc_icon(&self, path: &str) -> Option<String>
Get the icon for a documentation path from frontmatter.
Sourcepub fn get_doc_content(&self, path: &str) -> Option<&str>
pub fn get_doc_content(&self, path: &str) -> Option<&str>
Get raw documentation content by path.
Sourcepub fn get_all_paths(&self) -> Vec<&str>
pub fn get_all_paths(&self) -> Vec<&str>
Get all available documentation paths.
Sourcepub fn get_api_operation(&self, path: &str) -> Option<&ApiOperation>
pub fn get_api_operation(&self, path: &str) -> Option<&ApiOperation>
Look up an API operation by its slug across all registered specs.
The path is the full docs path, e.g. “api-reference/list-pets”.
Sourcepub fn get_api_spec(&self, prefix: &str) -> Option<&OpenApiSpec>
pub fn get_api_spec(&self, prefix: &str) -> Option<&OpenApiSpec>
Get the OpenAPI spec that owns a given path prefix.
Sourcepub fn get_first_api_spec(&self) -> Option<&OpenApiSpec>
pub fn get_first_api_spec(&self) -> Option<&OpenApiSpec>
Get the first OpenAPI spec (convenience for single-spec setups).
Sourcepub fn get_first_api_prefix(&self) -> Option<&str>
pub fn get_first_api_prefix(&self) -> Option<&str>
Get the prefix of the first OpenAPI spec.
Get API endpoint sidebar entries grouped by tag.
Sourcepub fn get_api_endpoint_paths(&self) -> Vec<String>
pub fn get_api_endpoint_paths(&self) -> Vec<String>
Get all API endpoint paths for navigation ordering.
Sourcepub fn tab_for_path(&self, path: &str) -> Option<String>
pub fn tab_for_path(&self, path: &str) -> Option<String>
Determine which tab a given page path belongs to.
Sourcepub fn generate_llms_txt(
&self,
site_title: &str,
site_description: &str,
base_url: &str,
) -> String
pub fn generate_llms_txt( &self, site_title: &str, site_description: &str, base_url: &str, ) -> String
Generate an llms.txt index listing all doc pages with titles and descriptions.
Sourcepub fn generate_llms_full_txt(
&self,
site_title: &str,
site_description: &str,
base_url: &str,
) -> String
pub fn generate_llms_full_txt( &self, site_title: &str, site_description: &str, base_url: &str, ) -> String
Generate an llms-full.txt with the full MDX content of every doc page.
Sourcepub fn search_docs(&self, query: &str) -> Vec<&SearchEntry>
pub fn search_docs(&self, query: &str) -> Vec<&SearchEntry>
Search documentation by query string.
Returns matching entries with title matches first, then description, then content.