Chapter 4. Writing Documentation: Procedures and Tools

If you're worried about having to learn a lot of new tools and procedures in order to write documentation, you don't need to, because the information we've covered so far is everything you need to know to be able to contribute. Although we do have some tools we use and procedures we follow, it's not vital that everyone knows them in detail, especially when starting out.

For example, all KDE documentation is written in DocBook XML, but we're very happy to receive documentation written in plain text. There are people on the documentation team who are very familiar with DocBook, and can easily add the markup if the content is there.

Another example: if you are starting to document an application from scratch, you don't need to get the sources of the current documentation. But if you are starting from existing documentation, you don't need to know about how to get the sources, there are other means to do that.

Of course, if you want to learn about DocBook, you can. After a little practice, you will probably find that it's not as hard as it looks. And if you learn about dealing with a Subversion repository, you will be able to integrate yourself to the regular KDE development process (upload your changes, work together with other developers, etc.)

Getting the Documentation Sources

Note

If you are starting your document from scratch, you probably do not need to read this section, and may start working right now.

You are welcome to use plain text to contribute to KDE documentation. It is a great way to start, and we strongly encourage it. If you will miss the power of the DocBook format as you improve your documentation skills, then you can learn it. In the mean time, someone will manually edit the plain text to add the DocBook markup and commit it to KDE Subversion repository, removing the burden of doing most of the more complex stuff covered in this very guide. We'll take a look at writing in DocBook and using Subversion later in this document, so if you're interested, read on, but if you want to use plain text, you can go directly to the section called “Working with plain text sources”.

Documentation for KDE, like the rest of the source code, is kept in a Subversion repository. Subversion provides a way for many developers to work on the same source code (or in our case, the same documentation), and has many useful features to help with this. For example, previous versions of every file are saved so that any mistakes can be quickly backed out, if they can't be easily corrected.

The basic principle behind Subversion is simple: one server stores a definitive copy of the files making up a project. This is known as the repository. Each developer can download the files to make their own private copy, named working copy or sandbox. Using Subversion, the developers can upload their modifications to the main repository (a process called "committing") or update their own copy to reflect recent changes made by others.

There are two main ways edit the contents of a KDE document you want to improve: using plain text or DocBook.

Working with plain text sources

The docs.kde.org website displays most of the KDE documentation in HTML format, updated daily from the Subversion repository. There are two versions available in the website: the stable version and the KDE from Subversion version. You will always use the latest version of the documentation, i.e. the KDE from Subversion version.

The docs.kde.org website presents a quick and easy method of retrieving the latest version of the KDE documentation. Clicking the name of the application you want to document in the list will open the documentation in your web browser. Simply copy the text from the website to your favorite text editor, edit it , and submit the results in plain text to the KDE Documentation mailing list, . Please note that not all KDE applications are listed there. If you cannot find the documentation of the application you want to work with, then you can request it by sending a message to the KDE Documentation mailing list.

Now you know everything you need to start working. When you are finished writing, you may want to read Chapter 7, Leveraging your Newly Acquired Knowledge. Have fun!

Retrieving the DocBook sources

The latest DocBook sources are located inside the KDE repository. Now you need to find and retrieve them.

The software inside the KDE repository is divided into modules, which are used to organize the different software projects inside the repository. Modules are the top-level folders in the Subversion repository folder tree, and each one contains a group of related applications. These modules are sometimes released in binary form as packages. If you know the name of the package your application belongs to, you probably know the module name as well, as they are frequently the same. You need to know in which module your application is, to retrieve its DocBook sources. For instance, KMail is in the kdepim module, Quanta in the kdewebdev module, Cervisia in the kdesdk module and so on. If you need any help in this process, don't hesitate to ask. Each module contains a folder named "doc", and inside it, you can find the DocBook sources.

To access the repository, you can use the svn command line application or browse the KDE WebSVN website (websvn.kde.org).

The websvn.kde.org is a web based representation of the contents of the Subversion repository. It is easy to download files using websvn.kde.org, the operating system or desktop you use does not matter.

Retrieving your own working copy of the repository has many advantages. You will be able to use your working copy to create files containing the changes you made, to update your copy with changes made by other documenters, and if you get a KDE Subversion account, to upload your changes directly to the repository. But this is out of the scope of this section. Here we will show you simply how to retrieve the sources using Subversion the easiest way we can. You can get more information about these tools (they are really useful) by reading the the section called “Managing the Sources with Subversion.

Procedure 4.1. Retrieving documentation sources using WebSVN

  1. Go to http://websvn.kde.org using your favorite web browser. Let's suppose you are looking for Cervisia's documentation sources.

  2. The KDE repository is divided into trunk (also known as HEAD, where development is going on, branches, where both stable and working branches live, and tags, where you can retrieve snapshots of sources at a release. Most work for documentation goes on in trunk, so click there.

  3. The main KDE modules are in the KDE folder, so click on that.

  4. Click the "trunk" link to get the main branch listing. Click on "KDE" to get the list of modules from a KDE release.

  5. Cervisia is part of the kdesdk module (KDE software development kit module). Therefore, click the kdesdk item on the list. The contents of the kdesdk module will be displayed.

  6. Click the doc item on the list, to see the contents of the documentation folder of the module. The contents of the doc (documentation) folder will be displayed.

  7. Select the application you want to work with from the list (in our case, cervisia). All Cervisia's documentation source files will be displayed, being images or DocBook files.

  8. Now you reached the list of files that are part of Cervisia's documentation, including images and DocBook sources. The DocBook sources are files in the format *.docbook. In this case, there is only one file file in this format: index.docbook. Click this file on the list. A list of revisions (versions) of that file will be displayed.

  9. Click the download link from the revision on the top of the list. It is the most recent one. Save the file. Repeat this process with all the files you want to download.

We use KMail's documentation sources as example in the following procedures.

Procedure 4.2. Retrieving documentation sources using Subversion

  1. Check if you have the Subversion client installed (hint: enter svn in the terminal screen). If not, install the Subversion package using the tools provided by your distribution.

  2. Now it is time to download, or checkout the sources. Using Subversion, type in the terminal:

    mkdir path/to/working/folder
    cd path/to/working/folder
    svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/module/doc/application
    

    where path/to/working/folder is the folder you want to install the sources in your system, trunk/KDE/module is the application's module location in the repository and application is the application name. Remember to use small caps to type the application and module names. In our example, KMail is in the kdepim module, so you would enter:

    svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepim/doc/kmail
    

    Note that only applications which are part of a regular KDE release are under trunk/KDE/. Amarok docs, for instance, is in the multimedia module of extragear. Extragear is contains mature applications which are not part of a KDE release. To get Amarok docs, type in the terminal:

    svn checkout svn://anonsvn.kde.org/home/kde/trunk/extragear/multimedia/doc/amarok