In the previous attempt at subterps, the system looked at the TOC to determine which sections/appendices were in a subterp, compiling a list which were then fetched individually.
This is not an efficient approach (as it leads to multiple calls to generate a subterp) and is also not accurate. Not all interpretations fit into this model (e.g. interpretations of multiple appendices).
To solve these problems, we now take a "subtractive" approach, fetching the whole interpretation and ripping out parts we don't want.
We continue to use the TOC to help determine the subterp associated with an individual comment (needed for citations,) but have modified the method to not use the TOC layer applier. Using the TOC layer applier means we'd need to know the urls, but to know the urls, we need to know the subterps (oh, the cycles). Now, the lets-build-subparts-and-subterps-from-toc-data is its own module. Many other areas of the application (including the toc layer applier, navigation, and internal citations) make use of that module.
In the previous attempt at subterps, the system looked at the TOC to determine which sections/appendices were in a subterp, compiling a list which were then fetched individually.
This is not an efficient approach (as it leads to multiple calls to generate a subterp) and is also not accurate. Not all interpretations fit into this model (e.g. interpretations of multiple appendices).
To solve these problems, we now take a "subtractive" approach, fetching the whole interpretation and ripping out parts we don't want.
We continue to use the TOC to help determine the subterp associated with an individual comment (needed for citations,) but have modified the method to not use the TOC layer applier. Using the TOC layer applier means we'd need to know the urls, but to know the urls, we need to know the subterps (oh, the cycles). Now, the lets-build-subparts-and-subterps-from-toc-data is its own module. Many other areas of the application (including the toc layer applier, navigation, and internal citations) make use of that module.