summaryrefslogtreecommitdiff
path: root/docs/help-spec-0.2.xml
blob: 14e772df94cda34ca50ce0a45ef54bab3c6b01b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
  <!ENTITY version "0.2">
  <!ENTITY dtd-version "1.0">
				  ]>

<article id="index">
  <articleinfo>
    <title>Help System Specification</title>
    <releaseinfo>Version &version;</releaseinfo>
    <date>23 November 2006</date>
    <authorgroup>
	  <author>
	  <firstname>Don</firstname>
	  <surname>Scorgie</surname>
	  <affiliation>
	    <address>
	  	<email>DonScorgie@Blueyonder.co.uk</email>
	  	</address>
	  </affiliation>
	  </author>
      <author>
	<firstname>Roman</firstname>
	<surname>Joost</surname>
	<affiliation>
	  <address>
	    <email>romanofski@gimp.org</email>
	  </address>
	</affiliation>
      </author>
      <author>
	<firstname>Christopher</firstname>
	<surname>Lahey</surname>
	<othername role="mi">James</othername>
        <affiliation>
	  <address>
	    <email>clahey@ximian.com</email>
	  </address>
	</affiliation>
      </author>
      <author>
	<firstname>Shaun</firstname>
	<surname>McCance</surname>
	<affiliation>
	  <address>
	    <email>shaunm@gnome.org</email>
	  </address>
	</affiliation>
      </author>
      <author>
	<firstname>Cornelius</firstname>
	<surname>Schumacher</surname>
	<affiliation>
	  <address>
	    <email>schumacher@kde.org</email>
	  </address>
	</affiliation>
      </author>
    </authorgroup>
  </articleinfo>

  <sect1 id="introduction">
    <title>Introduction</title>
    <para>
      Providing help to the user is one of the most important functions of a
      user-friendly desktop system. This document specifies how desktop help
      systems can find, navigate, show and search documentation. This includes
      application manuals, context-sensitive help and documentation not
      associated with a specific application. Documentation can be provided in
      in numerous formats, for example Docbook, HTML, PDF and can also be
      provided over the net.
    </para>
    <para>
      The goal of this standard is to provide the base for a unified
      cross-desktop documentation system.
    </para>

  </sect1>

  <sect1 id="goals">
    <title>Goals of the help system</title>
    <para>
      This help system standard aims at providing help browser developers and
      application authors as well as documentation creators the means to
      integrate and consistently handle all documentation present on a system.
      It doesn't mean to specify any implementation details or to impose any
      policies about what type of help browser to use or how exactly the
      documentation is organized or formatted.
    </para>
    <para>
      These are the specific goals of the help system specification:
    </para>
    <itemizedlist>
      <listitem>
        <para>
          Users should be able to choose the help browser of their choice.
        </para>
      </listitem>
      <listitem>
        <para>
          The help system should impose as little policy as possible on the
          help browser, and should expose as little policy as possible to
          documenters.
        </para>
      </listitem>
      <listitem>
        <para>
          It should be simple to place a document in the help system. The help
          system shouldn't require anything to be run to register or
          unregister a document. That just begs for problems.
        </para>
      </listitem>
      <listitem>
        <para>
          The help system should not assume anything about the viewing
          program. The viewer may not be a graphical program like Yelp or the
          KDE Help Center. It may be a print system, a console program, or
          some sort of documentation server.
        </para>
      </listitem>
      <listitem>
        <para>
          Documents should be able to supply meaningful meta data, which help
          viewers may be able to use. The meta data format for documents should
          be easily extended in a well-defined way.
        </para>
      </listitem>
      <listitem>
        <para>
          Applications should have a simple and consistent way of accessing
          their documentation, independent of the desktop environment.
        </para>
      </listitem>
      <listitem>
        <para>
          Documents should have a simple and consistent way of referencing other
          pieces of documentation, independent of the desktop environment.
        </para>
      </listitem>
      <listitem>
        <para>
          The help system should be capable of pulling information from other
          existing help systems. This way we can have legacy compatibility
          with KDE's and GNOME's current systems. Also, this can provide a
          consistent means for help viewers to integrate man and info, if they
          choose to.
        </para>
      </listitem>
    </itemizedlist>

  </sect1>

  <sect1 id="definitions">
    <title>Definitions</title>
    <variablelist>
      <varlistentry>
        <term>Help System</term>
        <listitem>
          <para>
            The framework for finding, navigating, showing and searching help.
            This usually includes a help browser, support for applications
            showing manuals and context help.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Help Browser</term>
        <listitem>
          <para>
            An application for browsing all help content which is available on
            the system. This usually includes showing a, possibly hierarchical
            list, of available documentation, facilitates to search all
            documentation and a view of the selected documentation.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Document</term>
        <listitem>
          <para>
            A self-contained piece of documentation. This can for example be an
            application manual, a single help page, a complete book or a
            website.
          </para>
        </listitem>
      </varlistentry>
     <varlistentry>
        <term>Section</term>
        <listitem>
          <para>
            A document may be made up of separate sections.  These may be defined
            within the document or externally.  For more details on this, please
            see the <link linkend="Mallard">Additional Sections section</link>
            of this document.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>

  </sect1>

  <sect1 id="overview">
    <title>Overview</title>
    <para>
      The help system accesses the documentation by making use of meta data
      which accompanies the documentation. This meta data is provided at a
      standard location as files whose content is based on the desktop entry
      specification.
    </para>
    <para>
      The meta data contains information about the title of the document, where
      to find it, what type of format it is and to which categories it belongs.
      Based on this information help browsers can provide navigation, search and
      display of all documents known to the help system.
    </para>
    <para>
      For making the help system aware of a certain piece of documentation it's
      enough to create the meta data file and put it at the appropriate
      location. This makes it easy for documentation creators to integrate their
      documentation into the help system and also provides a simple way to
      integrate third party documentation.
    </para>
    <para>
      More advanced features of help browsers like hierarchical displays of
      documents and their content or searching documentation can implemented in
      a generic way using the meta data information provided by the help system.
      The help system specification doesn't impose any policies or restrictions
      how (or if) help browsers should implement these kinds of functionality.
    </para>
  </sect1>

  <sect1 id="paths">
    <title>Documentation Meta Data</title>
    <para>
      In order to provide the help system with the information of where to find
      individual pieces of documentation and some more meta information, each
      document or section is accompanied with a file containing the meta data
      using the desktop entry specification (aka a "desktop file"). The desktop
      files contain some extended attributes specific to the help system.
    </para>

    <para>
      Individual documents or sections come with individual desktop files in
      order to make packaging easier and not requiring any post-installation
      processing.
    </para>

    <para>
      This section describes, how the meta data files are found by the help
      system, what specific entries they contain and how language-specifics are
      handled.
    </para>

    <sect2 id="meta-data-location">
      <title>Location of meta data</title>
      <para>
        The help system should read desktop files containing meta data from
        <literal>$XDG_DATA_HOME/help/</literal>, followed by
        <literal>$XDG_DATA_DIRS/help/</literal> (here, referred to
        together as <literal>$LOCATIONS</literal>) using the <ulink
        url="http://freedesktop.org/wiki/Standards_2fbasedir_2dspec">XDG
        Base Directory Specification</ulink>. If a file with the same name is
        found at multiple locations, the first one is used and the
        others are ignored.
      </para>

      <para>
        Sub-directories of <literal>$LOCATIONS</literal> are
        scanned recursively (excluding
        <literal>$LOCATIONS/LOCALE</literal>) to get all desktop files.
      </para>

      <para>
        As per the Base Directory Specification, if $XDG_DATA_HOME is empty or
        undefined, a path of <literal>$HOME/.local/share</literal> is used.  If
         <literal>$XDG_DATA_DIRS</literal> is empty or undefined, a default
         path of <literal>/usr/local/share/:/usr/share/</literal> should be
         used.
      </para>

      <para>
        The filename for document meta data files consists of a basename and the
        ".document" suffix.
      </para>

    </sect2>

    <sect2 id="desktop-file-extensions">
      <title>Desktop Entry Fields</title>
      <para>
        The help system specification uses several standard fields. They are
        described in the
        <ulink url="http://standards.freedesktop.org/desktop-entry-spec/latest/">desktop
        entry specification</ulink>.
      </para>
      <para>
      	All entries below belong to the group header "Document".  The "Required?" field states
      	whether the key is required or option.  If it is optional, sane defaults must be provided
      	by the help system (identified in footnotes).

        <table>
          <title>Standard Desktop Entry Fields used by Help System</title>
          <tgroup cols="4">
	    <thead>
	      <row>
	        <entry>Key</entry>
	        <entry>Description</entry>
	        <entry>Value Type</entry>
	        <entry>Required?</entry>
	      </row>
	    </thead>
	    <tbody>
	      <row>
	        <entry><varname>Name</varname></entry>
	        <entry>
                  Title of document.
                </entry>
	        <entry>localestring</entry>
	        <entry>Yes</entry>
	      </row>
	      <row>
	        <entry><varname>Comment</varname></entry>
	        <entry>
                  Short description of document.
                </entry>
	        <entry>localestring</entry>
			<entry>No<footnote><para>Defaults to empty</para></footnote></entry>
	      </row>
	      <row>
	        <entry><varname>Icon</varname></entry>
	        <entry>
                  Name of icon for document.  As per the desktop entry spec,
                  this may be either an icon name or a filename.  If the icon is
                  named (i.e. no path), the icon is found using the algorithm
                  defined in
                  <ulink url="http://freedesktop.org/wiki/Standards/icon-theme-spec">
                  the icon naming spec</ulink>
                </entry>
	        <entry>string</entry>
	        <entry>No<footnote><para>Defaults to empty</para></footnote></entry>
	      </row>
	      <row>
	      <entry><varname>Categories</varname></entry>
	      <entry>
                Categories the document belongs to. For possible values see the
                <ulink url="http://standards.freedesktop.org/menu-spec/latest/">
                menu entry specification</ulink>. Help browsers
                can base a hierarchical view on the categories.
              </entry>
	      <entry>semi-colon separated strings</entry>
		  <entry>Yes</entry>
	    </row>
            </tbody>
          </tgroup>
        </table>
      </para>

      <para>
        In addition to the standard fields the meta data files uses several
        extensions to the desktop entry standard within this group, which
        contain meta data specific to the help system. The keys of all
        help system specific entries in this group are prefixed with "Doc".
      </para>

      <table>
        <title>Extended Desktop Entry Fields used by Help System</title>
        <tgroup cols="4">
	  <thead>
	    <row>
	      <entry>Key</entry>
	      <entry>Description</entry>
	      <entry>Value Type</entry>
		  <entry>Required?</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><varname>DocPath</varname></entry>
	      <entry>
	        Location of document. In addition to the standard URI schemes
                like http: and file: the help system can support non-standard
                URI schemes to access specific kinds of documentation which
                aren't accessible by a standard URI. In particular the following
                non-standard URI schemes can be supported:
                <simplelist>
                <member>help:  KDE manual identified by app name,</member>
                <member>ghelp: GNOME manual identified by app name,</member>
                <member>man:   man page,</member>
                <member>info:  info page</member>
                </simplelist>
	      </entry>
	      <entry>URI (locale-dependent)</entry>
	      <entry>Yes</entry>
	    </row>
	    <row>
	      <entry><varname>DocType</varname></entry>
	      <entry>
                Mime type of document.
              </entry>
	      <entry>string</entry>
	      <entry>Yes</entry>
	    </row>

	    <row>
	      <entry><varname>DocWeight</varname></entry>
	      <entry>
                A number indicating the position of the document within the list
                of siblings. A greater weight indicates that the document is
                'heavier', thus shown below 'lighter' documents. The default
                weight is 0. Negative values are legal. When assigning weights
                to documents it should be made sure that enough room is left to
                make it possible to put other documents before or after the
                documents.
              </entry>
	      <entry>int</entry>
	      <entry>No<footnote><para>Defaults to 0</para></footnote></entry>
	    </row>
	    <row>
	      <entry><varname>DocIdentifier</varname></entry>
	      <entry>
	        Unique identifier for document.  Entries should be an R-DNS style,
                for example "org.gnome.user-guide" or "org.kde.konqueror".
                If this isn't present, it defaults to "org.other.&lt;basename&gt;"
              </entry>
	      <entry>string</entry>
	      <entry>No<footnote><para>Defaults to org.other.&lt;basename&gt;</para></footnote></entry>
	    </row>
	    <row>
	      <entry><varname>DocLang</varname></entry>
	      <entry>
                Language of document. This entry is only considered if multiple
                locale strings are not defined within the file.
              </entry>
	      <entry>language code</entry>
	      <entry>No<footnote><para>Defaults to "en"</para></footnote></entry>
	    </row>
	    <row>
	      <entry><varname>DocHeritage</varname></entry>
	      <entry>
	        The scrollkeeper seriesid, used for backwards compatibility.
	        If the document is new or does not have a current scrollkeeper seriesid,
	        this field is not required.  Should be of the R-DNS form
	        "org.scrollkeeper.&lt;seriesid&gt;".
	      </entry>
	      <entry>string</entry>
	      <entry>No<footnote><para>Defaults to empty</para></footnote></entry>
	    </row>
          </tbody>
        </tgroup>
      </table>

    <para>
      Fields defined in a document meta data file, other than those defined here,
      are invalid and should be ignored.
    </para>
    </sect2>

    <sect2 id="language-specific-docs">
      <title>Language-specific documentation</title>
      <para>
        All desktop file fields can be language-specific (e.g. "Name[fr]").
        This is especially useful for the <varname>title</varname> and
        <varname>comment</varname> fields to
        provide translations of the meta data. It can also be used for the
        <varname>DocPath</varname> field, to reference translated versions of
        documents. An alternative to language-specific fields is to provide a
        separate desktop file for each translated version of the document.
        Which alternative is the best one is often determined by packaging
        requirements.
      </para>

      <para>
        Language-specific desktop files are read from
        <literal>$XDG_DATA_DIRS/help/LOCALE/LC</literal>, where LC is a two-letter
        ISO language code (TODO: reference language code specification). The
        files in language-specific directories are read according to the same
        rules as non-language-specific files.  Locale specific files take
        priority over regular entries within the same base directory.
      </para>
      <para>
        If there are multiple versions of the same document in different
        languages, there can be multiple desktop files with the same name,
        located within <literal>$XDG_DATA_DIRS/help/locale/LC</literal>. It is
        up to the help system to decide which file is to be used based on the
        preferences of the user.  This preference is defined by the
        <literal>$LANGUAGE</literal> environment variable.
      </para>
    </sect2>

    <sect2 id="Mallard">
	  <title>Additional Sections</title>
	  <para>
	  	In addition to "full" documents described previously, documents can be
	  	made up from one or more "sections".
	  </para>
	  <para>
	  	These sections may either be specified within the document desktop file,
	  	or in their own desktop file.  These section files are stored in the
	  	$XDG_DATA_DIRS/help (sub-)directories and have filenames consisting of
	  	a basename and the ".section" suffix.
	  </para>
	  <para>
	  	As before, the first entry found is used and subsequent entries are ignored.
	  	In the special case where a ".section" file defines a section already found in
	  	a document file and both files are in the same directory, the new
	  	section overloads the previously defined section.
	  </para>
      <para>
        similarly, language-specific versions of section files may be supplied
        in <literal>$XDG_DATA_DIRS/help/LOCALE/LC</literal>.  These files follow
        the same rules as previously outlined.
      </para>
	  <para>
	  	The entries within sections belong to the "Section" group header and are described below.
	  	All entries are prefixed by "Section".
	  </para>

	  <table>
        <title>Section Desktop Entry Fields used by Help System</title>
        <tgroup cols="4">
	  <thead>
	    <row>
	      <entry>Key</entry>
	      <entry>Description</entry>
	      <entry>Value Type</entry>
		  <entry>Required?</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><varname>SectionName</varname></entry>
	      <entry>
	        The title of the section
	      </entry>
	      <entry>localestring</entry>
	      <entry>Yes</entry>
	    </row>
	    <row>
	      <entry><varname>SectionIdentifier</varname></entry>
	      <entry>
                The ID of the section for referencing within the document
              </entry>
	      <entry>string</entry>
	      <entry>Yes</entry>
	    </row>
	    <row>
	      <entry><varname>SectionDocument</varname></entry>
	      <entry>
                The parent document to which the section belong.  This is
                in the form of the parent documents "DocIdentifier" in the
                R-DNS style described above.  For subsections (or lower), the
                R-DNS must include the parent section path.  E.g. "org.gnome.user-guide.CDBurning"
                would describe a section from the GNOME user guide that is a child of
                the "CDBurning" section.  If the section is defined within the
                master document meta data file, the document "DocIdentifier" may
                be neglected.
              </entry>
	      <entry>string</entry>
		  <entry>Yes<footnote>This entry is only required for sections defined
		  in a separate file from the main document.  For sections defined
		  within the document meta data file, the SectionDocument is implied to
		  be the current document.</footnote></entry>
	    </row>
	    <row>
	      <entry><varname>SectionPath</varname></entry>
	      <entry>
	        The path to the file containing the section.  This can be either relative
	        to the parent document's path (if no full path is given) or an absolute file path
	      </entry>
	      <entry>URI (locale-dependent)</entry>
	      <entry>Yes</entry>
	    </row>
          </tbody>
        </tgroup>
      </table>
	</sect2>
  </sect1>

  <sect1 id="doc-location">
    <title>Location of Documentation</title>
    <para>
      The help standard doesn't imply any policy where the files containing
      the actual documentation are located. The only requirement is that the
      DocPath from the meta data files points to the right location.
    </para>

    <para>
      If the DocPath is a full URI, it is taken as it is. Absolute paths are
      promoted to "file:" URIs.
    </para>

  </sect1>

  <sect1 id="identifying-referencing">
    <title>Identifying and Referencing help</title>
    <para>
      The help system has to be able to identify and reference help documents.
      This is needed for applications to provide manuals or context-sensitive
      help or to cross-link documents. It is also needed for locating
      documentation from within the desktop meta data files.
    </para>

    <sect2 id="identifiers">
      <title>Identifiers</title>
      <para>
        Each document is uniquely identified by an identifier. The
        identifier is defined within the meta data file as the
        DocIdentifier entry. The identifier has to be unique on the system.
        If there are multiple language versions of a
        document all of them are identified by the same identifier.
      </para>

      <para>
      	The unique identifier is used within the help system to determine if
      	duplication has occurred.  If two meta data files have the same identifier,
      	first one discovered by the help system is used.  In the special
      	case of two meta data files in
      	the same directory sharing an identifier, the first discovered by the
      	help system is used (which may vary depending on system).
      </para>
    </sect2>
    <sect2 id="calling-help">
    <title>Invoking the Help Browser</title>
    <para>
      If a desktop environment provides a help browser it has to provide a
      program "xdg_help" in the binary search path which starts the help
      browser. The program should handle URIs and document identifiers as
      command line options.  When invoked with a URI or command line option,
      the program should open the relevant document and section specified.
    </para>

    <para>
      The "xdg_help" program may also be invoked through a dbus call to
      "org.freedesktop.help_system" on the session bus.  The program must
      respond to two signals.
      <variablelist>
      <varlistentry><term><para>open_document (DocIdentifier: string)</para>
      </term>
      <listitem>Open the given identifier</listitem>
      </varlistentry>
      <varlistentry>
      <term><para>close_document (DocIdentifier: string)</para></term>
      <listitem>Close the given identifer, if an open window exists
                currently displaying the document with the given identifier
      </listitem>
      </varlistentry>
      </variablelist>
      (Brackets denote required input parameters and types).  Both methods are
      asynchronous and are not expected to return anything.
    </para>

    <para>
      Sections of documents may be requested by extending the document
      identifier to include the section id.  If the document has registered
      sections, the section identifier may point to one of these.  If no
      registered sections are available, the section identifier is assumed to
      point to an internal (implicit) section within the found document /
      section and treated as such when the document is displayed.
    </para>

    <para>
        In order to call the help system from within an application, several
        options are available:
        <itemizedlist>
        <listitem>Issue the command "xdg_help &lt;uri&gt;" through system() or
                  similar</listitem>
        <listitem>Issue the command "xdg_help &lt;DocIdentifier&gt;" through
                  system() or similar</listitem>
        <listitem>Issue a dbus command of "open_document" with the associated
                  docidentifier as an argument to "org.freedesktop.help_system"
                  on the session bus.
        </listitem>
        </itemizedlist>
    </para>
    <para>
        In the first case, the given URI should be opened without reference to
        any meta data files available.  In the second and third cases, the
        help system should find the appropriate meta data file and use the
        specified docpath from that meta data.
    </para>
  </sect2>
  </sect1>

  <appendix id="examples">
  <title>Example Help System Meta Data Files</title>
  <para>
	This appendix gives examples of meta data desktop files for use within
	the help system.
  </para>
  <para>
  	A basic docbook desktop file with German translation (with apologies for the translation).
  </para>
  <programlisting>
