README.metadata
1KHelpCenter documentation meta data structure
2=============================================
3
4KHelpCenter uses meta data files which describe the documentation available in
5the system. Each document is represented by a meta data file and shown as an
6entry in the KHelpCenter navigation tree view. The meta data contains
7information about title and short description of the document, the location of
8the document and some more information like how to search the document and
9translations of title and description. Document hierarchy is represented as
10hierarchy of the meta data files. Directories are also described by a meta data
11file which contains the same information as a document meta data file.
12
13Format of the meta data files
14-----------------------------
15
16The meta files adhere to the Desktop Entry Standard
17(https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/). Documentation
18specific extensions are covered by an own namespace using the prefix "X-DOC-".
19The following table describes all keys which are currently used by
20KHelpCenter:
21
22Key Value Description
23
24Name string Title of document
25Name[xx] string Translated title for language xx
26Comment string Short description of document
27Comment[xx] string Translated short description for
28 Language xx
29Icon string Name of icon for document
30X-DocPath URI Location of document. In addition to the
31 standard URI schemes like http: and file:
32 all schemes which are supported through
33 kioslaves can be used. In particular the
34 following non-standard URI schemes are
35 supported:
36 help: KDE manual identified by app name
37 ghelp: GNOME manual identified by app name
38 man: man page
39 info: info page
40 cgi: output of CGI script
41X-DocPath[xx] URI Language specific location for
42 language xx
43Lang langcode Language of document
44X-DOC-Identifier string Unique identifier for document, if this
45 entry is not present the base name of the
46 file is used as identifier
47X-DOC-Indexer command Command used for creating a search index
48 for the document.
49 The following symbols are replaced by the
50 corresponding values:
51 %f - Filename
52X-DOC-IndexTestFile filename Name of file whose existence indicates
53 the existence of a usable search index
54X-DOC-Search command Command used for searching, the output
55 of the command should be HTML which is
56 shown in KHelpCenter.
57 The following symbols in the command are
58 replaced by the corresponding values:
59 %k - Words to be searched for
60 %n - Maximum number of results
61 %m - Method for combining search words,
62 can be 'and' or 'or'
63 %l - Language of documents to be searched
64 %s - Scope of search. This is a list of
65 identifiers as given by the
66 X-DOC-Identifier entry or the bas
67 name of the desktop file if not
68 present.
69X-DOC-SearchMethod string If this entry is 'htdig' htdig is used to
70 index and search the document. The
71 Indexer, IndexTestFile and Search entries
72 aren't required in this case.
73X-DOC-SearchEnabledDefault bool If set to 'true' the document is searched
74 by default, if set to 'false' it is not.
75 This setting is overridden by user
76 selected search scopes.
77X-DOC-Weight int A number indicating the position of the
78 document within the list of siblings. A
79 greater weight indicates that the document
80 is 'heavier', thus shown below 'lighter'
81 documents. The default weight is 0.
82X-KDE-KHelpcenter string If this entry is set to one of the
83 following values a set of documents
84 generated by other means than desktop file
85 meta info is inserted at the place
86 specified by the desktop file:
87 'apps' manuals of applications
88 from the start menu
89 'scrollkeeper' scrollkeeper docs
90 'kinfocenter' kinfocenter docs
91 'kcontrol' kcontrol module docs
92 'konqueror' konqueror plugin docs
93 'kioslave' kioslave docs
94 'info' info pages
95X-DOC-DocumentType string Type of document. The type is used to look
96 up corresponding search handlers.
97
98Meta File Location
99------------------
100
101A list of directories given by the config entry "MetaInfoDirs" in the "General"
102group of the help center configuration file "khelpcenterrc" (at
103$KDEDIRS/share/config) is scanned for desktop files. They are merged to a common
104hierarchy. If the "MetaInfoDirs" entry is empty the directory at
105$KDEDIRS/share/apps/khelpcenter/plugins is used.
106
107Document Hierarchy
108------------------
109
110The hierarchy of the documents shown in the help center is reflected by the
111hierarchy of the desktop files in the filesystem. Directories can have an
112associated desktop file with the name ".directory". It can contain all the
113keys described above.
114
115Language handling
116-----------------
117
118In addition to translation of meta information like title and short description
119of documents which is contained in the meta file, translations of whole
120documents are handled. Each translation of a document has an own desktop file.
121The language of the document is indicated by adding the language code as
122additional suffix to the filename of the desktop file. The language suffix
123is added before the ".desktop" suffix (Example: 'apache.de.desktop' would be the
124file name for the german translation of the apache documentation).
125
126KHelpCenter shows only the documents whose language is contained in the list of
127used languages configured for the desktop in the control center. A document
128corresponding to a desktop file without language suffix is always shown.
129