Template:AuxTOC detect/doc

A template for automatically detecting an auxTOC in a mainspace entry, and to transclude it in the Index page where the template is used.

The purpose is to cut out code repetition; if an auxTOC is wrong in the front matter page and is corrected, then it will automatically transclude that to the Index due to this detection template, thus cutting out the risk of having to update two pages for exactly the same content.

The previous method was to make individual templates for this, but this is an even more streamlined approach than that was.

Usage
If an Auxiliary Table of Contents is somewhere on the front matter page of a work (not transcluded in a page!), and the front matter page is linked to anywhere in the Index, put this template in the "TOC" section of an Index page.

Example: Keeping the Peace (Morris) (original AuxTOC insertion) -> Index:Keeping the Peace.pdf (AuxTOC detect instance)