Chapter 4. Documentation Directory Structure | FreeBSD Documentation Portal
Description: Documentation Directory Structure explanation used in the FreeBSD Documentation Project
Keywords: directory structure,organization

# Chapter 4. Documentation Directory Structure

Files and directories in the doc/ tree follow a structure meant to:

1. Make it easy to automate converting the document to other formats.

2. Promote consistency between the different documentation organizations, to make it easier to switch between working on different documents.

3. Make it easy to decide where in the tree new documentation should be placed.

In addition, the documentation tree must accommodate documents in many different languages. It is important that the documentation tree structure does not enforce any particular defaults or cultural preferences.

## 4.1. The Top Level, doc/

There are three sections under doc/, documentation and website share the same structure.

Directory | Usage
--- | ---
documentation | Contains all the articles and books in AsciiDoc format. Contains subdirectories to further categorize the information by languages.
tools | Contains a set of tools used to translate the documentation and the website using Weblate. The Weblate instance can be found here.
shared | Contains files that are not specific to the various translations of the documentation. Contains subdirectories to further categorize the information by languages and three files to store the authors, releases and mirrors information. This directory is shared between `documentation` and the `website`.
website | Contains the FreeBSD website in AsciiDoc format. Contains subdirectories to further categorize the information by languages.

## 4.2. The Directories

These directories contain the documentation and the website. The documentation is organized into subdirectories below this level, following the Hugo directory structure.

Directory | Usage
--- | ---
archetypes | Contain templates to create new articles, books and webpages. For more information take a look here.
config | Contain the Hugo configuration files. One main file and one file per language. For more information take a look here.
content | Contain the books, articles and webpages. One directory exists for each available translation of the documentation, for example `en` and `zh-tw`.
data | Contain custom data for build the website in TOML format. This directory is used to store the events, news, press, etc. For more information take a look here.
static | Contain static assets. Images, security advisories, the pgpkeys, etc. For more information take a look here.
themes | Contain the templates in the form of `.html` files that specify how the website looks. For more information take a look here.
tools | Contain tools used to enhance the documentation build. For example to generate the Table of Contents of the books, etc.
beastie.png | This image does not need an introduction ;)
LICENSE | License of the documentation, shared and website. BSD 2-Clause License.
Makefile | The Makefile defines the build process of the documentation and the website.

## 4.3. Document-Specific Information

This section contains specific notes about particular documents managed by the FDP.

## 4.4. The Books: books/

The books are written in AsciiDoc.

For each FreeBSD book, the AsciiDoc document type (aka doctype) is `book`. Books have `part`s, each of which contains several `chapter`s.

When the document is converted to HTML 5 (using the built-in `html5` backend):

- AsciiDoc section level 0 (`=`) at the beginning of a `chapter` of a `book` will be `<h1>`

- AsciiDoc section level 1 (`==`) must be used for the first logical section of a chapter, and will be `<h2>`

- AsciiDoc section level 2 (`===`) must be used for the first logical subsection, and will be `<h3>`

– and so on. Reference: Section Titles and Levels | Asciidoctor Docs.

### 4.4.1. Physical Organization

There are a number of files and directories within the books directory, all with the same structure.

#### 4.4.1.1. _index.adoc

The _index.adoc file defines some AsciiDoc variables that affect how the AsciiDoc source is converted to other formats and list the Table of Contents, Table of Examples, Table of Figures, Table of Tables and the abstract section.

#### 4.4.1.2. book.adoc

The book.adoc file defines some AsciiDoc variables that affect how the AsciiDoc source is converted to other formats and list the Table of Contents, Table of Examples, Table of Figures, Table of Tables, the abstract section and all the chapters. This file is used to generate the PDF with `asciidoctor-pdf` and to generate the book in one `html` page.

#### 4.4.1.3. part*.adoc

The part*.adoc files store a brief introduction of one part of the book.

#### 4.4.1.4. directory/_index.adoc

Each chapter in the Handbook is stored in a file called _index.adoc in a separate directory from the other chapters.