# Beanstalk manual description
[Document]
Name=The Beanstalk Manual
Name[de]=Das Bohnenstange-Handbuch
Comment=Jack likes beanstalks.  With this manual, you too can grow you're own
beanstalk.  Who knows, you may even find a golden egg or two!
Comment[de]=Jack mag Bohnenstangen.  Mit diesem Handbuch kannst du dich wachsen
auch sollst Bohnenstange besitzen.  Wer weiß, kannst du ein goldenes Ei oder zwei
sogar finden!
DocPath=file://usr/share/help/C/beanstalk/beanstalk.xml
DocPath[de]=file://usr/share/help/de/beanstalk/beanstalk.xml
DocType=application/docbook+xml
Categories=GNOME;Building;Construction
DocIdentifier=org.gnome.beanstalk
# Displaces a document previously registered with scrollkeeper
DocHeritage=org.scrollkeeper.2a958241-f90e-4aca-a201-cc5d21b7b6ce
  </programlisting>

  <para>
  	Another manual (with different keys), installed as a pdf.  No translations.
  </para>
  <programlisting>
[Document]
# Glermo's proprietary app.  Installed as a pdf to stop thieving.
# Comments are lines that begin with a '#' symbol.
Name=Glermo's Magic Beanstalk Recipes
Comment=Tired of the semi-finished Beanstalk from Jack?  With Gelrmo,
you don't need to worry, we're already finished!
# Named icons don't need a path.  This assumes the system knows the icon
# exists.
Icon=glermo-beanstalk
DocPath=file:///opt/glermo/help/glermo.pdf
DocType=application/pdf
# We want to be first on the list, dag nabbit
DocWeight=-50
Categories=Construction
DocIdentifier=org.other.glermo
  </programlisting>

  <sect2 id="mallard-eg">
  <title>Documentation with Defined Sections</title>
  <para>
  	In this section, one "document" is described - "GNOME User Guide",
  	comprising of 2 sections - "Desktop Tools" and "CD Burning".  I'll forgo
  	you the agony of my translations.
  </para>
  <programlisting>
