From 7d0943a6404f60c303a1e8a845f6d532642c8895 Mon Sep 17 00:00:00 2001 From: Steve Phuc Date: Wed, 7 Aug 2019 20:49:45 +0300 Subject: [PATCH 1/2] requrie-custome-rendering --- packages/rich-text-html-renderer/README.md | 3 ++- packages/rich-text-react-renderer/README.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/rich-text-html-renderer/README.md b/packages/rich-text-html-renderer/README.md index 86876d58..be859064 100644 --- a/packages/rich-text-html-renderer/README.md +++ b/packages/rich-text-html-renderer/README.md @@ -111,7 +111,7 @@ documentToHtmlString(document, options); // -> Hello world! ``` -Last, but not least, you can pass a custom rendering component for an embedded entry: +Last, but not least, if you use `EMBEDDED_ASSET` or `EMBEDDED_ASSET` you must pass a custom rendering component for render them: ```javascript import { BLOCKS } from '@contentful/rich-text-types'; @@ -143,6 +143,7 @@ documentToHtmlString(document, options); The `renderNode` keys should be one of the following `BLOCKS` and `INLINES` properties as defined in [`@contentful/rich-text-types`](https://www.npmjs.com/package/@contentful/rich-text-types): - `BLOCKS` + - `DOCUMENT` - `PARAGRAPH` - `HEADING_1` diff --git a/packages/rich-text-react-renderer/README.md b/packages/rich-text-react-renderer/README.md index 386ecb41..8a09b922 100644 --- a/packages/rich-text-react-renderer/README.md +++ b/packages/rich-text-react-renderer/README.md @@ -33,7 +33,7 @@ const document = { nodeType: 'text', value: 'Hello world!', marks: [], - data: {} + data: {}, }, ], }, @@ -116,7 +116,7 @@ documentToReactComponents(document, options); // ->

Hello

world?

``` -Last, but not least, you can pass a custom rendering component for an embedded entry: +Last, but not least, if you use `EMBEDDED_ASSET` or `EMBEDDED_ASSET` you must pass a custom rendering component for render them: ```javascript import { BLOCKS } from '@contentful/rich-text-types'; From 3ec6b3a9e926379d62b2d6f000dfb68185a099cd Mon Sep 17 00:00:00 2001 From: Steve Phuc Date: Wed, 7 Aug 2019 21:23:45 +0300 Subject: [PATCH 2/2] Rich Text and Gatsby --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6ca5969d..55b789be 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ Text documents. - [Rich Text Concept](https://www.contentful.com/developers/docs/concepts/rich-text/) - [Getting Started](https://www.contentful.com/developers/docs/tutorials/general/getting-started-with-rich-text-field-type/) - [Migrate content to Rich Text](https://www.contentful.com/developers/docs/tutorials/general/migrate-to-rich-text/) +- [Rich Text and Gatsby](https://www.contentful.com/developers/docs/tutorials/general/rich-text-and-gatsby/) ## Get involved