Introduction
Sanity uses a proprietary JSON format called Portable Text. When you export content to Sanity, Cloudpress will automatically convert the content to the correct Portable Text format. It will convert your text with the formatting, headings, tables, code blocks, etc. However, you may want to export custom content not supported by Cloudpress. For example, Sanity has Portable Text blocks such as the geopoint and file blocks, for which there is no corresponding representation in Google Docs and Notion.
geopoint
and file
block your content and have Cloudpress export it correctly to Sanity.
Get the JSON representation of your Portable Text blocks
First, you must get the JSON representation of the Portable Text block(s) you want to export. Create an empty item in Sanity containing the Portable Text elements to export - in this example, ageopoint
and file
block.



body
property is an array that contains two objects that represent the geopoint
and file
blocks. To copy the JSON for a block, highlight the JSON code for the block you want to include in your Raw Content Block and copy it to the clipboard.
For example, here is the JSON of the geopoint
:
geopoint
and the file
.
Export your custom Portable Text
To export the Portable Text elements, you must define a raw content block using the@@begin_raw_content
and @@end_raw_content
processing directives.
- Denote the start of a raw content block by by adding the
@@begin_raw_content
directive to your document. - After that, add the JSON for the Portable Text element(s)
- Finally, close off a raw content block, use the
@@end_raw_content
directive.

@@begin_raw_content
and @@end_raw_content
directives as raw content and will export it to Sanity as-is. It is therefore important that the content you specify is valid JSON. If not, Sanity will prevent Cloudpress from exporting the content.
When the document in the screenshots above is exported to Sanity, it will result in the correct Portable Text content being created.