# First the document.  This would be user-guide.desktop
[Document]
Name=GNOME User Guide
Comment=Learn how to use you're GNOME desktop
DocPath=file://usr/share/gnome/help/user-guide/C/user-guide.xml
# Made up mime type.  Do we need to define a mime type for Mallard docs?
DocType=application/mallard+xml
Categories=GNOME
# We really want to be listed first.  For real reasons this time,
# not just vanity
DocWeight=-5
DocIdentifier=org.gnome.user-guide

# Define one section
[Section]
SectionName=Desktop Tools
# Don't give a full path.  The full path is found using the DocPath given
# above.  The complete path is /usr/share/gnome/help/user-guide/C/desktop-tools.xml
SectionPath=desktop-tools.xml
SectionIdentifier=desktoptools
# Don't need to define section document as we're defined in the parent
# docs meta data file

# Now we define the second section
[Section]
SectionName=CD Burning
SectionPath=cdburning.xml
SectionIdentifier=cdburning
  </programlisting>

  <para>
   In the same directory, someone else has defined a new section file, defining a new "CD Burning" section.
   This new section contains a new subsection - "DVD Burning".  This new version will overwrite the
   section defined above.
  </para>
  <programlisting>
# The new CD Burning section.  This would be the file cdburning.section
[Section]
SectionName=Burning Media
SectionIdentifier=cdburning
SectionDocument=org.gnome.user-guide
# Sections defined outside the main document meta data file
# almost certianly want to define the location with an absolute path
SectionPath=file://tmp/testing/cdburning.xml
SectionChildren=dvdburning

