pub struct RenderOptions {
pub source_path: Option<String>,
pub code_handlers: HashMap<String, BoxedHandler>,
pub default_handler: Option<BoxedHandler>,
pub req_handler: Option<BoxedReqHandler>,
pub inline_code_handler: Option<BoxedInlineCodeHandler>,
pub link_resolver: Option<BoxedLinkResolver>,
}Expand description
Options for rendering markdown.
Fields§
§source_path: Option<String>Source file path (for relative link resolution)
code_handlers: HashMap<String, BoxedHandler>Code block handlers keyed by language
default_handler: Option<BoxedHandler>Default handler for languages without a specific handler
req_handler: Option<BoxedReqHandler>Custom handler for rendering requirement definitions
inline_code_handler: Option<BoxedInlineCodeHandler>Custom handler for rendering inline code spans
link_resolver: Option<BoxedLinkResolver>Custom handler for resolving links (for dependency tracking)
Implementations§
Source§impl RenderOptions
impl RenderOptions
Sourcepub fn with_handler<H: CodeBlockHandler + 'static>(
self,
languages: &[&str],
handler: H,
) -> Self
pub fn with_handler<H: CodeBlockHandler + 'static>( self, languages: &[&str], handler: H, ) -> Self
Register a handler for one or more languages.
Sourcepub fn with_default_handler<H: CodeBlockHandler + 'static>(
self,
handler: H,
) -> Self
pub fn with_default_handler<H: CodeBlockHandler + 'static>( self, handler: H, ) -> Self
Set the default handler for unregistered languages.
Sourcepub fn with_req_handler<H: ReqHandler + 'static>(self, handler: H) -> Self
pub fn with_req_handler<H: ReqHandler + 'static>(self, handler: H) -> Self
Set a custom handler for requirement definitions.
Sourcepub fn with_source_path(self, path: &str) -> Self
pub fn with_source_path(self, path: &str) -> Self
Set the source file path for link resolution and paragraph source attributes.
Sourcepub fn with_inline_code_handler<H: InlineCodeHandler + 'static>(
self,
handler: H,
) -> Self
pub fn with_inline_code_handler<H: InlineCodeHandler + 'static>( self, handler: H, ) -> Self
Set a custom handler for inline code spans.
Sourcepub fn with_link_resolver<R: LinkResolver + 'static>(self, resolver: R) -> Self
pub fn with_link_resolver<R: LinkResolver + 'static>(self, resolver: R) -> Self
Set a custom link resolver for dependency tracking.
Trait Implementations§
Source§impl Default for RenderOptions
impl Default for RenderOptions
Source§fn default() -> RenderOptions
fn default() -> RenderOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RenderOptions
impl !RefUnwindSafe for RenderOptions
impl Send for RenderOptions
impl Sync for RenderOptions
impl Unpin for RenderOptions
impl UnsafeUnpin for RenderOptions
impl !UnwindSafe for RenderOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more