DirectiveDescriptor interface
Implement this interface to create a custom editor for markdown directives. Pass the object in the directivesPlugin
parameters.
Signature:
export interface DirectiveDescriptor<T extends Directive = Directive>
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
attributes | string[] | The attributes that the directive has. This can be used when building the UI for the user to configure a directive. The GenericDirectiveEditor uses those to display a property form. | |
Editor | React.ComponentType<DirectiveEditorProps<T>> | The React component to be used as an Editor. See DirectiveEditorProps for the props passed to the component. | |
hasChildren | boolean | Whether or not the directive has inner markdown content as children. Used by the GenericDirectiveEditor to determine whether to show the inner markdown editor. | |
name | string | The name of the descriptor - use this if you're building UI for the user to select a directive. | |
type? | 'leafDirective' | 'containerDirective' | 'textDirective' | (Optional) The type of the supported directive. Can be one of: 'leafDirective' | 'containerDirective' | 'textDirective'. |
Methods
Method | Description |
---|---|
testNode(node) | Whether the descriptor's Editor should be used for the given node. |