peritext / peritext-old

[Deprecated] a contextualization-oriented multimodal publishing engine
Other
0 stars 1 forks source link

resolve contextualizations implementation must stay serializable #69

Closed robindemourat closed 7 years ago

robindemourat commented 7 years ago

... to keep the possibility to manipulate an accurate representation of the document

robindemourat commented 7 years ago

This means to stop storing React tags at the resolveContextualizationImplementation step in order to serialize a whole "implemented" document, that is with contextualizations resolved according to rendering settings.

For now we have this kind of things :

const figure = {
     node: 'element',
     special: true,
     tag: StaticWebsitePoster,
     props: {
       imageKey: 'posterurl',
       resource: document.resources[contextualization.resources[0]],
       captionContent,
       figureNumber: contextualization.figureNumber,
       id: figureId
     }
   };

It should become :

const figure = {
     node: 'element',
     special: true,
     tag: 'StaticWebsitePoster',
     props: {
       imageKey: 'posterurl',
       resource: document.resources[contextualization.resources[0]],
       captionContent,
       figureNumber: contextualization.figureNumber,
       id: figureId
     }
   };
robindemourat commented 7 years ago

Proper custom peritext tags should be used by the ComponentFactory module when rendering the contents.

The problem then is with the requirement of keeping the structure of contextualizers modular, in a plugin logic.

This demands to expose contextualizers' specific components at the root of the library.