For example, this is an example of the header of one chapter:

    ---
    title: Chapter 8. Configuring the FreeBSD Kernel
    part: Part II. Common Tasks
    prev: books/handbook/multimedia
    next: books/handbook/printing
    ---

    [[kernelconfig]]
    = Configuring the FreeBSD Kernel
    ...

When the HTML5 version of the Handbook is produced, this will yield kernelconfig/index.html.

A brief look will show that there are many directories with individual _index.adoc files, including basics/_index.adoc, introduction/_index.adoc, and printing/_index.adoc.

| Do not name chapters or directories after their ordering within the Handbook. This ordering can change as the content within the Handbook is reorganized. Reorganization should be possible without renaming files, unless entire chapters are being promoted or demoted within the hierarchy.

## 4.5. The Articles: articles/

The articles are written in AsciiDoc.

The articles are organized as an AsciiDoc `article`. The articles are divided into sections (`=`) and subsections (`==`, `===`) and so on.

### 4.5.1. Physical Organization

There is one _index.adoc file per article.

#### 4.5.1.1. _index.adoc

The _index.adoc file contains all the AsciiDoc variables and the content.

For example, this is an example of one article, the structure is pretty similar to one book chapter:

    ---
    title: Why you should use a BSD style license for your Open Source Project
    authors:
      - author: Bruce Montague
        email: brucem@alumni.cse.ucsc.edu
    trademarks: ["freebsd", "intel", "general"]
    ---

    = Why you should use a BSD style license for your Open Source Project
    :doctype: article
    :toc: macro
    :toclevels: 1
    :icons: font
    :sectnums:
    :sectnumlevels: 6
    :source-highlighter: rouge
    :experimental:

    '''

    toc::[]

    [[intro]]
    == Introduction

## 4.6. Managing Contributor Lists

The FreeBSD project recognizes contributors in several different lists in the documentation and in printed materials. This section describes how the documentation team manages changes to these lists.

### 4.6.1. Mentor and New Committer Relationship Lists

Since FreeBSD 7.0, FreeBSD has maintained three lists of contributor mentor / mentee relationships - one for source code, one for ports and one for documentation. These files are in ".dot" format, intended for use with the popular graphing toolkit graphics/graphviz available as a FreeBSD package or port.

| dot(1) is installed as part of the graphics/graphviz package or port. The dot program reads files in ".dot" format and creates a graphical image of the directed graph.

The three files often serve as a learning experience for new committers of all three teams who are instructed to add themselves, and their mentor, to the appropriate file as their first commit. Each file has a "current" section for new committers, an "alumni" section for when the commit bit is returned, and a "mentor / mentee" section showing the relationships. The format for each type of entry is explained at the top of the file.

### 4.6.2. General Contributor Lists

Contributors to FreeBSD are maintained in article format. The source file for managing the Contributors article file is located at:

    doc
     /documentation
       /content
         /{language}
           /articles
             /contributors
               _index.adoc – Contains a list of include files that apply to each section.
               _index.po – Translation page
               contrib-develinmemoriam.adoc - content of “In Memoriam” section
               contrib-develinmemoriam.po – Translation page

Copies of this contributors directory may exist in other content language directories.

Note that the file contrib-develinmemoriam.adoc is also found in this directory. See below for additional information.

The contributors/_index.adoc file is designed as a collection of include files. The include files are listed in the Hugo specific section of the source file. The section is divided into several parts with "ifdef::" statements. There is a sub-section for website output and one for non-website (including PDF) output.

The text for each section of the Contributors page contains an "include::" statement. For example, the entry for "Port Manager Alumni" is `include::{include-contrib-portmgralumni}[]`. This pulls in the text for port manager alumni into the rendered output.

To make a change, edit the appropriate include file:

    include-contrib-committers:     ~/doc/shared/contrib-committers.adoc
    include-contrib-corealumni:     ~/doc/shared/contrib-corealumni.adoc
    include-contrib-develalumni:    ~/doc/shared/contrib-develalumni.adoc
    include-contrib-portmgralumni:  ~/doc/shared/contrib-portmgralumni.adoc
    include-contrib-additional:     ~/doc/shared/contrib-additional.adoc
    include-contrib-386bsd:         ~/doc/shared/contrib-386bsd.adoc

    Also, edit the authors.adoc file:  ~/doc/shared/authors.adoc
    and any related translations.

In general, if a person is being added, there is only one edit necessary, and they can be added to the appropriate include file. If a person is being moved from "current" to "alumni" status, two edits are required - one to remove and one to insert for the appropriate files. The order of entries for all files is found in the table below.

Purpose | Section Anchor | File in ~/doc/shared/ | Order Specification
--- | --- | --- | ---
FreeBSD Developers | include-contrib-committers | contrib-committers.adoc | alphabetical order by last name
Core Team Alumni | include-contrib-corealumni | contrib-corealumni.adoc | rough reverse chronological order
Development Team Alumni | include-contrib-develalumni | contrib-develalumni.adoc | rough reverse chronological order
Ports Management Team Alumni | include-contrib-portmgralumni | contrib-portmgralumni.adoc | rough reverse chronological order
Additional FreeBSD Contributors | include-contrib-additional | contrib-additional.adoc | alphabetical order by first name
386BSD Patch Kit Patch Contributors | include-contrib-386bsd | contrib-386bsd.adoc | alphabetical order by first name
Contributors to the central server project | No include file used | contributors/_index.adoc | unordered
Direct funding | No include file used | contributors/_index.adoc | unordered
Hardware contributors | No include file used | contributors/_index.adoc | unordered
Special contributors | No include file used | contributors/_index.adoc | unordered

### 4.6.3. "In Memoriam" Section

When notifying the BSD community of the death of a community member, the following procedure should be used:

1. Use the file ~/doc/shared/authors.adoc to look up the person’s name and attribute reference, such as `{foobsd}`.

2. If they are a current member of one or more FreeBSD project teams in ~/doc/website/content/en/administration.adoc, remove all instances of their attribute reference. Also, complete the following edits:

   - ~/doc/shared/contrib-committers.adoc - Remove the attribute reference.

   - ~/doc/shared/contrib-corealumni.adoc - If they are a current member of the core team, create an entry showing start and end dates.

   - ~/doc/shared/contrib-develalumni.adoc - Add the attribute reference and dates of activity as a committer.

   - ~/doc/shared/contrib-portmgralumni.adoc - Add the attribute reference if necessary.

   - ~/doc/shared/contrib-additional.adoc - Remove the entry.

   - ~/doc/shared/contrib-386bsd.adoc - This is a historical document only. No changes are needed.

3. In the ~/doc/shared/authors.adoc file, comment out (using one backslash '\') the email address to avoid creating the email link "mailto:" See the example for `itojun` below:

       [shared/authors.adoc]

       [..]

       :itojun-name: Jun-ichiro Itoh
       :itojun-email: \itojun@FreeBSD.org
       :itojun: {itojun-name} <{itojun-email}>

       [..]

4. Since the member is deceased (which should be double checked), add them to the "In Memoriam" file contrib-develinmemoriam.adoc.

   Try to find some factual information about their contributions to FreeBSD over the years and add it with their entry in the file. This may require asking in the development mailing lists, contacting colleagues, contacting the FreeBSD Foundation, or searching through the commit logs.

   To find the date of their first commit, use:

       % cd ~/src
       % git log --reverse --author=foobsd     # search for first commit of foobsd

   This will print out their commits in reverse order. The date of the first commit will be at the top.

   Ensure that the format of the dates match other entries:

       (year of commit bit start - year of commit bit end; RIP year deceased)

       For example:

       * Foo BSD (2007 - 2010; RIP 2016)

   Check the ordering of the entries in the file.

   Purpose | Section Anchor | File in ~/doc/documentation/content/{language}/articles/contributors/ | Order Specification
   --- | --- | --- | ---
   Development Team: In Memoriam | contrib-develinmemoriam.adoc | contrib-develinmemoriam.adoc | rough reverse chronological order

   See the "In Memoriam" file for similar entries.

5. Finally, if applicable, move the committer member entry from the "current" section to the "alumni" section of the appropriate list of contributor mentor / mentee relationships along with an appropriate date. It is not necessary to change the mentor / mentee relationship.

Last modified on: August 13, 2025 by Jim Brown

Prev
Home
Next