Skip to content

Commit

Permalink
docs: update docs and changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroschmitz committed Aug 16, 2023
1 parent 8289475 commit a2ca0c3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .changeset/two-lions-guess.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@graphcms/rich-text-html-renderer': minor
---

export elements functions
Export `defaultElements`
20 changes: 20 additions & 0 deletions packages/html-renderer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ const html = astToHtmlString({
});
```

If needed, you can also import the `defaultElements` from the package and use it as a base for your custom renderers.

```js
import {
astToHtmlString,
defaultElements,
} from '@graphcms/rich-text-html-renderer';

const content = {
/* ... */
};

const html = astToHtmlString({
content: inlineContent,
renderers: {
bold: props => defaultElements.bold(props),
},
});
```

Below you can check the full list of elements you can customize, alongside the props available for each of them.

- `a`
Expand Down

0 comments on commit a2ca0c3

Please sign in to comment.