<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD Docbook XML V4.5//EN"
 "file:///usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd">

<article lang="en">

<articleinfo>
	<title>
	How to write a manual for a GNOME application with DocBook
	</title>
	<author>
		<firstname>Manuel</firstname>
		<surname>Rego Casasnovas</surname>
		<email>mrego@igalia.com</email>
	</author>
	<copyright>
		<year>2008</year>
		<holder>Manuel Rego Casasnovas</holder>
	</copyright>
	<legalnotice>
		<para>Some rights reserved. This document is distributed under
		the Creative Commons Attribution-ShareAlike 3.0 licence,
		available in
		<ulink url="http://creativecommons.org/licenses/by-sa/3.0/" />
		</para>
	</legalnotice>
</articleinfo>

<abstract>

<para>
This article is a guide about how to write help manuals for GNOME applications
using DocBook as standard tool. This manual explains the right way to add a
tutorial on a GNOME project, as well as the process to translate it.
The integration process to add a new option in application menu that shows the
help manual, is also explained in this article.
</para>

</abstract>


<sect1 id="introduction">
<title>Introduction</title>
<para>
A manual explains how to use a particular program. It is a very good method of
transferring knowledge. Moreover, a tutorial is usually more interactive and
specific than a book, and could be used as a part of learning. Besides, a manual
is usually updated to the last versions of an application, while books are
quickly old-fashioned.
</para>
<para>
So if you are a user of a GNOME application that do not have a manual right
know, you can easily write it and integrate in the application following this
guide.
</para>
<para>
In order to write the manual you will need to use DocBook, a markup language to
write technical documentation. If you are a newbie on this kind of tools you
could need more time to write the tutorial, anyway with this how-to you will be
able to do it for yourself.
</para>
<para>
The last step will be integrate the written manual, as the application help,
adding an option into program menu to show that help. For this process is needed
to do some changes on the source code, but the whole process is documented with
this guide.
</para>
<para>
Finally, this article gives an overview about how to translate a manual of a
GNOME application written with DocBook, this translation it will be also
integrated with the application.
</para>
</sect1>


