Wikibooks:Categories

Wikibooks uses several methods of page organization, the easiest of which are categories. This page discusses how to categorize pages properly.





Purpose
Categories achieve three main goals in the organization of books:


 * 1) Categories serve as "book binders"; holding all pages or chapters of a book together in their own category.
 * 2) Categories sort books by subject matter. Thus, the "book binders" of all books on a subject will appear in a particular category. This allows navigation through all books from general to the most specific subjects.
 * 3) Categories serve to identify problem areas so that people can help improve books and the Wikibooks project.

Categories also allow automated lists of related pages to be compiled, because any changes to a category will cause any lists depending on the category to be updated as well. The most common example of this is in the construction of subject pages.

The sections below explain how to categorize books using the different methods to ensure books can be easily found.

Books
A book category is a category that indexes all pages, templates and media of a single book. Each book should have its own book category.


 * What to do:


 * For each page of the book, other than its main page, just place BookCat at the bottom of the page. Alternatively, place BookCat inside any template intended to be used on all pages of the book, which takes care of all the pages that use that template.  It does no harm to do both, and no harm if BookCat ends up on the main page of the book (which might easily happen by accident if a template containing BookCat is also used on the book main page).


 * How it works:


 * Book categories use names based on the name of the book itself, with a prefix . For example, the book category for a book titled "Cryptozoology" should be "Category:Book:Cryptozoology". Books and book categories should be categorized by subject using all the same subject categories (we'll discuss subject categories next).


 * Historically, book categories didn't have a prefix, so the book category for title "Cryptozoology" would be "Category:Cryptozoology".  We are slowly converting to the new naming convention; many pre-existing book categories on the site use the old convention.


 * The BookCat device automatically deduces, from the name of the page it is on, what book it's in, files the page it is on into the book's category, and sorts the pages inside that category by the portion of the page name following the name of the book. As a result, the book category provides an alphabetical index of all the book's pages.


 * Template BOOKCATEGORY produces the name of the book category of the book associated with the page on which it occurs; or, you can provide it with a page name as a parameter,, and it will produce the name of the book category of the book associated with &lt;page name&gt;. Currently, BOOKCATEGORY can detect whether a given book uses the old or new convention for book-category names; and it would also presumably handle any future change in the naming convention (if such a thing should ever happen).

Subjects
A subject category is a category that groups together books on a related topic.


 * What to do:


 * On the main page of each book, place at the bottom of the page, replacing "..." with one or more names of subjects, separated by "pipe" characters (the vertical bar, like the one just before the "..." in the example:   ).


 * Books should only be added to subjects as specific as possible. For example, the book Music Theory is located in Subject:Music theory, but not in Subject:Music, because musical theory is a more specific topic than music. Most books only belong to one or two subjects; use multiple subjects only to aid in finding books that are legitimately important to several subject areas and not used to simply advertise new books.  Subjects are used to help make finding books easier, so proper filing of books in subjects is important.


 * Examples: at this writing, book Modern History has, while book HydroGeoSphere has.


 * How it works:


 * Subject categories use names based on the name of the subject, with a prefix .  Subject names use sentence casing because, unlike books, the name of a subject is not a title.  For example, the subject category for Subject:Music theory would be :.  A subject should only be created when there are multiple books that can be added to it.


 * Each subject has three pages associated with it:
 * a subject page, called "Subject:&lt;name&gt;", which is the primary place to go for topic &lt;name&gt;. The subject page explains what the subject is about; says what other subject or subjects this one is contained in, and what other subjects are contained in this one; lists books on this subject by how complete they are; and lists featured books on this subject.  The book lists include books in subsections as well as books filed directly in that subject.  The very biggest subjects, like Subject:Mathematics, list subsections but not books, because the list of books would be so awkwardly long.
 * a subject category, called "Category:Subject:&lt;name&gt;", which contains just those books that are filed specifically under that subject. This page echoes the information display from the subject page.
 * an internal category, whose page is not meant to be publicly viewed, called "Category:Subject:&lt;name&gt;/all books", which contains all books filed under the subject or any other subject contained within it.
 * The subjects template on a book main page knows what subjects the book should be filed under. Each subject page has information on it naming the one or two parent subjects containing that subject.  The various pages share information between them automatically to populate the internal categories, which enable the subject pages &mdash; and the subject categories &mdash; to list books in all subsections as well as books filed directly in the subject.

Projects
A project category is a category for associating several related books with a particular project. For instance, all books written for a single course curriculum (science, math, and language books). For these situations, you should add all the related books into the necessary project categories.

Organizational
Wikibooks uses a number of other organizational schemes, such as an Alphabetical listing and a Reading Levels system. Each of these organization systems use categories to produce lists of books.

Subcategories
A subcategory is a category that links to one or more other categories through the use of the category system, effectively creating a parent-child relationship. All categories should be a subcategory of one or more other categories, except for the root category. By using subcategories, we can all navigate through the category system faster and more effectively to find the book, page, image, or template we are looking for.

Subcategories should only be created as needed, such as dividing a large subject or book category in order to find books or pages more quickly. Any new category created for this purpose should have a good descriptive name that shares some common characteristics with the larger category name. For example, Category:Subject:Music theory is a subcategory of Category:Subject:Music and effectively describes a common relationship between the two categories. Another example is Category:Subject:Algebra and Category:Subject:Mathematics.

Book subcategories are also sometimes used; for instance, if a book is not using a flat structure and consists of several chapters with many subpages in each one, can be placed on the pages of the book or in a template placed on those pages to create subcategories of the form. Then simply add BookCat to those subcategories to automatically place them in the root book category of the book.

How categories work
Pages are listed in categories by adding a category link on pages (usually at the bottom). For example, this project was listed in Category:Categories by adding:



The subpagename magic word helps organize category pages by sorting pages by name. This can be particularly useful for books since all pages begin with the book name.

Now say you were looking for information on animal behavior. In this case, there is only one distinct path to find books on the subject:


 * Category:Categories (organizational category)
 * Category:Subject:Books by subject (organizational category)
 * Category:Subject:Science (subject category)
 * Category:Subject:Biology (subject category)
 * Category:Subject:Zoology (subject category)

If you wanted Animal Behavior to be found here, you would need to add BookCat to the bottom of each page, add to Animal Behavior, and add BookCat to Category:Book:Animal Behavior. (In this case, BookCat figures out that the page it's on is a book category, and looks at the book's main page to see what subjects it belongs to.) By now you should be starting to understand how Zoology is added to Biology, and so on.

In general, categories go from the most general to the most specific category. You can link to a category by adding:


 * display text