Skip to content

Commit

Permalink
Update Docs: migrate Beta Features - Remark Plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
privatemaker committed Jan 23, 2024
1 parent 29ccb13 commit 20ac1a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
15 changes: 0 additions & 15 deletions website/content/docs/beta-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,3 @@ will open the editor for a new post with the `title` field populated with `first
with `second` and the markdown `body` field with `# content`.

**Note:** URL Encoding might be required for certain values (e.g. in the previous example the value for `body` is URL encoded).


## Remark plugins

You can register plugins to customize [`remark`](https://github.com/remarkjs/remark), the library used by the richtext editor for serializing and deserializing markdown.

```js
// register a plugin
CMS.registerRemarkPlugin(plugin);
// provide global settings to all plugins, e.g. for customizing `remark-stringify`
CMS.registerRemarkPlugin({ settings: { bullet: '-' } });
```
Note that `netlify-widget-markdown` currently uses `remark@10`, so you should check a plugin's compatibility first.
14 changes: 14 additions & 0 deletions website/content/docs/widgets/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ This would render as:
![Markdown widget example](/img/widgets-markdown.png)
*Please note:* The markdown widget outputs a raw markdown string. Your static site generator may or may not render the markdown to HTML automatically. Consult with your static site generator's documentation for more information about rendering markdown.
### Remark plugins
You can register plugins to customize [`remark`](https://github.com/remarkjs/remark), the library used by the richtext editor for serializing and deserializing markdown.

```js
// register a plugin
CMS.registerRemarkPlugin(plugin);
// provide global settings to all plugins, e.g. for customizing `remark-stringify`
CMS.registerRemarkPlugin({ settings: { bullet: '-' } });
```
Note that `netlify-widget-markdown` currently uses `remark@10`, so you should check a plugin's compatibility first.

0 comments on commit 20ac1a3

Please sign in to comment.