# GTK-Doc Manual

1.12

User manual for developers with instructions on GTK-Doc usage.

Chris
Lyttle

                chris@wilddev.net

Dan
Mueth

                d-mueth@uchicago.edu

Stefan
Kost

                ensonic@users.sf.net

GTK-Doc project

    gtk-doc-list@gnome.org

2000, 2005, 2007-2009
Dan Mueth, Chris Lyttle and Stefan Kost
2009
Jen Ockwell (jenfraggleubuntu@gmail.com)
2009
Philip Withnall (philip@tecnocode.co.uk)

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation Licence, Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the licence is included.

Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any GNOME documentation, and those trademarks are made aware to the members of the GNOME Documentation Project, the names have been printed in caps or initial caps.

1.13
18 December 2009
1.12
18 December 2009
1.11
16 Novemebr 2008
mal
GNOME doc-utils migration

## Introduction

This chapter introduces GTK-Doc and gives an overview of what it is and how it is used.

### What is GTK-Doc?

GTK-Doc is used to document C code. It is typically used to document the public API of libraries, such as the GTK+ and GNOME libraries, but it can also be used to document application code.

### How Does GTK-Doc Work?

GTK-Doc works by using documentation of functions placed inside the source files in specially-formatted comment blocks, or documentation added to the template files which GTK-Doc uses (though note that GTK-Doc will only document functions that are declared in header files; it won't produce output for static functions).

GTK-Doc consists of a number of Perl scripts, each performing a different step in the process.

There are 5 main steps in the process:

1. Writing the documentation. The author fills in the source files with the documentation for each function, macro, union etc. (In the past information was entered in generated template files, which is not recommended any more).

2. Gathering information about the code.gtkdoc-scan scans the header files of the code looking for declarations of functions, macros, enums, structs, and unions. It creates the file `module-decl-list.txt` containg a list of the declarations, placing them into sections according to which header file they are in. On the first run this file is copied to `module-sections.txt` The author can rearrange the sections, and the order of the declarations within them, to produce the final desired order. The second file it generates is `module-decl.txt`. This file contains the full declarations found by the scanner. If for some reason one would like some symbols to show up in the docs, where the full declaration cannot be found by the scanner or the declaration should appear differently, one can place enties similar to the ones in `module-decl.txt` into `module-overrides.txt`. gtkdoc-scanobj can also be used to dynamically query a library about any GtkObject subclasses it exports. It saves information about each object's position in the class hierarchy and about any GTK Args and Signals it provides.

3. Generating the "template" files. gtkdoc-mktmpl creates a number of files in the `tmpl/` subdirectory, using the information gathered in the first step. (Note that this can be run repeatedly. It will try to ensure that no documentation is ever lost.)

   Since GTK-Doc 1.9 the templates can be avoided. We encourage people to keep documentation in the code. gtkdocize supports now a `--flavour no-tmpl` option that chooses a makefile that skips `tmpl` usage totally. If you have never changed file in `tmpl` by hand, please remove the directory at once.

4. Generating the SGML/XML and HTML. gtkdoc-mkdb turns the template files into SGML or XML files in the `sgml/` or `xml/` subdirectory. If the source code contains documentation on functions, using the special comment blocks, it gets merged in here. If there are no `tmpl` files used it only reads takes docs from sources and introspection data. gtkdoc-mkhtml turns the SGML files into HTML files in the `html/` subdirectory. Files in `sgml/` or `xml/` and `html/` directories are always overwritten. One should never edit them directly.

5. Fixing up cross-references between documents. After installing the HTML files, gtkdoc-fixxref can be run to fix up any cross-references between separate documents. For example, the GTK+ documentation contains many cross-references to types documented in the GLib manual. When creating the source tarball for distribution, gtkdoc-rebase turns all external links into web-links. When installing distributed (pre-generated) docs the same application will try to turn links back to local links (where those docs are installed).

### Getting GTK-Doc

#### Requirements

Perl v5 — the main scripts are in Perl.

DocBook DTD v3.0 — This is the DocBook SGML DTD. http://www.ora.com/davenport

Jade v1.1 — This is a DSSSL processor for converting SGML to various formats. http://www.jclark.com/jade

Modular DocBook Stylesheets This is the DSSSL code to convert DocBook to HTML (and a few other formats). It's used together with jade. The DSSSL code has been customised slightly, in gtk-doc.dsl, to colour the program code listings/declarations, and to support global cross-reference indices in the generated HTML. http://nwalsh.com/docbook/dsssl

docbook-to-man — if you want to create man pages from the DocBook. The 'translation spec' has been customised slightly, to capitalise section headings and add the 'GTK Library' title at the top of the pages and the revision date at the bottom. There is a link to this on http://www.ora.com/davenport NOTE: This does not work yet.

#### Installation

There is no standard place where the DocBook Modular Stylesheets are installed.

GTK-Doc's configure script searches these 3 directories automatically:

`/usr/lib/sgml/stylesheets/nwalsh-modular` (used by Red Hat)

`/usr/lib/dsssl/stylesheets/docbook` (used by Debian)

`/usr/share/sgml/docbkdsl` (used by SuSE)

If you have the stylesheets installed somewhere else, you need to configure GTK-Doc using the option: `--with-dsssl-dir=<PATH_TO_TOPLEVEL_STYLESHEETS_DIR>`

### About GTK-Doc

(FIXME)

(History, authors, web pages, licence, future plans, comparison with other similar systems.)

### About this Manual

(FIXME)

(who it is meant for, where you can get it, licence)

## Setting up your project

The next sections describe what steps to perform to integrate GTK-Doc into your project. Theses section assume we work on a project called 'meep'. This project contains a library called 'libmeep' and an end-user app called 'meeper'.

### Setting up a skeleton documentation

Under your top-level project directory create a folder called `docs/reference` (this way you can also have `docs/help` for end-user documentation). It is recommended to create another subdirectory with the name of the doc-package. For packages with just one library this step is not necessary.

This can then look as show below:

#### Example directory structure

    meep/
      docs/
        reference/
          libmeep/
          meeper/
      src/
        libmeep/
        meeper/

### Integration with autoconf

Very easy! Just add one line to your `configure.ac` script.

#### Integration with autoconf

    # check for gtk-doc
    GTK_DOC_CHECK(1.9)

Besides checking for the required GTK-Doc version, this adds two configure switches:

1. --with-html-dir=PATH : path to installed docs

2. --enable-gtk-doc : use gtk-doc to build documentation

GTK-Doc is disabled by default! Remember to pass the option `--enable-gtk-doc` to the next `configure` run. Otherwise pre-generated documentation is installed (which makes sense for users but not for developers).

Furthermore it is recommended that you have the following line inside your `configure.ac` script. This allows `gtkdocize` to automatically copy the macro definition for `GTK_DOC_CHECK` to your project.

#### Preparation for gtkdocize

    AC_CONFIG_MACRO_DIR(m4)

### Integration with automake

First copy the `Makefile.am` from the `examples` subdirectory of the GTK-Doc sources to your project's API documentation directory (`./docs/reference/package`). If you have multiple doc-packages, repeat this for each one.

The next step is to edit the settings inside the `Makefile.am`. All the settings have a comment above that describes their purpose. Most settings are extra flags passed to the respective tools. Every tool has a variable of the form `TOOLNAME_OPTIONS`. All the tools support `--help` to list the supported parameters.

You may also want to enable GTK-Doc for the `distcheckmake` target. Just add the line shown in the next example to your top-level `Makefile.am`:

#### Enable GTK-Doc during make distcheck

    DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc

### Integration with autogen

Most projects will have an `autogen.sh` script to set up the build infrastructure after a checkout from version control system (such as CVS). GTK-Doc comes with a tool called `gtkdocize` which can be used in such a script. It should be run before autoheader, automake or autoconf.

#### Running gtkdocize from autogen.sh

    gtkdocize || exit 1

When running `gtkdocize` it copies `gtk-doc.make` to your project root (or any directory specified by the `--docdir` option). It also checks your configure script for the `GTK_DOC_CHECK` invocation.

Historically GTK-Doc was generating template files where developers entered the docs. this turned out to be not so good. Since a few versions ago, GTK-Doc can also get all the information from source comments. Since GTK-Doc 1.9 the templates can be avoided. We encourage people to keep documentation in the code. gtkdocize now supports a `--flavour=no-tmpl` option that chooses a makefile that skips `tmpl` usage totally. If you have never changed a file in `tmpl` by hand, please remove the directory at once.

### Running the doc build

After the previous steps it is time to run the build. First we need to rerun `autogen.sh`. If this script runs `configure` for you, then give it the `--enable-gtk-doc` option. Otherwise manually run `configure` with this option afterwards.

The first make run generates several additional files in the doc-dirs. The important ones are: `package.types`, `package-docs.sgml` and `package-sections.txt`.

#### Running the doc build

    ./autogen.sh --enable-gtk-doc
    make

Now you can point your browser to `docs/reference/package/index.html`. Yes, it's a bit disappointing still. But hang on; during the next chapter we tell you how to fill the pages with life.

### Integration with version control systems

As a rule of thumb, it is the files you edit that should go under version control. For typical projects it's these files: `package.types`, `package-docs.sgml`, `package-sections.txt` and `Makefile.am`.

## Documenting the code

GTK-Doc uses source code comment with a special syntax for code documentation. Furthermore, it retrieves information about your project structure from other sources. During the next section you will find all the information about the syntax of the comments.

### Documentation placement

In the past most documentation had to be filled into files residing inside the `tmpl` directory. This has the disadvantages that the information is often not updated and also that the file tend to cause conflicts with version control systems.

To avoid the aforementioned problems we suggest putting the documentation inside the sources. This manual will only describe this way of documenting code.

### Documentation comments

A multiline comment that starts with an additional `*` marks a documentation block that will be processed by the GTK-Doc tools.

#### GTK-Doc comment block

    /**
     * identifier:
     * documentation ...
     */

The 'identifier' is one line with the name of the item to which the comment is related. The syntax differs a little depending on the item. (TODO add table showing identifiers)

The 'documentation' block is also different for each symbol type. Symbol types that get parameters such as functions or macros have the parameter description first followed by a blank line (just a `*`). Afterwards follows the detailed description. All lines (outside program listings and CDATA sections) just containing a `*` (blank-asterisk) are converted to paragraph breaks. If you don't want a paragraph break, change that into `*` (blank-asterisk-blank-blank).

One advantage of hyper-text over plain-text is the ability to have links in the document. Writing the correct markup for a link can be tedious though. GTK-Doc comes to help by providing several useful abbreviations.

- Use `function()` to refer to functions or macros which take arguments.

- Use `@param` to refer to parameters. Also use this when referring to parameters of other functions, related to the one being described.

- Use `%constant` to refer to a constant, e.g. `%G_TRAVERSE_LEAFS`.

- Use `#symbol` to refer to other types of symbol, e.g. structs and enums and macros which don't take arguments.

- Use `#Object::signal` to refer to a GObject signal

- Use `#Object:property` to refer to a GObject property

- Use `#Struct.field` to refer to a field inside a structure.

If you need to use the special characters '()', '@', '%', or '#' in your documentation without GTK-Doc changing them you can use the XML entities "&lpar;", "&rpar;", "&commat;", "&percnt;" and "&num;" respectively or escape them with a backslash '\'.

DocBook can do more that just links. One can also have lists, tables and examples. To enable the usage of SGML/XML tags inside doc-comments you need to have `--sgml-mode` in the variable MKDB_OPTIONS inside `Makefile.am`.

As already mentioned earlier, GTK-Doc is for documenting public API. Thus one cannot write documentation for static symbols. Nevertheless it is good to comment those symbols too; this helps other to understand your code. Therefore we recommend to comment these using normal comments (without the second `*` in the first line). If later the function needs to be made public, all one needs to do is to add another `*` in the comment block and insert the symbol name at the right place inside the sections file.

### Documenting sections

Each section of the documentation contains information about one class or module. To introduce the component one can write a section block. The short description is also used inside the table of contents.

#### Section comment block

    /**
     * SECTION:meepapp
     * @short_description: the application class
     * @see_also: #MeepSettings
     * @stability: Stable
     * @include: meep/app.h
     *
     * The application class handles ...
     */

SECTION:<name>

  The name links the section documentation to the respective part in the `<package>-sections.txt` file. The name give here should match the <FILE> tag in the `<package>-sections.txt` file.

@short_description

  A one line description of the section that later will appear after the links in the TOC and at the top of the section page.

@see_also

  A list of symbols that are related to this section.

@stability

  A informal description of the stability level this API has. We recommend the use of one of these terms:

  - Stable — The intention of a Stable interface is to enable arbitrary third parties to develop applications to these interfaces, release them, and have confidence that they will run on all minor releases of the product (after the one in which the interface was introduced, and within the same major release). Even at a major release, incompatible changes are expected to be rare, and to have strong justifications.

  - Unstable — Unstable interfaces are experimental or transitional. They are typically used to give outside developers early access to new or rapidly-changing technology, or to provide an interim solution to a problem where a more general solution is anticipated. No claims are made about either source or binary compatibility from one minor release to the next.

  - Private — An interface that can be used within the GNOME stack itself, but that is not documented for end-users. Such functions should only be used in specified and documented ways.

  - Internal — An interface that is internal to a module and does not require end-user documentation. Functions that are undocumented are assumed to be Internal.

@include

  The `#include` files to show in the section synopsis (a comma-separated list), overriding the global value from the section file or command line. This item is optional.

FIXME having @title here, would put this title into a newly generated section file, but later would be obsolete (right?)

To avoid unnecessary recompilation after doc-changes put the section docs into the C source where possible.

### Documenting symbols

Each symbol (function, macro, struct, enum, signal and property) is documented in a separate block. The block is best placed close to the definition of the symbols so that it is easy to keep them in synchronisation. Thus functions are usually documented in the C source and macros, structs and enums in the header files.

#### Function comment block

    /**
     * function_name:
     * @par1:  description of parameter 1. These can extend over more than
     * one line.
     * @par2:  description of parameter 2
     *
     * The function description goes here. You can use @par1 to refer to parameters
     * so that they are highlighted in the output. You can also use %constant
     * for constants, function_name2() for functions and #GtkWidget for links to
     * other declarations (which may be documented elsewhere).
     *
     * Returns: an integer.
     */

Returns:

  Paragraph describing the returned result.

Deprecated:

  Paragraph denoting that this function should no be used any more. The description should point the reader to the new API.

Since:

  Description since which version of the code the API is available.

GTK-Doc assumes all symbols (macros, functions) starting with `_` are private. They are treated like static functions.

(FIXME) (stability) (glib-enums, ...)

#### Property comment block

    /**
     * SomeWidget:some-property:
     *
     * Here you can document a property.
     */
    g_object_class_install_property (object_class, PROP_SOME_PROPERTY, ...);

#### Signal comment block

    /**
     * FooWidget::foobarized:
     * @widget: the widget that received the signal
     * @foo: some foo
     * @bar: some bar
     *
     * The ::foobarized signal is emitted each time someone tries to foobarize @widget.
     */
    foo_signals[FOOBARIZE] =
      g_signal_new ("foobarize",
                    ...

#### Struct comment block

    /**
     * FooWidget:
     * @bar: some #gboolean
     *
     * This is the best widget, ever.
     */
    typedef struct _FooWidget {
      GtkWidget parent;
      /*< public >*/
      gboolean bar;
    } FooWidget;

### Useful DocBook tags

Here are some DocBook tags which are most useful when documenting the code.

To link to another section in the GTK docs:

    <link linkend="glib-Hash-Tables">Hash Tables</link>

The linkend is the SGML ID on the top item of the page to which you want to link. For most pages this is currently the part ("gtk", "gdk", glib") and then the page title ("Hash Tables"). For widgets it is just the class name. Spaces and underscores are converted to `-` to conform to SGML.

To refer to an external function, e.g. a standard C function:

    <function>...</function>

To include example code:

    <example>
      <title>Using a GHashTable.</title>
      <programlisting>
          ...
      </programlisting>
    </example>

or possibly this, for very short code fragments which don't need a title:

    <informalexample>
      <programlisting>
      ...
      </programlisting>
    </informalexample>

For the latter, GTK-Doc also supports an abbreviation: |[ ... ]|

To include bulleted lists:

    <itemizedlist>
      <listitem>
        <para>
          ...
        </para>
      </listitem>
      <listitem>
        <para>
          ...
        </para>
      </listitem>
    </itemizedlist>

To include a note which stands out from the text:

    <note>
      <para>
        Make sure you free the data after use.
      </para>
    </note>

To refer to a type:

    <type>unsigned char</type>

To refer to an external structure (not one described in the GTK docs):

    <structname>XFontStruct</structname>

To refer to a field of a structure:

    <structfield>len</structfield>

To refer to a class name, we could possibly use:

    <classname>GtkWidget</classname>

but you'll probably be using `#GtkWidget` instead (to automatically create a link to the GtkWidget page — see the abbreviations).

To emphasise text:

    <emphasis>This is important</emphasis>

For filenames use:

    <filename>/home/user/documents</filename>

## Filling the extra files

There are a couple of extra files, that need to be maintained along with the inline source code comments: `<package>.types`, `<package>-docs.sgml`, `<package>-sections.txt`.

### Editing the types file

If your library or application includes GtkObjects/GObjects, you want their signals, arguments/parameters and position in the hierarchy to be shown in the documentation. All you need to do is to list the `xxx_get_type` functions together with their include inside the `package.types` file.

#### Example types file snippet

    #include <gtk/gtk.h>

    gtk_accel_label_get_type
    gtk_adjustment_get_type
    gtk_alignment_get_type
    gtk_arrow_get_type

Since GTK-Doc 1.8 gtkdoc-scan can generate this list for you. Just add `--rebuild-types` to SCAN_OPTIONS in `Makefile.am`. If you use this approach you should not distribute the types file, nor have it under version control.

### Editing the master document

GTK-Doc produces documentation in DocBook SGML/XML. When processing the inline source comments, the GTK-Doc tools generate one documentation page per class or module as a separate file. The master document includes them and place them in a order.

While GTK-Doc creates a template master document for you, later runs will not touch it again. This means that one can freely structure the documentation. That includes grouping pages and adding extra pages. GTK-doc has now a test suite, where the master-document is also recreated from scratch. It is a good idea to look at this from time to time to see if there are some new goodies introduced there.

Do not create tutorials as extra documents. Just write extra chapters. The benefit of directly embedding the tutorial for your library into the API documentation is that it is easy to link for the tutorial to symbol documentation. Also, chances are higher that the tutorial gets updates along with the library.

So what are the things to change inside the master document? There are some placeholders (text in square brackets) there which you should take care of.

#### Master document header

    <bookinfo>
      <title>MODULENAME Reference Manual</title>
      <releaseinfo>
        for MODULENAME [VERSION]
        The latest version of this documentation can be found on-line at
        <ulink role="online-location" url="http://[SERVER]/MODULENAME/index.html">http://[SERVER]/MODULENAME/</ulink>.
      </releaseinfo>
    </bookinfo>

    <chapter>
      <title>[Insert title here]</title>

### Editing the section file

The section file is used to organise the documentation output by GTK-Doc. Here one specifies which symbol belongs to which module or class and control the visibility (public or private).

The section file is a plain test file with XML-like syntax (using tags). Blank lines are ignored and lines starting with a `#` are treated as comment lines.

The <FILE> ... </FILE> tag is used to specify the filename, without any suffix. For example, using '<FILE>gnome-config</FILE>' will result in the section declarations being output in the template file `tmpl/gnome-config.sgml`, which will be converted into the DocBook SGML file `sgml/gnome-config.sgml` or DocBook XML file `xml/gnome-config.xml`. (The name of the HTML file is based on the module name and the section title, or for GObjects it is based on the GObject's class name converted to lowercase).

The <TITLE> ... </TITLE> tag is used to specify the title of the section. It is only useful before the templates are initially created, since the title set in the template file overrides this.

You can group items in the section by using the <SUBSECTION> tag. Currently it outputs a blank line between subsections in the synopsis section. You can also use <SUBSECTION Standard> for standard GObject declarations (e.g. the functions like `g_object_get_type` and macros like G_OBJECT(), G_IS_OBJECT() etc.). Currently these are left out of the documentation. You can also use <SUBSECTION Private> for private declarations which will not be output (it is a handy way to avoid warning messages about unused declarations). If your library contains private types which you don't want to appear in the object hierarchy and the list of implemented or required interfaces, add them to a Private subsection.

You can also use <INCLUDE> ... </INCLUDE> to specify the `#include` files which are shown in the synopsis sections. It contains a comma-separated list of `#include` files, without the angle brackets. If you set it outside of any sections, it acts for all sections until the end of the file. If you set it within a section, it only applies to that section.

## Controlling the result

A GTK-Doc run generates report files inside the documentation directory. The generated files are named: `package-undocumented.txt`, `package-undeclared.txt` and `package-unused.txt`. All those are plain text files that can be viewed and postprocessed easily.

The `package-undocumented.txt` file starts with the documentation coverage summary. Below are two sections divided by blank lines. The first section lists undocumented or incomplete symbols. The second section does the same for section docs. Incomplete entries are those, which have documentation, but where e.g. a new parameter has been added.

The `<package>-undeclared.txt` file lists symbols given in the `<package>-sections.txt` but not found in the sources. Check if they have been removed or if they are misspelled.

The `<package>-unused.txt` file lists symbol names, where the Gtk-Doc scanner has found documentation, but does not know where to put it. This means that the symbol has not yet been added to the `<package>-sections.txt` file.

Enable or add the `TESTS=$(GTKDOC_CHECK)` line in Makefile.am. If at least gtk-doc 1.9 is installed, this will run sanity checks during make check run.

## Frequently asked questions

Question
Answer
No class hierarchy.
The object's `_get_type()` function has not been entered into the `.types` file.
Still no class hierarchy.
Wrong naming in section file (see explanation)
Damn, I still have no class hierarchy.
Is the object name (name of the instance struct) part of the normal section (don't put this into Standard or Private)?
No symbol index.
FIXME (<index> tag in main sgml file)
Symbols are not linked to their doc-section.
FIXME (added #,% or () ?)
A new class does not appear in the docs.
FIXME (section file, types file, main-sgml file)
A new symbol does not appear in the docs.
FIXME (section file, proper doc comment)
Parameter described in source code comment block but does not exist
Check if the prototype in the header has different parameter names to the source.
multiple "IDs" for constraint linkend: XYZ
Symbol XYZ appears twice in -sections.txt file.
Element typename in namespace '' encountered in para, but no template matches.
Version 1.1, March 2000
2000
Free Software Foundation, Inc.

    Free Software Foundation, Inc. 51 Franklin Street, Suite 330, Boston, MA02110-1301USA

Everyone is permitted to copy and distribute verbatim copies of this licence document, but changing it is not allowed.

## GNU Free Documentation Licence

### 0. PREAMBLE

The purpose of this Licence is to make a manual, textbook, or other written document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this Licence preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This Licence is a kind of copyleft, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public Licence, which is a copyleft licence designed for free software.

We have designed this Licence in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this Licence is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this Licence principally for works whose purpose is instruction or reference.

### 1. APPLICABILITY AND DEFINITIONS

This Licence applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this Licence. The Document, below, refers to any such manual or work. Any member of the public is a licencee, and is addressed as you.

A Modified Version of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A Secondary Section is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The Invariant Sections are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this Licence.

The Cover Texts are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this Licence.

A Transparent copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not Transparent is called Opaque.

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only.

The Title Page means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this Licence requires to appear in the title page. For works in formats which do not have any title page as such, Title Page means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

### 2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this Licence, the copyright notices, and the licence notice saying this Licence applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this Licence. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

### 3. COPYING IN QUANTITY

If you publish printed copies of the Document numbering more than 100, and the Document's licence notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

### 4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this Licence, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

- #### A

  Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.

- #### B

  List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five).

- #### C

  State on the Title Page the name of the publisher of the Modified Version, as the publisher.

- #### D

  Preserve all the copyright notices of the Document.

- #### E

  Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.

- #### F

  Include, immediately after the copyright notices, a licence notice giving the public permission to use the Modified Version under the terms of this Licence, in the form shown in the Addendum below.

- #### G

  Preserve in that licence notice the full lists of Invariant Sections and required Cover Texts given in the Document's licence notice.

- #### H

  Include an unaltered copy of this Licence.

- #### I

  Preserve the section entitled History, and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled History in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.

- #### J

  Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the History section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.

- #### K

  In any section entitled Acknowledgements or Dedications, preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.

- #### L

  Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.

- #### M

  Delete any section entitled Endorsements. Such a section may not be included in the Modified Version.

- #### N

  Do not retitle any existing section as Endorsements or to conflict in title with any Invariant Section.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's licence notice. These titles must be distinct from any other section titles.

You may add a section entitled Endorsements, provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organisation as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this Licence give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version .

### 5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this Licence, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its licence notice.

The combined work need only contain one copy of this Licence, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the licence notice of the combined work.

In the combination, you must combine any sections entitled History in the various original documents, forming one section entitled History; likewise combine any sections entitled Acknowledgements, and any sections entitled Dedications. You must delete all sections entitled Endorsements.

### 6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this Licence, and replace the individual copies of this Licence in the various documents with a single copy that is included in the collection, provided that you follow the rules of this Licence for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this Licence, provided you insert a copy of this Licence into the extracted document, and follow this Licence in all other respects regarding verbatim copying of that document.

### 7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an aggregate, and this Licence does not apply to the other self-contained works thus compiled with the Document , on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.

### 8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this Licence provided that you also include the original English version of this Licence. In case of a disagreement between the translation and the original English version of this Licence, the original English version will prevail.

### 9. TERMINATION

You may not copy, modify, sublicence, or distribute the Document except as expressly provided for under this Licence. Any other attempt to copy, modify, sublicence or distribute the Document is void, and will automatically terminate your rights under this Licence. However, parties who have received copies, or rights, from you under this Licence will not have their licences terminated so long as such parties remain in full compliance.

### 10. FUTURE REVISIONS OF THIS LICENCE

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation Licence from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.

Each version of the Licence is given a distinguishing version number. If the Document specifies that a particular numbered version of this Licence or any later version applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this Licence, you may choose any version ever published (not as a draft) by the Free Software Foundation.

### Addendum

To use this Licence in a document you have written, include a copy of the Licence in the document and put the following copyright and licence notices just after the title page:

> Copyright YEAR YOUR NAME.

> Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation Licence, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A copy of the licence is included in the section entitled GNU Free Documentation Licence.

If you have no Invariant Sections, write with no Invariant Sections instead of saying which ones are invariant. If you have no Front-Cover Texts, write no Front-Cover Texts instead of Front-Cover Texts being LIST; likewise for Back-Cover Texts.

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software licence, such as the GNU General Public Licence, to permit their use in free software.