Documentation Primer/Manual/DocBook Reference/Synopsis

Jump to: navigation, search
Other languages:English 100%

The synopsis elements


Example: How to markup a command synopsis
<group choice="opt"><option>-d</option>
<arg>+/ pattern</arg>
<arg>+ linenum</arg>
<arg rep="repeat"><replaceable>file</replaceable></arg>
This should generate:
more [-dlfpcsu][-num][+/ pattern][+ linenum][file]

There are several very nice examples in the Duck book at <funcsynopsis>

Example: How to markup a function synopsis
<funcdef>void <function>setFile</function></funcdef>
<paramdef>QString <parameter>file</parameter></paramdef>

<funcdef>void <function>setAutoResize</function></funcdef>
<paramdef>bool <parameter><replaceable>val</replaceable></parameter></paramdef>

<funcdef>QString <function>getVideoCodec</function></funcdef><void/>

These would generate the following, respectively.
void setFile(file);
QString file;
void setAutoResize(val);
bool val;
QString getVideoCodec();
A function synopsis can contain the following:

Contains a prototype of the function. It can contain <void>, <varargs>, <paramdef> or most commonly, a <funcdef> which actually defines the function.

A function and it's return type.

Contains the list of parameters for the function.

Information about the parameters of a function.

An empty element in a function indicating there are no arguments.

An empty element in a function indicating there are multiple arguments, without specifically listing them. This is generally represented with an ellipsis (...). For example int max(...);

Not used in KDE documentation.


Used inside <cmdsynopsis>. Since most KDE applications are &GUI; only, you won't see this very often. See the entry for <cmdsynopsis> for a full explanation and example.








A modifier modifies a class, field, or method synopsis. Examples are the words "public", "private" or "virtual"


A field synopsis.

This page was last modified on 9 September 2012, at 10:37. This page has been accessed 1,906 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal