pub struct MdxBodyEmitter { /* private fields */ }Expand description
Builds an MDX-runtime body: _createMdxContent(props) returning a tree
of jsx/jsxs/Fragment. Output shape follows @mdx-js/mdx’s
function-body format:
Fragment/jsx/jsxsfromarguments[0]_components = { tag: "tag", ..., ...props.components }– only referenced intrinsics get a default entry- capitalized JSX names destructured off
_componentsand validated via_missingMdxReference jsxfor zero/one child,jsxsfor multiple
Implementations§
Source§impl MdxBodyEmitter
impl MdxBodyEmitter
pub fn new() -> Self
Sourcepub fn new_with_options(options: RenderOptions) -> Self
pub fn new_with_options(options: RenderOptions) -> Self
Construct with explicit RenderOptions. The only field
MdxBodyEmitter honors is allow_dangerous_html; when false
(the default via MdxBodyEmitter::new) raw HTML is rendered as
safe text rather than dangerouslySetInnerHTML.
pub fn render(doc: &Document) -> (String, DiagnosticEngine<Code>)
Sourcepub fn render_with(
doc: &Document,
options: RenderOptions,
) -> (String, DiagnosticEngine<Code>)
pub fn render_with( doc: &Document, options: RenderOptions, ) -> (String, DiagnosticEngine<Code>)
Drive the walker with explicit RenderOptions.
pub fn into_parts(self) -> (String, DiagnosticEngine<Code>)
pub fn into_string(self) -> String
Trait Implementations§
Source§impl Debug for MdxBodyEmitter
impl Debug for MdxBodyEmitter
Source§impl Default for MdxBodyEmitter
impl Default for MdxBodyEmitter
Auto Trait Implementations§
impl Freeze for MdxBodyEmitter
impl RefUnwindSafe for MdxBodyEmitter
impl Send for MdxBodyEmitter
impl Sync for MdxBodyEmitter
impl Unpin for MdxBodyEmitter
impl UnsafeUnpin for MdxBodyEmitter
impl UnwindSafe for MdxBodyEmitter
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