Skip to content

Commit

Permalink
Update Docs: migrate Beta Features - Remark Plugins (#7063)
Browse files Browse the repository at this point in the history
  • Loading branch information
privatemaker authored Jan 29, 2024
1 parent 2f4540d commit 8d55122
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
17 changes: 0 additions & 17 deletions website/content/docs/beta-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,3 @@ collections:
The above config will transform the title field to uppercase and format the date field using `YYYY-MM-DD` format.
Available transformations are `upper`, `lower`, `date('<format>')`, `default('defaultValue')`, `ternary('valueForTrue','valueForFalse')` and `truncate(<number>)`/`truncate(<number>, '<string>')`




## 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 8d55122

Please sign in to comment.