Skip to content

plissken-core::render::ssg::mkdocs Rust

MkDocs adapter implementation

Structs

plissken-core::render::ssg::mkdocs::MkDocsAdapter

pub

MkDocs adapter for Material theme.

Generates hierarchical YAML navigation with collapsible sections for nested modules. Works with MkDocs Material's navigation.indexes feature to show section index pages.

Functions

plissken-core::render::ssg::mkdocs::render_yaml_nodes

private

fn render_yaml_nodes (nodes : & [NavNode] , indent : usize) -> String

Render a list of NavNodes as nested MkDocs YAML.

Source
fn render_yaml_nodes(nodes: &[NavNode], indent: usize) -> String {
    let mut yaml = String::new();
    let pad = "  ".repeat(indent);

    for node in nodes {
        if node.is_branch() {
            // Section with collapsible children
            yaml.push_str(&format!("{}- {}:\n", pad, node.name));
            // Section index page (works with navigation.indexes)
            yaml.push_str(&format!("{}  - {}\n", pad, node.file_path));
            yaml.push_str(&render_yaml_nodes(&node.children, indent + 1));
        } else {
            // Leaf entry
            yaml.push_str(&format!("{}- {}: {}\n", pad, node.name, node.file_path));
        }
    }

    yaml
}