# Define the dvd burning section here as well
SectionName=Burning a DVD
SectionIdentifier=dvdburning
# Not strictly necessary as we already know the parent (above), but it won't
# hurt to define it anyway
SectionPath=file://tmp/testing/dvdburning.xml
# Parent is the CD Burning section.  Add that to the Document ID as below
SectionDocument=org.gnome.user-guide.cdburning
  </programlisting>
  </sect2>
  </appendix>
  <appendix id="example-calls">
  <title>Example Help System Calls</title>
    <para>
      This section demonstrates various methods of requesting the help system
      open a particular document or section.  This is intended to show how
      application authors would implement requests.  All code here is
      psuedo-code.
    </para>
    <para>
      An example of a simplistic call to help from a program requesting that the
      user manual for "The Beanstalk Program" be opened.
    </para>
    <programlisting>
# User requested help.  Open using dbus.
bus = get_dbus_session_bus ()
bus.send_signal (bus, "org.freedesktop.help_system",
                 "open_document", "org.gnome.beanstalk");
    </programlisting>
    <para>
      The following example shows how to request subsections and a possible
      example of requesting a filename be opened.
    </para>
    <programlisting>
if (installed)
  # We're running in installed mode, request help using the proper route
  bus.send_signal (bus, "org.freedesktop.help_system",
                   "open_document", "org.gnome.beanstalk.Growing"
else
  # We're uninstalled.  The help probably isn't registered.  If it is
  # it's probably old.  Request using the filename instead.
  system ("xdg_help ../help/C/beanstalk.xml#Growing")
    </programlisting>
    <para>
      Finally, for the app that doesn't want to depend on dbus, we present yet
      another method of accessing help (same section as above)
    </para>
    <programlisting>
# Help requested.  Opening.
system ("xdg_help org.gnome.beanstalk.Growing")
    </programlisting>
  </appendix>
</article>