Technical previewShare feedback

Search

Search documentation

MDX plugins

Updated Nov 1, 2026

MDX is Markdown with JSX. Parse it with md.parse and md.mdx, turn it into hast with md.toHtml, then compile it to JavaScript with mdx.compile.

The tables list each option as Pipeline takes it, by its JSON key and type; each plugin struct's own fields and Rust types are on docs.rs.

mdx.compile

Compiles the hast of an MDX document into a JavaScript module whose default export renders it.

use textlane::{Processor, md, mdx};

let output = Processor::new()
    .with(md::Parse::default())
    .with(md::Mdx::default())
    .with(md::ToHtml::default())
    .with(mdx::Compile::default())
    .freeze()?
    .process("# Hi {name}")?;
output.value
// import {jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
// function _createMdxContent(props) {
//   const _components = {
//     h1: "h1",
//     ...props.components
// …

Follows @mdx-js/mdx.

OptionTypeDefaultDescription
jsxbooleanfalseKeep JSX in the output instead of compiling it to function calls.
jsxRuntimestring | nullnullThe JSX runtime: automatic (default) or classic.
jsxImportSourcestring | nullnullWhere the automatic runtime imports jsx and jsxs from (default react).
pragmastring | nullnullThe classic runtime's element function (default React.createElement).
pragmaFragstring | nullnullThe classic runtime's fragment (default React.Fragment).
pragmaImportSourcestring | nullnullWhere the classic runtime imports the pragma's first name from (default react).
providerImportSourcestring | nullnullWhere useMDXComponents is imported from, to take components from a provider.
outputFormatstring | nullnullprogram (default), a module, or function-body, the body of a function that gets the runtime as its first argument.
elementAttributeNameCasestring | nullnullHow attribute names of HTML elements are cased: react (default) or html.
stylePropertyNameCasestring | nullnullHow style property names are cased: dom (default) or css.
tableCellAlignToStyleboolean | nullnullTurn align on table cells into a textAlign style (default true).

Created with ❤ and Livemark