eregs/regulations-site — pull request #548 by cmc333333 (2014-01-15 18:27:18+00:00)
Title: Subterp Re-engineering

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 parse 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.

This is missing some tests for `regulations.generator.toc` and `regulation.generator.subterp`. Will add, but I wanted to get the code out there as soon as possible.