When running in development webpack-serve You can use npm however it will not respect the yarn lock file and may install slightly different versions. This is useful to construct your own table of contents since the toc Their level in the hierarchy, and the anchor id. Returns an array of objects with the text content of all the headings in the document, Object and return a promise the resolves to a url when the image has been uploaded to a storage location, for example S3. If you want the editor to support images then this callback must be provided. > Callbacks uploadImage(file: Blob): Promise The matcher method's return value will be available on the component under Īre provided then the embed will also appear in the block menu. Optionally define embeds which will be inserted in place of links when the matcherįunction returns a truthy value. Headings and below, in this case you would set the prop to 1 Title you might want the user to only be able to create h2 For example, if you already nest the editor under a main h1 : The component that the tooltip wraps, must be renderedĪ number that will offset the document headings by a number of levels. You can use this to inject your own tooltip library into the editor – the component will be passed the following props: See the source hereĪ React component that will be wrapped around items that have an optional tooltip. The editor will use a default dark theme that's included. See the inbuilt themeįor an example of the keys that should be provided. themeĪllows overriding the inbuilt theme to brand the editor, for example use your own font face and brand colors to have the editor fit within your application. To be passed to the underlying Prosemirror instance. The editor can be used to display previously written content – headings gain anchors and links become clickable. placeholderĪllows overriding of the placeholder. Previously saved content for the user to continue editing. defaultValueĪ markdown string that represents the initial value of the editor. Is passed then the editor will default to using the location pathname. See a working example in the example directoryĪ unique id for this editor, used to persist settings such as collapsed headings. Usage import Editor from "rich-markdown-editor" Knowledge base, and whilst others are welcome to fork or use this package in your own products, development decisions are centered around the needs of Outline. Important Note: This project is not attempting to be an all-purpose Markdown editor The editor is WYSIWYG and includes formatting tools whilst retaining the ability to write markdown shortcuts inline and output plain Markdown. And can also be used for displaying content in a read-only fashion.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |