Markdown Editor Kit

index

index

Interfaces

InterfaceDescription
MdKitDocumentAdapterStorage contract the document hooks talk to. Implement it over tRPC, REST, or anything else; only readDocument/writeDocument are required, the checkpoint methods are optional and enable version-history UI.

Type Aliases

Variables

VariableDescription
CheckpointPolicyFactories for the policy that decides when a saved document becomes a checkpoint. Pass the result to createMdKitBackend, not to your store.
defaultMdKitEditorTheme-
darkMdKitEditorTheme-
yjs-

Functions

FunctionDescription
useMdKitCollaborationCreates a Hocuspocus/Yjs collaboration session for MdKitEditor, managing the provider connection, local participant, and presence.
measureMdKitEditDistance-
normalizeMdKitVersionToken-
detectMdKitDocumentConflict-
createMdKitDocumentRecord-
writeMdKitDocumentRecord-
restoreMdKitDocumentVersion-
MdKitConflictPanelBase panel for resolving a save conflict. Previews remote and local content and keeps one side. Renders null when the document has no conflict.
MdKitDocumentToolbarUnstyled workflow controls for a connected document: save/collaboration status plus entry points for version history and conflict resolution. Starter UI — drop it for your own controls when it doesn't fit.
useMdKitDocumentConnects an editor to a storage adapter: loads the document, debounces autosave, tracks dirty/save status, and surfaces conflicts for resolution.
MdKitEditorMarkdown-first rich text editor. Behaves like a controlled textarea in local mode and switches to a Yjs-backed engine when given a collaboration session.
MdKitViewRead-only markdown surface that mirrors MdKitEditor's styling and sizing contract without mounting the editor runtime. Use it for previews and restored checkpoints.
parseYamlFrontMatter-
extractYamlFrontMatter-
hasYamlFrontMatter-
removeYamlFrontMatter-
prependYamlFrontMatter-
MdKitThemeEditorOptional controls for editing an MdKitEditorTheme. Intended for theme builders, docs, and debug tools rather than production editing surfaces.
createMdKitEditorThemeStyle-
createMdKitRestAdapterBuilds an MdKitDocumentAdapter that talks to the mdkit REST endpoint shape. Restore is not part of the adapter contract, so REST restore needs a separate call from application code.
VersionHistoryPanelRenders checkpoint history from useMdKitDocumentVersions and invokes the host's restore handler for a chosen checkpoint.
useMdKitDocumentVersionsLists a document's checkpoints and lazily reads checkpoint detail, tracking loading state for checkpoint-history UI.

On this page