Project:Handbook/Handbook Development

Handbook on the wiki
The Gentoo handbook has been moved to the Gentoo Wiki. This move allows:


 * Developers to easily update the important parts of the Gentoo handbook (instead of relying on the documentation project developers)
 * The further run-down of the GuideXML format used by Gentoo (and thus optimization of infrastructure resources)
 * Consolidation of all documentation on a single platform (the Gentoo Wiki) which also ensures a common interface and writing style
 * Simpler links to the handbook

The handbook is within its own namespace (namely Handbook:). Currently, only developers and trusted contributors have edit rights on this namespace.

Architectural consolidation
In order to support the architectural consolidation of the handbook sections, we use the transclusion support of MediaWiki. All resources that are common to all architectures are available as subpages of the Handbook:Parts page. The architecture-specific handbooks include these subpages in their own location. For instance, Handbook:AMD64/Installation/About pulls in Handbook:Parts/Installation/About without any additional modifications.

When architecture-specific information is needed, it is first read in through the architecture-agnostic page. For instance, the Handbook:Parts/Installation/Media, which is included in the AMD64 handbook through Handbook:AMD64/Installation/Media, pulls in the hardware requirements block (Handbook:AMD64/Blocks/HWReqs). The following blocks need to be created for each and every architecture handbook:


 * Blocks/HWReqs : Used in the chapter on installation media and shows the hardware requirements for that platform
 * Blocks/Booting : Used in the chapter on installation media and shows the boot options as well as boot procedure of the installation media for that platform
 * Blocks/Disks : Used in the chapter on partitioning and informs the user how to partition the disks
 * Blocks/ProfileChoice : Used in the chapter on installing the base system and informs the user about the available Gentoo profiles
 * Blocks/Kernel : Used in the chapter on configuring the kernel, informing the user about how to configure the kernel for the given platform
 * Blocks/Bootloader : Used in the chapter on configuring the boot loader and informs the user about how to install and configure the boot loader for the given platform

Beyond these blocks, no architecture-specific information is (at the time of writing) necessary. This can be modified as more architecture-specific instructions and handbooks are being moved to the wiki though, so consider this a work-in-progress.

Architectural parameters
The general, architecture-agnostic pages can refer to some architecture-specific parameters. Like was the case in the historical previous driven Handbooks, each main Handbook page (such as Handbook:AMD64) defines a some of parameters that can be used in the Handbook.

The current set of parameters are:

These parameters should be defined something like the following in the main (base) page of each architecture's handbook:

Inside the pages themselves, the the following template can be used to ask Semantic MediaWiki generate the contextually appropriate variable values:

Adding new parameters
New parameters can be added by creating a new Property for the appropriate type of data. In most cases this will likely be a text property.

TOC and navigator
Each chapter in the handbook will refer to the table of contents (Handbook:Parts/TOC) which acts as a structure for readers to easily see where in the handbook they are currently positioned.

At the end of each chapter, a navigator (Handbook:Parts/Navigator) is added which takes two options:  and   which are the links to the previous and next chapter. Before the navigator is sourced, the page title is set:

Translation teams can copy the Handbook:Parts/Navigator/de content and include that content in the page itself, making sure that the  parameter to set the translated value of "Home".

New architecture requirements
New handbooks should only be made available when the newly supported architecture can be structured and installed in a fashion similar to the current handbooks. This means that the architecture:


 * Must support installation through Gentoo official installation media (currently ISO files either burned to CD/DVDs or USB bootable disks).
 * Use the location on the distfile mirrors.
 * Support manual and configuration of the kernel, and/or a distribution binary kernel such as.
 * If only a customized binary kernel (such as a kernel with device tree support ( CONFIG_OF ) - which is necessary to support certain devices connected to ARM64-based Raspberry Pi boards - for example) is supported, then it must be explicitly noted.

Translating
The Gentoo handbook is marked ready for translations. However, through the use of transclusion and Semantic MediaWiki a few guidelines are in place.

Transclusion
When encountering a request for a transclusion, first make sure that the target page is already translated.

For instance, in Handbook:AMD64/Installation/About only a transclusion of Handbook:Parts/Installation/About is shown:

In this case, first translate the transcluded page. This should result in a language-specific page (such as Handbook:Parts/Installation/About/en for the (trivial) English translation).

In the architecture-specific page, the transclusion then refers to the translated page:

Noinclude tags
During translations, sometimes a dangling noinclude tag might show up. If that is the case, then this tag may not be part of the translation. Instead, make this an empty translation block.

This is a result of the combination of translations and transclusions.

Titles
To support setting the title for a translated page, the  code is added to all master pages. This code includes all necessary logic to set the title of a page.

All it needs is the title inside a Has short Title and Has Title definition. These can be added right before the navigator tag, like so:

There is no need to include the DISPLAYTITLE directive inside the translation tags. If a warning is displayed about multiple DISPLAYTITLE entries, add the  option to the DISPLAYTITLE directive like so:

Overview
The following is an overview of the structure of a handbook (and could act as a simple ordered listing for translators to focus on).