You first need to write your documentation. The GNOME project has decided upon DocBook as the SGML layout engine to use for all documentation. The tools for this are described in the documentation tools section.
If you have very simple documentation it is ok if you write your docs in HTML. Look at Electric Eyes and the gnome-help-browser for examples of apps with online help.
The process to link your documentation to your app is very simple.
First create a file called topic.dat. The format
is available in CVS at gnome-devel/docs/FORMAT.topic.dat.
When this was written the format was:
One line for each 'topic'. Two columns, as defined by perl -e 'split(/\s+/,$aline,2)' First column is the HTML file (and optional section) for the topic, relative to the app's help file dir. Second column is the user-visible topic name.The topic.dat file currently gets copied into the directory
$prefix/share/gnome/help/<appname>/C/topic.dat.
All the HTML documentation also goes in this directory. The file
references in the first column of the topic.dat file
are all relative to this directory as well.
NOTE: If the help files are not present in the correct directory, the menu items will NOT appear when the program is run.
The topic.dat file is used by the GNOME menu building
code.
When you have a menu definition of:
GnomeUIInfo helpmenu[] = {
{GNOME_APP_UI_ITEM,
N_("About"), N_("Info about this program"),
about_cb, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT,
0, 0, NULL},
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_HELP("help-browser"),
GNOMEUIINFO_END
};
the line which is in BOLD causes GNOME to create a menu entry
which is tied to the documentation in the directory mentioned above
with <appname> equal to the string argument (
"help-browser" in this example). Also, all the topics
in the topic.dat file will get menu entries in the help
menu. When the user picks any of these topics from the help menu, a
help browser will be started with the associated HTML documentation.