Markdown Components
#
InstallationYou will also need to add this CSS file:
#
Components#
MarkdownInputThis component allows you to enter Markdown content and preview it, using the React-mde editor.
Please see React-mde documentation to know what other props can be passed.
#
MarkdownFieldThis component allows you to display Markdown content in HTML. It uses the markdown-to-jsx package.
Any other props are passed down to markdown-to-jsx options.
#
Rendering React componentsBy default, all top-level titles (#
) are converted to <LargeLabel>
.
You can change this by passing an overrides props.
You can also render arbitrary React components this way. All you need to do is pass the component definition.
Now if, in your Markdown document, you enter <SayHello who="World" >
, it will render as <b>Hello World !</b>
.
#
Hooks#
useLoadLinksThis hook allows you to easily use React-mde suggestions to search for links to add to other resources.
It takes 2 parameters:
- The type of resource to search (using React-Admin data provider)
- The field to use to display the title of the resource
At the moment it is only possible to search for a single type of resource.