Description
"xref" knowls can be built by searching the source for all cross-references and collecting these pointers. Perhaps duplicates can be removed in a manner similar to how the EPUB image list is created without duplicates. Then only necessary knowl content need be built.
Don't forget index entries and contributors.
The "-hidden" knowls are meant to impersonate a "born-hidden" knowl that is contained within a "xref" knowl. Example: a "xref" points to a "theorem", so there is knowl content which has been sanitized of unique id's, etc. But the "proof" is born hidden as part of the original theorem, so there needs to be a knowl inside the knowl, and its content must be sanitized also. This is where the "-hidden" knowl for the proof is employed. Check to see if these are only manufactured as part of building the born-hidden knowl. Note that these "-hidden" knowls have slightly different content than the "xref" knowls.