pub struct Options {
pub parse: MdxParseOptions,
pub development: bool,
pub provider_import_source: Option<String>,
pub jsx: bool,
pub jsx_runtime: Option<JsxRuntime>,
pub jsx_import_source: Option<String>,
pub pragma: Option<String>,
pub pragma_frag: Option<String>,
pub pragma_import_source: Option<String>,
pub filepath: Option<String>,
}
Expand description
Configuration (optional).
Configuration that describes how to parse from markdown.
Whether to add extra information to error messages in generated code (default: false
).
When in the automatic JSX runtime, this also enabled its development functionality.
Place to import a provider from (default: None
, example: Some("@mdx-js/react").into()
).
Useful for runtimes that support context (React, Preact). The provider must export a useMDXComponents
, which is called to access an object of components.
Whether to keep JSX (default: false
).
The default is to compile JSX away so that the resulting file is immediately runnable.
JSX runtime to use (default: Some(JsxRuntime::Automatic)
).
The classic runtime compiles to calls such as h('p')
, the automatic runtime compiles to import _jsx from '$importSource/jsx-runtime'\n_jsx('p')
.
Place to import automatic JSX runtimes from (Option<String>
, default: Some("react".into())
).
When in the automatic runtime, this is used to define an import for _Fragment
, _jsx
, and _jsxs
.
Pragma for JSX (default: Some("React.createElement".into())
).
When in the classic runtime, this is used as an identifier for function calls: <x />
to React.createElement('x')
.
You should most probably define pragma_frag
and pragma_import_source
too when changing this.
Pragma for JSX fragments (default: Some("React.Fragment".into())
).
When in the classic runtime, this is used as an identifier for fragments: <>
to React.createElement(React.Fragment)
.
You should most probably define pragma
and pragma_import_source
too when changing this.
Where to import the identifier of pragma
from (default: Some("react".into())
).
When in the classic runtime, this is used to import the pragma
function. To illustrate with an example: when pragma
is "a.b"
and pragma_import_source
is "c"
, the following will be generated: import a from 'c'
.
File path to the source file (example: Some("path/to/example.mdx".into())
).
Used when development: true
to improve error messages.
MDX with GFM.
GFM stands for GitHub flavored markdown. GFM extends CommonMark
and adds support for autolink literals, footnotes, strikethrough, tables, and tasklists. On the compilation side, GFM turns on the GFM tag filter. The tagfilter is useless, but it’s included here for consistency.
For more information, see the GFM specification: https://github.github.com/gfm/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4