You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run a 'kitchen sink' query to get a description of the whole document (L43)
Build a config object to pass data into the renderer (L45). Note that this object is also used to store and return state (so it should probably have a different name).
Instantiate the renderer (L57).
Give that renderer at least one docSet handler (L58, L60).
Give that docSet handler at least one document handler (L59). Multiple handlers are useful if, eg, frontmatter is to be processed differently to canonical text.
Render (L61)
Do something with the generated state in the config object (L62)
One gotcha is that JSX cannot be generated one tag at a time, instead, some type of stack is required to collect enclosed content and then wrap it with matching tags. (The Diegesis PoC does this. The PDF generator does it in most places but is simply building strings.)
Also note that, in this case, the rendering model is setting the cv reference that is used to scroll to the selected verse.
We discussed making the renderer markup agnostic, ie allowing different containers etc to be specified. This would be cool, but it might be easier to get a hardwired model working with the hook first.
The text was updated successfully, but these errors were encountered:
Also, while the initial query could probably be handled by another, existing hook, we might want to wrap the entire process, since behaviour of the model when fed the results of a different query is undefined.
The current PoC, in Diegesis, can be seen at https://github.com/Proskomma/diegesis/blob/ad625bce427af3886eb9817c61bb69334449fa65/src/pages/Browse/TextBookContent.js#L38
The main steps are
At present it does not handle some USFM features such as character styles, but this could be done, as demonstrated for HTML generation with https://github.com/Proskomma/proskomma-render-pdf
One gotcha is that JSX cannot be generated one tag at a time, instead, some type of stack is required to collect enclosed content and then wrap it with matching tags. (The Diegesis PoC does this. The PDF generator does it in most places but is simply building strings.)
Also note that, in this case, the rendering model is setting the cv reference that is used to scroll to the selected verse.
We discussed making the renderer markup agnostic, ie allowing different containers etc to be specified. This would be cool, but it might be easier to get a hardwired model working with the hook first.
The text was updated successfully, but these errors were encountered: