Editing Wikitext/Indexing Your Work

Index your Work

This page gives an overview of indexing WikiBooks. That is, making entries on the relevant subject pages and other category lists, so that books can be found. The content of this page is basic, though further details can be found by following the links in the See Also section at the end of the page.

All books are assigned to some subject area.. To do this, a subject entry is made on the cover page of each book, bearing the name of the subject category. In addition to this subject listing, a book can be assigned to other categories. These other categories are different in that they are cross-subject categories; that is, they could have, but need not have, books in them from more than one subject.

There are many existing cross-subject categories for this project's books, including;

  • The Alphabetical Book Classification
  • The Dewey Decimal Classification
  • The Library of Congress Classification
  • General user categories in large numbers
For example, to have the book Editing Wikitext listed in the Help subject category, the cover page was given a subject-tag that references the Help subject. This made a link automatically on the Help subject page for Editing Wikitext. In turn, the Help page was given a similar tag that listed the Help page on the Main Page. A similar method is used to assign books to any category, the only real difference being that a category-tag is used for general user categories and a subject-tag is used for subject categories.

Find Existing Categories

A page's assigned category can be found in its bottom line. As was implied in the section above , categories exist in hierarchies. The links on category pages lead to sub-categories, or eventually to the book pages themselves, so clearly, it is possible to get to any category by simply following the trail of links. However, a quicker way to access a known category is to search for it on the Search for Categories page. Follow the link to Search for Categories, then narrow the search by entering the starting letter and the category type.

Alternatively, to access any category listing just type the details into the search box on the left of any WikiBooks page. Notice that with the exception of the first character, a category's name is case sensitive; so, Category:Box Templates is not the same page as Category:Box templates.

The top level subjects can also be found on the WikiBooks Main Page. These top level subjects break down into sub-categories of subject, though users are limited in their assigned subjects to the ones that already exist. New subjects cannot be made by users, though new general categories can. Recent advice implies that subject categories can be user-modified but attempts to do so have met with difficulty; unless users can determine the methods to employ they would be best to assume that the subject hierarchy is fixed.

As a simple example of accessing the WikiBooks category, enter the word category and the category name separated by a colon, as follows:

category:wikibooks

The page will open. Click any of the links to go to the various sub-categories, and so-on for the links within these.

Books versus Sub-pages

edit

WikiBooks is organised on a book basis. The cover-page of each book is its main page, sometimes called the book page, and this page will often have user-made links in it to go to the other pages of the book. Because the making of user-links to sub-pages is of variable quality, it is apparent that there is a need for a book category, with a complete set of links to all of the pages of a book.

To build a book category, each sub-page of the book and the main page itself must have a category-tag linking it to that listing; that is, all of these tags must be the same. It is usual for the book category to have the same name as the book itself, to keep things logical. As a result, the sub-pages are always accessed by way of the user links on the main page or the automatically made links on the book category page. The book page on the other hand bears any additional tags to connect it into the indexing hierarchy. In summary, readers can use the subject listings to access the main page, that is, the book page of the book, and if necessary there is a category page called the book category where links to the pages in the book could also be found.

For example, Editing Wikitext is the name of the book containing this page and the book category has the same name. The main page has navigation hyperlinks made by the author, (not to be confused with category links), for fast access to the other pages. All of the pages have a link to the book category page. These links were made with the category-tag. For these particular sub-pages the code for the links is hidden away in templates, but you can see the usual result at the bottom of each page. Clicking any of these links leads to the book category, where, for convenience, all such pages are listed.Notice that both the main page and the book category have further links to subject pages higher in the system, but that sub-pages do not link directly to any subject page.

Note that category tags of any kind are most often typed at the end of each page, partly to avoid disrupting the page's formatting and partly so that they can be found easily. In fact, the links can be placed anywhere on a page, and can also be added as text in a template. When such a template is called into use, it is as if the category-tag were typed into the editing window. An example of such a template is used as the top section panel for Editing Wikibooks, where an additional back-link to the main page has also been added.
Technical Note:


