Skip to main content

Crate dioxus_docs_kit

Crate dioxus_docs_kit 

Source
Expand description

§dioxus-docs-kit

Reusable documentation site shell and blog engine for Dioxus applications.

Provides a complete docs layout with sidebar navigation, search modal, page navigation, OpenAPI API reference pages, and mobile drawer. Also includes a full blog engine with post listing, tag filtering, search, reading time, and MDX rendering.

§Quick Start — Docs

use dioxus::prelude::*;
use dioxus_docs_kit::{DocsConfig, DocsRegistry, DocsContext, DocsLayout, DocsPageContent};
use std::sync::LazyLock;

static DOCS: LazyLock<DocsRegistry> = LazyLock::new(|| {
    DocsConfig::new(include_str!("../docs/_nav.json"), doc_content_map())
        .with_default_path("getting-started/introduction")
        .build()
});

§Quick Start — Blog

use dioxus::prelude::*;
use dioxus_docs_kit::{BlogConfig, BlogRegistry, BlogContext, BlogLayout, BlogList, BlogPostView};
use std::sync::LazyLock;

dioxus_docs_kit::blog_content_map!();

static BLOG: LazyLock<BlogRegistry> = LazyLock::new(|| {
    BlogConfig::new(include_str!("../blog/_blog.json"), blog_content_map())
        .with_posts_per_page(9)
        .build()
});

Re-exports§

pub use config::DocsConfig;
pub use config::ThemeConfig;
pub use registry::DocsRegistry;
pub use registry::ApiEndpointEntry;
pub use registry::NavConfig;
pub use registry::NavGroup;
pub use registry::SearchEntry;
pub use components::CurrentTheme;
pub use components::DocsLayout;
pub use components::DocsLayout;
pub use components::DocsPageContent;
pub use components::DocsPageContent;
pub use components::DocsPageNav;
pub use components::DocsPageNav;
pub use components::DocsSidebar;
pub use components::DocsSidebar;
pub use components::DrawerOpen;
pub use components::LayoutOffsets;
pub use components::MobileDrawer;
pub use components::MobileDrawer;
pub use components::SearchButton;
pub use components::SearchButton;
pub use components::SearchModal;
pub use components::SearchModal;
pub use components::ThemeToggle;
pub use components::ThemeToggle;
pub use hooks::DocsProviders;
pub use hooks::use_docs_providers;
pub use blog::types::Author;
pub use blog::types::BlogFrontmatter;
pub use blog::types::BlogPost;
pub use blog::types::BlogSearchEntry;
pub use blog::BlogConfig;
pub use blog::BlogProviders;
pub use blog::BlogRegistry;
pub use blog::use_blog_providers;
pub use components::AuthorInfo;
pub use components::AuthorInfo;
pub use components::BlogCard;
pub use components::BlogCard;
pub use components::BlogIndexMeta;
pub use components::BlogIndexMeta;
pub use components::BlogLayout;
pub use components::BlogLayout;
pub use components::BlogList;
pub use components::BlogList;
pub use components::BlogMobileDrawer;
pub use components::BlogMobileDrawer;
pub use components::BlogPostMeta;
pub use components::BlogPostMeta;
pub use components::BlogPostNav;
pub use components::BlogPostNav;
pub use components::BlogPostView;
pub use components::BlogPostView;
pub use components::BlogSearchButton;
pub use components::BlogSearchButton;
pub use components::BlogSearchModal;
pub use components::BlogSearchModal;
pub use components::BlogThemeToggle;
pub use components::BlogThemeToggle;
pub use components::ReadingProgressBar;
pub use components::ReadingProgressBar;
pub use components::ReadingTimeBadge;
pub use components::ReadingTimeBadge;
pub use components::RelatedPosts;
pub use components::RelatedPosts;
pub use components::TagFilter;
pub use components::TagFilter;

Modules§

blog
Blog engine module for dioxus-docs-kit.
components
config
Builder for constructing a DocsRegistry.
hooks
registry
Documentation content registry.

Macros§

blog_content_map
Generates a blog_content_map() function that returns a HashMap<&'static str, &'static str> from the build-script output.
doc_content_map
Generates a doc_content_map() function that returns a HashMap<&'static str, &'static str> from the build-script output.

Structs§

ApiOperation
API endpoint operation.
ApiTag
Tag metadata.
BlogContext
Navigation bridge for blog pages, decoupled from the consumer’s Route enum.
DocsContext
Navigation bridge that decouples library components from the consumer’s Route enum.
OpenApiSpec
Parsed OpenAPI specification.
ParsedDoc
Parsed documentation page with frontmatter and content.

Enums§

HttpMethod
HTTP method.

Functions§

DocContent
Render a list of DocNodes.
DocTableOfContents
Table of contents sidebar component with scroll tracking.
EndpointPage
Full-page two-column layout for a single API endpoint.
MermaidDiagram
Renders a mermaid diagram.
extract_headers
Extract headers from markdown content for table of contents.
highlight_code
Apply syntax highlighting to code.