<sect1 id="writing_the_manual">
<title>Writing the manual</title>
<para>
First of all, you should know that exists a
<ulink url="http://live.gnome.org/DocumentationProject">GNOME Documentation
Project</ulink> managed by a team and with the support of the community. In its
web page you can find a lot of links and information related with how to write
documentation for any GNOME project, from developer documents to user manuals.
</para>
<para>
As any free software community you could be part of that team and contribute
with your time documenting some GNOME applications, they will be glad about your
collaboration.
</para>

	<sect2 id="style_guide">
	<title>Style guide</title>
	<para>
	Before start to write the manual you should read <ulink
	url="http://library.gnome.org/devel/gdp-style-guide/stable/">the style
	guidelines</ulink>, in order to keep a common style appearance in all
	the documents related with the GNOME project. You can find this guide
	and many others at <ulink url="http://library.gnome.org/devel/guides">
	GNOME Documentation Library web page</ulink>.
	</para>
	<para>
	Anyway, just in case you can not read it, the next list tries to
	summarize the main advices extracted from the guide:
	<itemizedlist>
		<listitem>
		<para>A good technical documentation has to be comprehensive,
		conformant, clear, consistent and concise.</para>
		</listitem>
		<listitem>
		<para>There are four golden rules:
			<itemizedlist>
				<listitem>
				<para>Limit each sentence to less than 25
				words.</para>
				</listitem>
				<listitem>
				<para>Limit each paragraph to one topic.</para>
				</listitem>
				<listitem>
				<para>Provide instructions rather than
				descriptions.</para>
				</listitem>
				<listitem>
				<para>Write in a neutral tone.</para>
				</listitem>
			</itemizedlist>
		</para>
		</listitem>
		<listitem>
		<para>Use screenshots only when they are really needed.</para>
		</listitem>
		<listitem>
		<para>Review the list of agreed terminology for use in GNOME
		documentation.</para>
		</listitem>
	</itemizedlist>
	</para>
	<para>
	If you like that your work, the application help manual, to be included
	on future releases of that program, you should take care to follow the
	standards defined in the style guide. Otherwise, the application
	developers could not accept your collaboration, so this guide is very
	important and is highly recommended reading it.
	</para>
	</sect2>

	<sect2 id="docbook">
	<title>DocBook</title>
	<para>
	In order to write a standard manual for a GNOME application you have to
	use <ulink url="http://www.docbook.org/">DocBook</ulink>. DocBook is a
	language for writing structured documents using XML, currently
	maintained by <ulink url="http://www.oasis-open.org/">OASIS
	(Organization for the Advancement of Structured Information Standards)
	</ulink>.
	</para>
	<note>
	<para>
	If you already know this system you can skip this section,
	anyway it includes only a few references about how to write
	documentation with DocBook.
	</para>
	</note>
	<para>
	Documents in DocBook are just simple XML files with some special tags,
	these tags define the structure of the document. The writer do not have
	to take care about the final appearance of the document, and he can be
	centered only on the content. This is the main advantage of this kind
	of systems to write documentation, like DocBook or LaTeX. Moreover the
	final result could be published in a lot of different formats (HTML,
	PDF, RTF, etc.)
	</para>
	<para>
	You do not need any special editor to write a document in DocBook, just
	use your favorite text or XML editor. However, in order to generate the
	final document you need some tools that will be explained at <xref
	linkend="compiling" />.
	</para>
	<para>
	There are a lot of references about DocBook on the web, but the most
	important are at <ulink url="http://www.docbook.org/">the official
	website</ulink>.
	</para>
	<para>
	In the next list you can see the most common tags that you need to write
	an application manual for a GNOME application, from more to less used:
	</para>
	<variablelist>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/para.html">
			para</ulink></systemitem></term>
			<listitem>
				<para>
				Defines a paragraph, almost every text in
				DocBook is enclosed in a paragraph.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/title.html">
			title</ulink></systemitem></term>
			<listitem>
				<para>
				Title text of a section or other block elements.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/sect1.html">
			sect1</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/sect2.html">
			sect2</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/sect3.html">
			sect3</ulink></systemitem></term>
			<listitem>
				<para>
				These tags are used to define the document
				sections. The top level sections are tagged with
				<systemitem>sect1</systemitem>, subsections with
				<systemitem>sect2</systemitem> and
				subsubsections with
				<systemitem>sect3</systemitem>.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/itemizedlist.html">
			itemizedlist</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/orderedlist.html">
			orderedlist</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/variablelist.html">
			variablelist</ulink></systemitem></term>
			<listitem>
				<para>
				Define different kind of lists: a simple list,
				an ordered list or a definition list.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/xref.html">
			xref</ulink></systemitem></term>
			<listitem>
				<para>
				Internal cross reference in the document.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/ulink.html">
			ulink</ulink></systemitem></term>
			<listitem>
				<para>
				External reference to any link outside the
				document.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/caution.html">
			caution</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/important.html">
			important</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/note.html">
			note</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/tip.html">
			tip</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/warning.html">
			warning</ulink></systemitem></term>
			<listitem>
				<para>
				Some types of messages set off from the text.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/application.html">
			application</ulink></systemitem></term>
			<listitem>
				<para>
				To mark a program name.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/command.html">
			command</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/option.html">
			option</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/parameter.html">
			parameter</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/replaceable.html">
			replaceable</ulink></systemitem></term>
			<listitem>
				<para>
				These tags define the name of an executable
				program with the different possible options and
				arguments.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/screenshot.html">
			screenshot</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/mediaobject.html">
			mediaobject</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/imageobject.html">
			imageobject</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/textobject.html">
			textobject</ulink></systemitem></term>
			<listitem>
				<para>
				These set of tags are used to add screenshots in
				the tutorial.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/menuchoice.html">
			menuchoice</ulink></systemitem></term>
			<listitem>
				<para>
				Define the selections needed to be done from a
				menu.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/guibutton.html">
			guibutton</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/guiicon.html">
			guiicon</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/guilabel.html">
			guilabel</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/guimenu.html">
			guimenu</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/guimenuitem.html">
			guimenuitem</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/guisubmenu.html">
			guisubmenu</ulink></systemitem></term>
			<listitem>
				<para>
				Tags to reference different things related with
				the Graphical User Interface (GUI) of the
				application.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/keycap.html">
			keycap</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/keysym.html">
			keysym</ulink></systemitem></term>
			<term><systemitem><ulink url="http://www.docbook.org/tdg/en/html/keycombo.html">
			keycombo</ulink></systemitem></term>
			<listitem>
				<para>
				Different tags to talk about keys on a keyboard.
				</para>
			</listitem>
		</varlistentry>
	</variablelist>
	<para>
	Finally, DocBook allows to define entities in order to assign a name
	to some chunk of data. For example, these entities give the possibility
	to divide a document in different files.
	</para>
	<para>
	You can define entities with something like the following line:
	</para>
	<screen><![CDATA[
<!ENTITY app "<application>MY-GNOME-APPLICATION</application>">
	]]></screen>
	<para>
	GNOME manuals always define some entities that
	you should use in your document, for example you could refer to the
	application with <systemitem>&amp;app;</systemitem>.
	</para>
	<para>
	Other entities are already defined to use some special characters, for
	example <systemitem>&amp;lt;</systemitem> for &lt; or
	<systemitem>&amp;amp;</systemitem> for &amp;.
	</para>
	</sect2>

	<sect2 id="templates">
	<title>Templates</title>
	<para>
	The GDP (GNOME Documentation Project) provides some DocBook templates
	to write GNOME tutorials, in order to avoid start a manual from an
	empty document. You can download these templates at <ulink
	url="http://developer.gnome.org/projects/gdp/templates.html">GDP
	Document Templates</ulink> or <ulink
	url="http://svn.gnome.org/viewvc/gnome-doc-utils/trunk/data/templates/">
	GNOME Doc Utils repository</ulink>.
	</para>
	<para>
	There are three available templates:
	<itemizedlist>
		<listitem>
		<para>Applet Template: For GNOME applets (smaller
		applications).</para>
		</listitem>
		<listitem>
		<para>Application Template: For GNOME applications.</para>
		</listitem>
		<listitem>
		<para>Legal Info Template: A section with legal notes that is
		included by both templates above.</para>
		</listitem>
	</itemizedlist>
	</para>
	<para>
	The next list enumerate some things that all the manuals should have,
	all of them are included in the standard templates:
	<itemizedlist>
		<listitem>
		<para>Sections identifiers: All the sections of the document
		should have an unique identifier to allow cross-reference.
		</para>
		</listitem>
		<listitem>
		<para>Authors names: The manual should contain information about
		all the authors that have worked on the document.</para>
		</listitem>
		<listitem>
		<para>Copyright information: Documents should have a copyright
		notice and a license allowing free redistribution.</para>
		</listitem>
		<listitem>
		<para>Revision history: Every manual should keep the history of
		all versions.</para>
		</listitem>
		<listitem>
		<para>Application version: The tutorial should identify the
		application version for which the document is written.</para>
		</listitem>
		<listitem>
		<para>Publisher name: All GNOME documents must include as
		publisher the GNOME Documentation Project.</para>
		</listitem>
		<listitem>
		<para>Software license: The manual should include information
		about the software license.</para>
		</listitem>
		<listitem>
		<para>Bug reporting: All documents should give a way for
		reporting bugs or comments about the documentation.</para>
		</listitem>
	</itemizedlist>
	</para>
	<para>
	To sum up, the best way to write a good manual for a GNOME application
	is to use a template, as base document, and make all the needed
	modifications on the template.
	</para>
	</sect2>

