Crystallize logo

Crystallize Content Transformer

Validation, parsing and transformations for Crystallize Content

Crystallize Content Transformer

Install

yarn add @crystallize/content-transformer

Validate

import validator from '@crystallize/content-transformer';

In React

import CrystallizeContent from '@crystallize/content-transformer/react';
const overrides = { link: p => <MyLinkComponent href={p.metadata.href}>{p.textContent}</MyLinkComponent>};
<CrystallizeContent {...contentModel} overrides={overrides} />

To HTML

import toHTML from '@crystallize/content-transformer/toHTML';toHtml(contentModel);

To text

import toText from '@crystallize/content-transformer/toText';toText(contentModel);