Template:Subjects/leaf/doc

This template adds the current page (presumed to be the main page of a book) to a specified subject category, and tries to add it to the allbooks categories of that subject and all that subject's ancestors.

Usage
There are two parameters, one required and non-blank, the other optional. Only addition to the named subject,, is done within this template; population of allbooks categories is delegated to Subjects/0.
 * &mdash; Required. Names the subject to add the book to.
 * &mdash; Optional. If blank, error conditions result only in addition of the book to hidden Category:Attention needed (allbooks).  If non-blank, diagnostic messages are also generated, with suggested remedies and buttons for effecting them.

This template is also responsible for populating Category:Books with book name as subject.