mdz_components.ts

Declarations
#

5 declarations

view source

mdz_base_context
#

mdz_components.ts view source

{ get: (error_message?: string | undefined) => () => string | undefined; get_maybe: () => (() => string | undefined) | undefined; set: (value: () => string | undefined) => () => string | undefined; }

Context for providing a base path getter for resolving relative links in mdz content. Set to a getter (e.g., () => base) so changes to the base prop are reflected without needing an effect. When the getter returns a path like '/docs/mdz/', relative paths like ./grammar resolve to /docs/mdz/grammar before rendering. When not set, relative paths use raw hrefs (browser resolves them).

mdz_components_context
#

mdz_components.ts view source

{ get: (error_message?: string | undefined) => MdzComponents; get_maybe: () => MdzComponents | undefined; set: (value: MdzComponents) => MdzComponents; }

Context for providing custom mdz components. Must be set by the application using mdz.

mdz_elements_context
#

mdz_components.ts view source

{ get: (error_message?: string | undefined) => MdzElements; get_maybe: () => MdzElements | undefined; set: (value: MdzElements) => MdzElements; }

Context for providing allowed HTML elements. Must be set by the application using mdz. By default, no HTML elements are allowed.

MdzComponents
#

mdz_components.ts view source

MdzComponents

Component registry for custom Svelte components that can be used in mdz content.

For example, registering 'Alert' allows using <Alert>...</Alert> in mdz content.

The Map values are the Svelte component constructors.

MdzElements
#

mdz_components.ts view source

MdzElements

Element registry for HTML elements that can be used in mdz content.

For example, registering 'div' allows using <div>...</div> in mdz content.

The Map values are boolean placeholders for future configuration options.

Depends on
#

Imported by
#