Once the main page's subject has been assigned, and the book category built, the basic task is complete. Then, in addition to these minimum requirements, any of the book's pages can be assigned to general categories that are of further help to users; for example, an administrator might use a general category to remind of work that is required on certain books or on individual pages. There are few restrictions on the making of general categories, and these are assigned by adding an additional category tag to the page. Note that the subject assigned must be one that already exists; this differs from general categories where any required category is easily made.

Make a General Category

edit

Sometimes, despite there being many general categories, a new one is needed. This can happen when a user discovers some purpose that must not get mixed up with other existing entries. Note that it makes little difference whether a category is made before making a reference to it, or not. This section explains the details.

Assume that you have decided on the category name and its position within the category hierarchy; that is, you know the intended new category name and the name of the category that it in turn should belong to. Assume for this description that the intention is to make a general category called Sandwiches within the category Fast Food. To make sure that the Sandwiches category does not already exist, and as a constructive starting point, it is best to search for the intended name. Follow the method outlined in the above section, Find Categories, to make the search.

If the page already exists, it will be listed in the search results and you will need to think again about your choices. If it does not exist, then the search listing will include the offer to create this page. Select the link and it leads to a new editing page, already named and ready to type.

Because all of the entries are automatic, there is only one thing that needs be typed in the editing window and it is the category's own category link. Type this anywhere in the editing window, (note the underscore), and then save the page.

[[Category:Fast_Food]]

If you forget to make the reference to the higher category, or forget to save the page, then any links to the new page will not work and will appear in red. This is easily fixed by correcting the omission.

At the bottom of the saved page will be seen the category link that you have just typed. You are now ready to add pages to your new category.

Assigning to Categories

edit

As was explained in sections above, the book is assigned to an existing subject area, and the subject is restricted to those found by following links from the top level subjects. This section shows the code line to type to assign a book page to a subject and any page to a general category.

Assign the Book's Subject

edit

Having determined that there is an existing subject called Help and that it is appropriate, the home page of Editing Wikitext can be assigned to the Help subject by typing the following at the end of the editing window:

[[Subject:Help]]


Assign Pages to Categories

edit

To assign this page to the book category of Editing Wikitext in its most basic form, type the following:

[[Category:Editing_Wikitext]]


If the page being assigned is a template page, be sure that a category-tag is used and that the category link is made within the <noinclude></noinclude> tags, to avoid its being considered a part of the template's function.
Technical Note:


Multiple Categories

edit

Make separate category entries, one for each. The system will combine them for you after the save.

List Positions

edit

The default listing within a category page is alphabetical, using the first letter of the home page. In addition, the whole local address that follows the home page is displayed in a category list. This has consequences for a page that lies several directories lower in a file tree, since the whole file tree will be listed in the category list, and the sort key will suit the home page, not the sub-page. The full address text that is listed in this way cannot be changed, and this limits the usefulness of the entire process.

There is one exception to the listing rule, and that is in removing a namespace prefix, for example, from a template name. The following code could be used to categorise the Template:Caption page under Text Templates while listing only the word Caption, under 'C' instead of the 'T' that would otherwise result.

[[Category:Text_Templates|{{PAGENAME}}]]

The {{PAGENAME}} magic word is able to strip a namespace prefix from the page name. Elsewhere, it may be necessary to make a link to a category page within text; the way to do it without forcing an unwanted categorisation is to prefix the category tag with a full colon.

Note that work that is entirely confined to only one page, such as templates and other utility pieces do not have sub-directories or sub-pages; they do not suffer from this excessive listing problem. In these cases the simple notation will suffice. For these cases, the method of using a changed sort position is mentioned here for completeness. At the most general level, by adding a character after the name of the category, separated with a pipe symbol, the listing position is changed to it, but the full address is not shortened. In fact, when a word is used instead of the single character, like in the template example, its first character of the word is used for positioning.

For example, to categorise a page called Abbreviations in Latin as belonging to the Abbreviations category under 'L' instead of the default sort order under 'A', type this:

[[Category:Abbreviations|L]]

As far as is known, only one entry can be specified in this way. That is to say, a title cannot be listed under two different sections in the category.

This method makes most sense for single pages at the top-directory level since sub-pages would defeat the object with a long directory listing. The method clearly is of limited use in its present form, and a system that permits any text to be depicted in a category list is but the stuff of dreams.

See also

edit