</sect1>

<sect1 id="compiling">
<title>Compiling the manual</title>
<para>
At this moment, you could have already written an application manual following
a template provided by GDP. However, you have not seen anything related with
the final result, you only have seen a XML file with tags and texts. You will
need to install some tools in order to can see the output of your tutorial,
checking that everything is right.
</para>

	<sect2 id="install_packages">
	<title>Install packages</title>
	<para>
	The required packages for Debian users are:
	<variablelist>
		<varlistentry>
			<term><systemitem>docbook</systemitem></term>
			<listitem>
				<para>Standard SGML representation system for
				technical documents.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>docbook-xsl</systemitem></term>
			<listitem>
				<para>Stylesheets for processing DocBook XML
				files to various output formats.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>libxslt1.1</systemitem></term>
			<listitem>
				<para>XSLT processing library - runtime library.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>yelp</systemitem></term>
			<listitem>
				<para>Help browser for GNOME 2.</para>
			</listitem>
		</varlistentry>
	</variablelist>
	</para>
	<para>
	Optionally, you could install the next packages to generate the output
	in different formats:
	<variablelist>
		<varlistentry>
			<term><systemitem>xmlto</systemitem></term>
			<listitem>
				<para>XML-to-any converter.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>dblatex</systemitem></term>
			<listitem>
				<para>Produces DVI, PostScript, PDF documents
				from DocBook sources.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem></systemitem></term>
			<listitem>
				<para></para>
			</listitem>
		</varlistentry>
	</variablelist>
	</para>
	<warning>
	<para>
	For those who are not Debian users you can find more information at
	<ulink
	url="http://library.gnome.org/devel/gdp-handbook/stable/gettingstarted.html.en#installingdocbook">
	GNOME Handbook of Writing Software Documentation</ulink>.
	</para>
	</warning>
	</sect2>

	<sect2 id="checking_the_result">
	<title>Checking the result</title>
	<para>
	Firstly, you should check that your document is valid. You can use
	<application>xmllint</application> to do it:
	</para>
	<para>
	<command>xmllint --noout --noent --valid filename.xml</command>
	</para>
	<para>
	If it does not display any error then the document is valid. Otherwise
	you should modify your XML file to follow the DocBook reference.
	</para>
	<para>
	Once you are sure that you have a proper document, you could see the
	final output using <application>yelp</application>:
	</para>
	<para>
	<command>yelp ghelp:/path/to/filename.xml</command>
	</para>
	<para>
	This program will open a GNOME help browser with your manual, you can
	navigate and see the different sections, checking that everything is
	right.
	</para>
	<para>
	This will be the same result as when the manual will be
	integrated as application help.
	</para>
	</sect2>

	<sect2 id="convert_into_different_formats">
	<title>Convert into different formats</title>
	<para>
	On the other hand, you can generate different output formats from your
	document with different applications.
	</para>
	<para>
	In order to get an HTML you could use <application>xmlto</application>:
	</para>
	<para>
	<command>xmlto html filename.xml</command> or
	<command>xmlto html-nochunks filename.xml</command>
	</para>
	<para>
	If you like to generate a PDF it is easier to use
	<application>dblatex</application>.
	</para>
	<para>
	<command>dblatex filename.xml</command>
	</para>
	<para>
	Moreover you could define your own stylesheet to generate a customized
	output.
	</para>
	<tip>
	<para>
	Check the man pages of the different commands from this section, in
	order to know the possible options and arguments of each one.
	</para>
	</tip>
	</sect2>

