## Assembling large document collections

Amaya allows you to handle document collections. Such a collection may, for instance, represent a technical documentation constituted by several web pages. One of these pages contains the title of the whole documentation (an `H1` element), an introduction (some other elements), and a list (`OL` or `UL`) whose items contain links to each chapter. Chapters are separate documents which can also have the same type of structure.

Such an organization is useful for browsing, but it has a number of drawbacks when the whole documentation has to be printed. Amaya addresses this problem with the "make book" function. You just have to use typed links for linking chapters: associate a `rel="chapter"` or `rel="subdocument`" attribute with the anchor that refers to a chapter (select the `A` element and use the Attributes menu).

Each referred chapter or sub-document can be:

- either a whole external document,
- or just a subset of a larger external document.

To refer to a document subset, the usual manner is to define a DIV element. which delimits the part of the target document you want to include and to link to this target element.

Then, when activating the "make book" function, all blocks (`LI` elements in the above example) containing a typed link to a chapter will be replaced by the corresponding actual web pages (or web page subsets), and you will get a unique document containing the whole collection:

- when the link refers to a web page, all the BODY content of the target document is included.

- if the link refers to a target element, this element with its content is included.

- if the link refers to a target anchor, the content of the anchor is included, but not the anchor itself.

Before each replacement, the "make book" function generates a new DIV element with an ID attribute. So each added pieces are clearly separated.

Previous pieces of the new generated document could contain normal links, target anchors and target elements. During this operation, Amaya needs to check that each NAME and ID attribute values are still unique in the new document. If needed, Amaya change this values and update relative links. At the same time, external links are automatically updated when they referred an external document or document subset which is included now. For example, if the link pointed to a whole external document, this link will refer the DIV enclosing element after the operation. So the new unique document containing the whole collection is still coherent.

This large document can then be numbered and printed with a complete table of contents and a list of all links.

To activate this tool, choose the Make Book item from the Special menu.