Example 15.1. How to markup a command synopsis
<cmdsynopsis> <command>more</command> <group choice="opt"><option>-d</option> <option>l</option><option>f</option> <option>p</option><option>c</option> <option>s</option><option>u</option> </group> <arg>-num</arg> <arg>+/ pattern</arg> <arg>+ linenum</arg> <arg rep="repeat"><replaceable>file</replaceable></arg> </cmdsynopsis>
This should generate:
There are several very nice examples in the Duck book at www.docbook.org
Example 15.2. How to markup a function synopsis
<funcsynopsis> <funcprototype> <funcdef>void <function>setFile</function></funcdef> <paramdef>QString <parameter>file</parameter></paramdef> </funcprototype> </funcsynopsis> <funcsynopsis> <funcprototype> <funcdef>void <function>setAutoResize</function></funcdef> <paramdef>bool <parameter><replaceable>val</replaceable></parameter></paramdef> </funcprototype> </funcsynopsis> <funcsynopsis> <funcprototype> <funcdef>QString <function>getVideoCodec</function></funcdef><void/> </funcprototype> </funcsynopsis>
These would generate the following, respectively.
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.
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(...);
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”