</sect1>

<sect1 id="integrate_as_application_help">
<title>Integrate as application help</title>
<para>
This section explains how to integrate the written document as help of any GNOME
application. You will need to place the DocBook file in an specific folder and
make several changes on source code (mainly C and Autotools files).
</para>

<warning>
<para>
If you are not a developer and you do not have any knowledge about programming,
you should skip this section and send your manual directly to the developers of
the program, usually via the mailing list or bug tracker of the project. They
will take care of integrating your tutorial in their application.
</para>
</warning>

	<sect2 id="preparing_the_source_code">
	<title>Preparing the source code</title>
	<para>
	First of all, you need to be sure is that
	<systemitem>gnome-common</systemitem> package is installed in your
	computer. After that, you could start the process defined below.
	</para>
	<para>
	Usually DocBook manuals are placed inside a folder called
	<filename>help</filename>, moreover the name of the tutorial file is
	like the application name. Actually, the XML document in English should
	be inside the directory <filename>help/C/</filename>. As in the case of
	<filename>po</filename> directory, inside the folder
	<filename>help</filename> there is a <filename>ChangeLog</filename> file
	to keep a track about the changes related with the tutorial.
	</para>
	<itemizedlist>
	<listitem>
	<para>
	Inside the <filename>help</filename> folder you need a file called
	<filename>Makefile.am</filename> with the next content:
	</para>
	<screen><![CDATA[
include $(top_srcdir)/gnome-doc-utils.make
dist-hook: doc-dist-hook

DOC_MODULE = <document-name>
DOC_ENTITIES = legal.xml
DOC_INCLUDES =
DOC_FIGURES =
DOC_LINGUAS =
	]]></screen>
	<para>
	Where:
	</para>
	<variablelist>
		<varlistentry>
			<term><systemitem>DOC_MODULE</systemitem></term>
			<listitem>
				<para>
				The name of the document, the file name without
				extension.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>DOC_ENTITIES</systemitem></term>
			<listitem>
				<para>
				List of files included in the manual as
				entities. <filename>legal.xml</filename> is
				always included.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>DOC_INCLUDES</systemitem></term>
			<listitem>
				<para>
				List of files included in the tutorial.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>DOC_FIGURES</systemitem></term>
			<listitem>
				<para>
				List of figure paths of the images included in
				the document. Figures are usually inside a
				folder called
				<filename>help/C/figures/</filename>.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>DOC_LINGUAS</systemitem></term>
			<listitem>
				<para>
				List of language codes for which the document is
				translated.
				</para>
			</listitem>
		</varlistentry>
	</variablelist>
	</listitem>
	<listitem>
	<para>
	Furthermore, a template OMF file is required inside the directory
	<filename>help</filename> and it must be called
	<filename>&lt;document-name&gt;.omf.in</filename>. The content of this
	template will be like:
	</para>
	<screen><![CDATA[
<?xml version="1.0" standalone="no"?>
<omf>
  <resource>
    <subject category="<categories>"/>
    <type>manual</type>
    <relation seriesid="<generated-series-id>"/>
    <rights type="GNU FDL" license.version="1.1" holder="<holder-name>"/>
  </resource>
</omf>
	]]></screen>
	<para>
	Where:
	</para>
	<variablelist>
		<varlistentry>
			<term><systemitem>&lt;categories&gt;</systemitem></term>
			<listitem>
				<para>
				List of categories separated by
				"<systemitem>|</systemitem>". These categories
				have to belong to <ulink
				url="http://scrollkeeper.sourceforge.net/documentation/categories.html">
				a concrete list</ulink>.
				</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><systemitem>&lt;generated-series-id&gt;</systemitem></term>
			<listitem>
				<para>
				The first time you can generate this number
				with the command <command>uuidgen</command>. You
				should not change this identifier anymore.
				</para>
			</listitem>
		</varlistentry>
	</variablelist>
	</listitem>
	<listitem>
	<para>
	The next step will be modify the <filename>configure.ac</filename> file,
	just to add the next lines:
	</para>
	<screen><![CDATA[
GNOME_DOC_INIT

...

AC_CONFIG_FILES([
...
help/Makefile
...
])
	]]></screen>
	</listitem>
	<listitem>
	<para>
	It is also needed to modify the top-level
	<filename>Makefile.am</filename> in order to:
	</para>
	<orderedlist>
		<listitem>
		<para>
		Add <filename>gnome-doc-utils.make</filename> to
		<systemitem>EXTRA_DIST</systemitem>.
		</para>
		</listitem>
		<listitem>
		<para>
		Add <filename>gnome-doc-utils.make</filename> to
		<systemitem>DISTCLEANFILES</systemitem>.
		</para>
		</listitem>
		<listitem>
		<para>
		Add <filename>--disable-scrollkeeper</filename> to
		<systemitem>DISTCHECK_CONFIGURE_FLAGS</systemitem>.
		</para>
		</listitem>
	</orderedlist>
	</listitem>
	<listitem>
	<para>
	Add a dependency on <systemitem>gnome-doc-utils</systemitem> module.
	</para>
	</listitem>
	</itemizedlist>
	<para>
	Once you have done all the steps defined above, the DocBook manual will
	be part of the program. It does not appear in application menu, but it
	will be installed on the system when the program is installed. You can
	check it opening the GNOME Help and looking for the name of your
	application.
	</para>
	</sect2>

	<sect2 id="adding_menu_option">
	<title>Adding menu option</title>
	<para>
	If you like that your manual appears in the application menu you should
	modify the source code of that application, so you will need to respect
	the guidelines to write source code in that project.
	</para>
	<para>
	Usually the application uses <systemitem>GtkActionEntry</systemitem> to
	define the menu, so you will need to add the next lines in order to have
	a new entry called "Help", with an option "Contents" that will show your
	tutorial:
	</para>
	<programlisting><![CDATA[
static const GtkActionEntry entries[] = {
	...
	{ "Help", NULL, N_("_Help") },
	...
	{ "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", NULL,
	G_CALLBACK (<application-function-help>) },
	...
}
	]]></programlisting>
	<para>
	Here you can see how to define a callback to execute the function
	<systemitem>&lt;application-function-help&gt;</systemitem>, so here you
	need to use a function where you will open the help manual.
	</para>
	<para>
	You can see some code snippets about how to do this in a lot of GNOME
	projects, for example:
	</para>
	<variablelist>
		<varlistentry>
			<term><application>Eye of GNOME</application></term>
			<listitem>
			<para>
			At line 3345 of file <filename>eog-window.c</filename>
			(<ulink
			url="http://svn.gnome.org/viewvc/eog/tags/EOG_2_25_3/src/eog-window.c?view=markup#l3345"
			>version 2.25.3</ulink>).
			</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><application>Evince</application></term>
			<listitem>
			<para>
			At line 4486 of file <filename>ev-window.c</filename>
			(<ulink
			url="http://svn.gnome.org/viewvc/evince/tags/EVINCE_2_25_2/shell/ev-window.c?view=markup#l4486"
			>version 2.25.2</ulink>).
			</para>
			</listitem>
		</varlistentry>
	</variablelist>
	</sect2>

	<sect2 id="opening_help_document">
	<title>Opening help document</title>
	<para>
	When the new option appears in the menu, you should implement some
	functionality inside the callback defined. The callback function has to
	open <application>yelp</application> and show the application help
	manual.
	</para>
	<para>
	In order to open the tutorial you should use the function
	<ulink url="http://library.gnome.org/devel/gtk/stable/gtk-Filesystem-utilities.html#gtk-show-uri">
	<function>gtk_show_uri</function></ulink>, passing as second argument
	the application name preceded by the prefix
	<systemitem>ghelp:</systemitem>:
	</para>
	<programlisting><![CDATA[
gtk_show_uri (NULL,
	"ghelp:<application-name>",
	gtk_get_current_event_time (),
	&error);
	]]></programlisting>
	<para>
	As in the previous point you can see some code snippets in a lot of
	GNOME projects, for example:
	</para>
	<variablelist>
		<varlistentry>
			<term><application>Eye of GNOME</application></term>
			<listitem>
			<para>
			At line 47 of file <filename>eog-util.c</filename>
			(<ulink
			url="http://svn.gnome.org/viewvc/eog/tags/EOG_2_25_3/src/eog-util.c?view=markup#l47"
			>version 2.25.3</ulink>).
			</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term><application>Evince</application></term>
			<listitem>
			<para>
			At line 3412 of file <filename>ev-window.c</filename>
			(<ulink
			url="http://svn.gnome.org/viewvc/evince/tags/EVINCE_2_25_2/shell/ev-window.c?view=markup#l3412"
			>version 2.25.2</ulink>).
			</para>
			</listitem>
		</varlistentry>
	</variablelist>
	</sect2>

