Skip to main content

ModuleRenderer

Struct ModuleRenderer 

Source
pub struct ModuleRenderer<'a> { /* private fields */ }
Expand description

Module page renderer that converts DocModel modules into Markdown files.

Implementations§

Source§

impl<'a> ModuleRenderer<'a>

Source

pub fn new(renderer: &'a Renderer) -> Self

Create a new module renderer

Source

pub fn with_cross_refs( renderer: &'a Renderer, cross_refs: Vec<CrossRef>, ) -> Self

Create a module renderer with cross-references for bi-directional linking

Source

pub fn render_python_module( &self, module: &PythonModule, ) -> Result<Vec<RenderedPage>, Error>

Render a Python module to a single Markdown file with all content inline.

This creates one file per module with classes, methods, and functions all rendered inline rather than as separate pages.

Source

pub fn render_rust_module( &self, module: &RustModule, ) -> Result<Vec<RenderedPage>, Error>

Render a Rust module to a single Markdown file with all content inline.

This creates one file per module with structs, enums, and functions all rendered inline rather than as separate pages.

Source

pub fn render_python_modules( &self, modules: &[PythonModule], ) -> Result<Vec<RenderedPage>, Error>

Render all Python modules from a list

Source

pub fn render_rust_modules( &self, modules: &[RustModule], ) -> Result<Vec<RenderedPage>, Error>

Render all Rust modules from a list

Source

pub fn generate_nav( &self, adapter: &dyn SSGAdapter, python_modules: &[PythonModule], rust_modules: &[RustModule], prefix: Option<&str>, ) -> String

Generate navigation using an SSG adapter.

This method provides a unified interface for generating navigation regardless of the target SSG. Use super::ssg::get_ssg_adapter to get the appropriate adapter for your template.

§Example
use plissken_core::render::ssg::get_ssg_adapter;

let adapter = get_ssg_adapter(Some("mkdocs-material"));
let nav = module_renderer.generate_nav(&adapter, &python_modules, &rust_modules);
Source

pub fn generate_config( &self, adapter: &dyn SSGAdapter, title: &str, authors: &[String], ) -> Option<String>

Generate SSG config file using an adapter.

Returns None for SSGs that don’t need generated config (e.g., MkDocs).

Source

pub fn generate_custom_css(&self, adapter: &dyn SSGAdapter) -> Option<String>

Generate custom CSS using an adapter.

Returns None for SSGs that don’t need custom CSS.

Source

pub fn generate_nav_yaml( &self, python_modules: &[PythonModule], rust_modules: &[RustModule], prefix: Option<&str>, ) -> String

Generate navigation YAML for mkdocs.yml

Creates a nav structure with inline format (one file per module):

nav:
  - Python:
    - pysnake: pysnake.md
  - Rust:
    - rustscale: rust/rustscale.md
    - rustscale::config: rust/rustscale/config.md
Source

pub fn generate_mdbook_summary( &self, python_modules: &[PythonModule], rust_modules: &[RustModule], prefix: Option<&str>, ) -> String

Generate SUMMARY.md for mdBook navigation

Creates a hierarchical navigation with inline format (one file per module):

# Summary

# Python

- [pysnake](pysnake.md)
  - [pysnake.handlers](pysnake/handlers.md)

# Rust

- [rustscale](rust/rustscale.md)
  - [rustscale::config](rust/rustscale/config.md)
Source

pub fn generate_mdbook_config(&self, title: &str, authors: &[String]) -> String

Generate book.toml configuration for mdBook

Includes fold configuration for collapsible sidebar sections.

Source

pub fn generate_mdbook_css(&self) -> String

Generate custom CSS for mdBook

Hides chapter numbering for reference documentation sections (python/, rust/) while preserving numbering for other documentation sections.

Auto Trait Implementations§

§

impl<'a> Freeze for ModuleRenderer<'a>

§

impl<'a> !RefUnwindSafe for ModuleRenderer<'a>

§

impl<'a> Send for ModuleRenderer<'a>

§

impl<'a> Sync for ModuleRenderer<'a>

§

impl<'a> Unpin for ModuleRenderer<'a>

§

impl<'a> UnsafeUnpin for ModuleRenderer<'a>

§

impl<'a> !UnwindSafe for ModuleRenderer<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V