3 ms·
Hi Mickael! Each content type consists of the following pieces: - Node (model) [1] - Component (visual representation) [2] - Converter (optional, used to map
by _mql 11y ago
Hi Mickael!
Each content type consists of the following pieces:
- Node (model) [1]
- Component (visual representation) [2]
- Converter (optional, used to map from and to XML/HTML) [3]
The verbose output for heading1 you see is just the DOM projection of the data, which is custom and can be specified in the Component implementation [2]. Often you need to add extra markup and interactive elements, so that's why for Substance content (data) is not rendered 1:1 but through a custom renderer component.
Please have a look at the examples [4], which includes minimal but functional implementations using most of the available concepts.
[1] https://github.com/substance/substance/blob/master/packages/heading/Heading.js https://github.com/substance/substance/blob/master/packages/...
[2] https://github.com/substance/substance/blob/master/packages/heading/HeadingComponent.js https://github.com/substance/substance/blob/master/packages/...
[3] https://github.com/substance/substance/blob/master/packages/heading/HeadingHTMLConverter.js https://github.com/substance/substance/blob/master/packages/...
[4] https://github.com/substance/examples#substance-examples https://github.com/substance/examples#substance-examples