</sect1>


<sect1 id="translation">
<title>Translation</title>
<para>
Translations of GNOME manuals are made in the same way than translation of
applications, using <filename>.po</filename> files based on <ulink
url="http://www.gnu.org/software/gettext/">gettext system</ulink>.
</para>
<para>
In order to translate a manual to a new language you have to follow the next
steps:
<orderedlist>
	<listitem>
	<para>
	Create a folder inside <filename>help</filename> directory called as
	the language code.
	</para>
	<para>
	<command>mkdir help/&lt;langcode&gt;</command>
	</para>
	</listitem>
	<listitem>
	<para>
	Create a <filename>figures</filename> folder (this is only needed if it
	exists a <filename>figures</filename> folder inside
	<filename>help/C</filename>).
	</para>
	<para>
	<command>mkdir help/&lt;langcode&gt;/figures</command>
	</para>
	</listitem>
	<listitem>
	<para>
	Add the new language code to <systemitem>DOC_LINGUAS</systemitem> in
	<filename>Makefile.am</filename>.
	</para>
	<para>
	<screen>DOC_LINGUAS = es, fr, it, &lt;langcode&gt;</screen>
	</para>
	</listitem>
	<listitem>
	<para>
	Use <systemitem>make</systemitem> inside the folder
	<filename>help</filename>, this will generate a file
	<filename>&lt;langcode&gt;/&lt;langcode&gt;.po</filename>.
	</para>
	<para>
	<command>make</command>
	</para>
	</listitem>
	<listitem>
	<para>
	Now, you should translate the new <filename>.po</filename> file using
	some translation tool, or manually editing the file. However, it is
	strongly recommended to use some translation tool, because of this kind
	of applications will help you a lot during the translation process.
	</para>
	</listitem>
	<listitem>
	<para>
	Once the translation is done, the last step should be prepare a patch to
	be sent to the translation team of this language, or directly to the
	developers, depending on the situation. You should not forget to update
	the <filename>ChangeLog</filename> file inside the
	<filename>help</filename> folder.
	</para>
	</listitem>
</orderedlist>
</para>
<para>
This way to do the translations, using gettext as translation system, has a big
advantage, because of people used to translate applications can translate
tutorials without any extra effort, just using the same tools and translating a
new <filename>.po</filename> file. The translation process of a manual is
transparent for them.
</para>
</sect1>


<bibliography>
<title>References</title>

<biblioentry>
	<title>GNOME Documentation Project</title>
	<publisher>
		<publishername>The GNOME Project</publishername>
	</publisher>
	<bibliomisc>URL:
	<ulink url="http://live.gnome.org/DocumentationProject" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>GNOME Documentation Library</title>
	<publisher>
		<publishername>The GNOME Project</publishername>
	</publisher>
	<bibliomisc>URL:
	<ulink url="http://library.gnome.org/devel/guides#gdp-documentation" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>GNOME Documentation Build Utilities</title>
	<authorgroup>
		<author>
			<firstname>Shaun</firstname>
			<surname>McCance</surname>
		</author>
	</authorgroup>
	<publisher>
		<publishername>GNOME Documentation Project</publishername>
	</publisher>
	<pubdate>2004</pubdate>
	<bibliomisc>URL:
	<ulink url="http://library.gnome.org/devel/gnome-doc-make/0.14/" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>GNOME Documentation Style Guide</title>
	<authorgroup>
		<author>
			<firstname>John</firstname>
			<surname>Fleck</surname>
		</author>
		<author>
			<firstname>Alexander</firstname>
			<surname>Kirillov</surname>
		</author>
	</authorgroup>
	<publisher>
		<publishername>GNOME Documentation Project</publishername>
	</publisher>
	<pubdate>2005</pubdate>
	<bibliomisc>URL:
	<ulink url="http://library.gnome.org/devel/gdp-style-guide/stable/" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>GNOME Documentation XSLT Manual</title>
	<authorgroup>
		<author>
			<firstname>Shaun</firstname>
			<surname>McCance</surname>
		</author>
	</authorgroup>
	<publisher>
		<publishername>GNOME Documentation Project</publishername>
	</publisher>
	<pubdate>2004</pubdate>
	<bibliomisc>URL:
	<ulink url="http://library.gnome.org/devel/gnome-doc-xslt/0.14/" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>GNOME Handbook of Writing Software Documentation</title>
	<authorgroup>
		<author>
			<firstname>David</firstname>
			<surname>Mason</surname>
		</author>
		<author>
			<firstname>Daniel</firstname>
			<surname>Mueth</surname>
		</author>
		<author>
			<firstname>Alexander</firstname>
			<surname>Kirillov</surname>
		</author>
		<author>
			<firstname>Eric</firstname>
			<surname>Baudais</surname>
		</author>
		<author>
			<firstname>Eugene</firstname>
			<surname>O'Connor</surname>
		</author>
		<author>
			<firstname>John</firstname>
			<surname>Fleck</surname>
		</author>
	</authorgroup>
	<publisher>
		<publishername>GNOME Documentation Project</publishername>
	</publisher>
	<pubdate>2003</pubdate>
	<bibliomisc>URL:
	<ulink url="http://library.gnome.org/devel/gdp-handbook/stable/" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>GDP Document Templates</title>
	<publisher>
		<publishername>The GNOME Project</publishername>
	</publisher>
	<bibliomisc>URL:
	<ulink url="http://developer.gnome.org/projects/gdp/templates.html" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>DocBook.org</title>
	<bibliomisc>URL:
	<ulink url="http://www.docbook.org/" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

<biblioentry>
	<title>DocBook</title>
	<subtitle>The Definitive Guide</subtitle>
	<authorgroup>
		<author>
			<firstname>Norman</firstname>
			<surname>Walsh</surname>
		</author>
		<author>
			<firstname>Leonard</firstname>
			<surname>Muellner</surname>
		</author>
	</authorgroup>
	<publisher>
		<publishername>O'Reilly &amp; Associates, Inc</publishername>
	</publisher>
	<pubdate>2006</pubdate>
	<bibliomisc>URL:
	<ulink url="http://www.docbook.org/tdg/" />.
	Last access: 31 Dec 2008</bibliomisc>
</biblioentry>

</bibliography>

</article>
